Added Gtest for smartcard-service
[platform/core/connectivity/smartcard-service.git] / common / include / Terminal.h
index 1b7d7b3..af72b10 100644 (file)
 #ifndef TERMINAL_H_
 #define TERMINAL_H_
 
-#include "Debug.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() {}
 
@@ -48,6 +54,10 @@ namespace smartcard_service_api
                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; }
 
@@ -60,5 +70,6 @@ namespace smartcard_service_api
                virtual int getATR(terminalGetATRCallback callback, void *userData) = 0;
        };
 
+       /* LCOV_EXCL_STOP */
 } /* namespace smartcard_service_api */
 #endif /* TERMINAL_H_ */