2 * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef READERHELPER_H_
18 #define READERHELPER_H_
20 /* standard library header */
23 /* SLP library header */
26 #include "Synchronous.h"
27 #include "SessionHelper.h"
31 namespace smartcard_service_api
33 class SEServiceHelper;
35 typedef void (*openSessionCallback)(SessionHelper *session, int error, void *userData);
37 class ReaderHelper : public Synchronous
41 vector<SessionHelper *> sessions;
42 SEServiceHelper *seService;
46 virtual ~ReaderHelper() {}
49 inline const char *getName() { return name; }
50 inline SEServiceHelper *getSEService() { return seService; }
51 inline bool isSecureElementPresent() { return present; }
53 virtual void closeSessions()
54 throw(ErrorIO &, ErrorIllegalState &) = 0;
56 virtual int openSession(openSessionCallback callback, void *userData) = 0;
57 virtual SessionHelper *openSessionSync()
58 throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)= 0;
61 } /* namespace smartcard_service_api */
62 #endif /* READERHELPER_H_ */