#ifndef TERMINAL_H_
#define TERMINAL_H_
+/* standard library header */
+
+/* SLP library header */
+
+/* local header */
#include "ByteArray.h"
#include "Synchronous.h"
namespace smartcard_service_api
{
+ /* LCOV_EXCL_START */
typedef void (*terminalNotificationCallback)(const void *terminal, int event, int error, void *user_param);
typedef void (*terminalTransmitCallback)(const unsigned char *buffer, unsigned int length, int error, void *userParam);
typedef void (*terminalGetATRCallback)(const unsigned char *buffer, unsigned int length, int error, void *userParam);
- class EXPORT Terminal : public Synchronous
+ class Terminal : public Synchronous
{
protected:
terminalNotificationCallback statusCallback;
bool initialized;
+ bool closed;
char *name;
public:
static const int NOTIFY_SE_AVAILABLE = 1;
static const int NOTIFY_SE_NOT_AVAILABLE = -1;
- Terminal() : statusCallback(NULL),
- initialized(false), name(NULL) {}
+ Terminal() : statusCallback(NULL), initialized(false),
+ closed(true), name(NULL) {}
virtual ~Terminal() {}
virtual void finalize() = 0;
inline bool isInitialized() const { return initialized; }
+ virtual bool open() = 0;
+ virtual void close() = 0;
+ inline bool isClosed() const { return closed; }
+
inline const char *getName() const { return name; }
inline void setStatusCallback(terminalNotificationCallback callback) { statusCallback = callback; }
virtual int getATR(terminalGetATRCallback callback, void *userData) = 0;
};
+ /* LCOV_EXCL_STOP */
} /* namespace smartcard_service_api */
#endif /* TERMINAL_H_ */