Modify for NFC operation
[platform/core/connectivity/smartcard-plugin-nfc.git] / include / NFCTerminal.h
index 208ae5e..9bf04d8 100644 (file)
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-
-
 #ifndef NFCTERMINAL_H_
 #define NFCTERMINAL_H_
 
 /* standard library header */
 
-/* NFC-Manager header */
-#include "net_nfc.h"
+/* Tizen library header */
+#include "nfc.h"
+#include "nfc_internal.h"
+#include <vconf.h>
 
 /* local header */
 #include "Terminal.h"
@@ -33,38 +33,31 @@ namespace smartcard_service_api
        {
        private:
                PMutex mutex;
-               net_nfc_target_handle_h seHandle;
-               bool closed;
-               /* temporary data for sync function */
-               ByteArray response;
-               int error;
+               nfc_se_h seHandle;
+               bool present;
+               int referred;
 
                NFCTerminal();
                ~NFCTerminal();
 
-               static void nfcResponseCallback(net_nfc_message_e message, net_nfc_error_e result, void *data , void *userContext, void *transData);
+               static void onActivationChanged(bool activated, void *userData);
 
        public:
-
                static NFCTerminal *getInstance();
 
                bool initialize();
                void finalize();
 
                bool open();
-               bool isClosed();
                void close();
 
-               bool isSecureElementPresence();
+               bool isSecureElementPresence() const { return present; }
 
-               int transmitSync(ByteArray command, ByteArray &response);
+               int transmitSync(const ByteArray &command, ByteArray &response);
                int getATRSync(ByteArray &atr);
 
-               int transmit(ByteArray command, terminalTransmitCallback callback, void *userParam) { return -1; };
-               int getATR(terminalGetATRCallback callback, void *userParam) { return -1; }
-
-               friend void nfcResponseCallback(net_nfc_message_e message, net_nfc_error_e result, void *data , void *userContext, void *transData);
+               int transmit(const ByteArray &command, terminalTransmitCallback callback, void *userParam) { return SCARD_ERROR_NOT_SUPPORTED; };
+               int getATR(terminalGetATRCallback callback, void *userParam) { return SCARD_ERROR_NOT_SUPPORTED; }
        };
-
 } /* namespace smartcard_service_api */
 #endif /* NFCTERMINAL_H_ */