--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __TIZEN_HAL_NFC_DOC_H__
+#define __TIZEN_HAL_NFC_DOC_H__
+
+
+/**
+ * @file hal_nfc_doc.h
+ * @brief This file contains high level documentation of the HAL NFC.
+ */
+
+/**
+ * @defgroup HALAPI_HAL_NFC_MODULE Nfc
+ * @brief The @ref HALAPI_HAL_NFC_MODULE provides functions to enable and disable the NFC interface.
+ *
+ * @section HALAPI_HAL_NFC_MODULE_HEADER Required Header
+ * \#include <hal-nfc.h>
+ *
+ * @section HALAPI_HAL_NFC_MODULE_OVERVIEW Overview
+ * The Nfc provides to get/put backend and enable/disable Nfc interface.
+ * - hal_nfc_get_backend
+ * - hal_nfc_put_backend
+ * - hal_nfc_start
+ * - hal_nfc_stop
+ *
+ * For more information on the Nfc features and the macros, see HAL Nfc programming guides and tutorials.
+ */
+
+#endif /* __TIZEN_HAL_NFC_DOC_H__ */
/*
* HAL (Hardware Abstract Layer) NFC API
*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
-#include <hal-nfc-types.h>
#ifdef __cplusplus
extern "C" {
#endif
+/**
+ * @addtogroup HALAPI_HAL_NFC_MODULE
+ * @{
+ */
+
+/**
+ * @brief Structure for nfc error.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_OK = 0, /**< Status is OK */
+ NET_NFC_UNKNOWN_ERROR = -999, /**< Unknown error */
+ NET_NFC_ALLOC_FAIL, /**< Memory allocation is failed */
+ NET_NFC_THREAD_CREATE_FAIL, /**< Thread creation is failed */
+ NET_NFC_INVALID_STATE, /**< State of NFC-Manager or nfc-stack is not normal */
+ NET_NFC_IPC_FAIL, /**< Communication with ipc is failed. (from client to server)*/
+ NET_NFC_OUT_OF_BOUND, /**< Index is out of bound */
+ NET_NFC_NULL_PARAMETER, /**< Unexpected NULL parameter is received */
+ NET_NFC_BUFFER_TOO_SMALL,/**< Requested buffer is too small to store data, this error should be received */
+ NET_NFC_ALREADY_INITIALIZED, /**< You tried to initialized again without de-init */
+ NET_NFC_COMMUNICATE_WITH_CONTROLLER_FAILED, /**< Communication with Controller Chipset is failed this is Fatal Error */
+ NET_NFC_RF_TIMEOUT, /**< Timeout is raised while communicate with a tag */
+ NET_NFC_RF_ERROR, /**< Unexpected package is received from target, you may receive this error comes by the low level RF communication fault*/
+ NET_NFC_NOT_INITIALIZED, /**< Application tries to request without initialization */
+ NET_NFC_NOT_SUPPORTED, /**< Request information or command is not supported in current connected target */
+ NET_NFC_ALREADY_REGISTERED, /**< Requested SAP number is already used by other socket or data is already appended or registered */
+ NET_NFC_NOT_ALLOWED_OPERATION, /**< Requested Operation is not allowed in the situation in critical time (such as write data on target)*/
+ NET_NFC_BUSY, /**< Previous operation is not finished. don't worry to get this message, most of request will be executed in the serial queue */
+ NET_NFC_INVALID_HANDLE, /**< Requested Device in not valid device */
+ NET_NFC_TAG_READ_FAILED, /**< Tag reading is failed because of unexpected chunk data is received or error ack is received */
+ NET_NFC_TAG_WRITE_FAILED, /**< When you try to write on read only tag or error ack is received */
+ NET_NFC_NO_NDEF_SUPPORT, /**< Tag is not supported NDEF format for tag is not formatted for NDEF */
+ NET_NFC_NO_NDEF_MESSAGE, /**< No data is received after NDEF reading */
+ NET_NFC_INVALID_FORMAT, /**< Received data is not readable or it has illegal values or format */
+ NET_NFC_INSUFFICIENT_STORAGE, /**< The connected tag does not have enough information */
+ NET_NFC_OPERATION_FAIL, /**< The remote target returned error while doing a operation*/
+ NET_NFC_NOT_CONNECTED, /**< remote is not connected correctly. This can be happened when the RF does not have enough strength */
+ NET_NFC_NO_DATA_FOUND, /**< Requested data is not found in the list or properties */
+ NET_NFC_SECURITY_FAIL, /**< Authentication is failed while communication with nfc-manager server */
+ NET_NFC_TARGET_IS_MOVED_AWAY, /**< Target is lost while doing a operation */
+ NET_NFC_TAG_IS_ALREADY_FORMATTED, /** Target is already formatted */
+ NET_NFC_NOT_REGISTERED, /**< removal is requested but requested data is not registered */
+ NET_NFC_INVALID_PARAM, /**< removal is requested but requested data is not registered */
+ NET_NFC_PERMISSION_DENIED, /**< privilege check is failed */
+ NET_NFC_NOT_ACTIVATED, /**< Application tries to request without activation */
+ NET_NFC_DATA_CONFLICTED, /**< Data is conflicted with another one */
+ NET_NFC_NDEF_TYPE_LENGTH_IS_NOT_OK = -499, /**< Illegal ndef record type length */
+ NET_NFC_NDEF_PAYLOAD_LENGTH_IS_NOT_OK, /**< Illegal ndef record payload length */
+ NET_NFC_NDEF_ID_LENGTH_IS_NOT_OK, /**< Illegal ndef record id length */
+ NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE, /**< Parameter record is not expected record. for example, try to URI from text record */
+ NET_NFC_NDEF_BUF_END_WITHOUT_ME, /**< NDEF messages is terminated without ME flag */
+ NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC, /**< Current device does not support NFC feature or this manager does not found plugin library */
+ NET_NFC_LLCP_INVALID_SOCKET = -399, /**< socket is not valid socket */
+ NET_NFC_LLCP_SOCKET_DISCONNECTED, /**< socket is disconnected */
+ NET_NFC_LLCP_SOCKET_FRAME_REJECTED, /**< send data is rejected from remote side */
+ NET_NFC_P2P_SEND_FAIL = -299, /**< P2P data send fail */
+} net_nfc_error_e;
+
+/**
+ * @brief Enumeration for different types of NFC records.
+ * @details This enumeration defines different types of NFC records that can be encountered.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_RECORD_EMPTY = 0x0, /**< Empty record type. */
+ NET_NFC_RECORD_WELL_KNOWN_TYPE, /**< Well-known type record. */
+ NET_NFC_RECORD_MIME_TYPE, /**< Media type record (e.g., image/jpeg). */
+ NET_NFC_RECORD_URI, /**< URI record (e.g., http://example.com). */
+ NET_NFC_RECORD_EXTERNAL_RTD, /**< External RTD record. */
+ NET_NFC_RECORD_UNKNOWN, /**< Unknown record type. */
+ NET_NFC_RECORD_UNCHANGED /**< Unchanged record type. */
+} net_nfc_record_tnf_e;
+
+/**
+ * @brief Enumeration for different types of NFC messages.
+ * @details This enumeration defines different types of NFC messages that can be received.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_MESSAGE_TRANSCEIVE = 0, /**< Transceive message type. */
+ NET_NFC_MESSAGE_READ_NDEF, /**< Read NDEF message type. */
+ NET_NFC_MESSAGE_WRITE_NDEF, /**< Write NDEF message type. */
+ NET_NFC_MESSAGE_MAKE_READ_ONLY_NDEF, /**< Make read-only NDEF message type. */
+ NET_NFC_MESSAGE_IS_TAG_CONNECTED, /**< Check if tag is connected message type. */
+ NET_NFC_MESSAGE_GET_CURRENT_TAG_INFO, /**< Get current tag information message type. */
+ NET_NFC_MESSAGE_GET_CURRENT_TARGET_HANDLE,/**< Get current target handle message type. */
+ NET_NFC_MESSAGE_TAG_DISCOVERED, /**< Tag discovered message type. */
+ NET_NFC_MESSAGE_NOTIFY, /**< Notify message type. */
+ NET_NFC_MESSAGE_TAG_DETACHED, /**< Tag detached message type. */
+ NET_NFC_MESSAGE_LLCP_DISCOVERED, /**< LLCP discovered message type. */
+ NET_NFC_MESSAGE_P2P_DETACHED, /**< P2P detached message type. */
+ NET_NFC_MESSAGE_LLCP_CONFIG, /**< LLCP configuration message type. */
+ NET_NFC_MESSAGE_P2P_DISCOVERED, /**< P2P discovered message type. */
+ NET_NFC_MESSAGE_P2P_SEND, /**< P2P send message type. */
+ NET_NFC_MESSAGE_P2P_RECEIVE, /**< P2P receive message type. */
+ NET_NFC_MESSAGE_SE_START_TRANSACTION, /**< Secure element start transaction message type. */
+ NET_NFC_MESSAGE_SE_END_TRANSACTION, /**< Secure element end transaction message type. */
+ NET_NFC_MESSAGE_SE_TYPE_TRANSACTION, /**< Secure element type transaction message type. */
+ NET_NFC_MESSAGE_SE_CONNECTIVITY, /**< Secure element connectivity message type. */
+ NET_NFC_MESSAGE_SE_FIELD_ON, /**< Secure element field on message type. */
+ NET_NFC_MESSAGE_SE_FIELD_OFF, /**< Secure element field off message type. */
+ NET_NFC_MESSAGE_SE_TYPE_CHANGED, /**< Secure element type changed message type. */
+ NET_NFC_MESSAGE_SE_CARD_EMULATION_CHANGED,/**< Secure element card emulation changed message type. */
+ NET_NFC_MESSAGE_CONNECTION_HANDOVER, /**< Connection handover message type. */
+ NET_NFC_MESSAGE_SET_SE, /**< Set secure element message type. */
+ NET_NFC_MESSAGE_GET_SE, /**< Get secure element message type. */
+ NET_NFC_MESSAGE_OPEN_INTERNAL_SE, /**< Open internal secure element message type. */
+ NET_NFC_MESSAGE_CLOSE_INTERNAL_SE, /**< Close internal secure element message type. */
+ NET_NFC_MESSAGE_SEND_APDU_SE, /**< Send APDU to secure element message type. */
+ NET_NFC_MESSAGE_GET_ATR_SE, /**< Get ATR from secure element message type. */
+ NET_NFC_GET_SERVER_STATE, /**< Get server state message type. */
+ NET_NFC_MESSAGE_INIT, /**< Initialize NFC message type. */
+ NET_NFC_MESSAGE_DEINIT, /**< Deinitialize NFC message type. */
+ NET_NFC_MESSAGE_GET_FIRMWARE_VERSION, /**< Get firmware version message type. */
+ NET_NFC_MESSAGE_SNEP_START_SERVER, /**< Start SNEP server message type. */
+ NET_NFC_MESSAGE_SNEP_START_CLIENT, /**< Start SNEP client message type. */
+ NET_NFC_MESSAGE_SNEP_REQUEST, /**< SNEP request message type. */
+ NET_NFC_MESSAGE_SNEP_STOP_SERVICE, /**< Stop SNEP service message type. */
+ NET_NFC_MESSAGE_SNEP_REGISTER_SERVER, /**< Register SNEP server message type. */
+ NET_NFC_MESSAGE_SNEP_UNREGISTER_SERVER, /**< Unregister SNEP server message type. */
+ NET_NFC_MESSAGE_CONNECT, /**< Connect message type. */
+ NET_NFC_MESSAGE_DISCONNECT, /**< Disconnect message type. */
+ NET_NFC_MESSAGE_SET_CARD_EMULATION, /**< Set card emulation message type. */
+ NET_NFC_MESSAGE_ROUTING_HOST_EMU_ACTIVATED, /**< Routing host emulation activated message type. */
+ NET_NFC_MESSAGE_ROUTING_HOST_EMU_DEACTIVATED, /**< Routing host emulation deactivated message type. */
+ NET_NFC_MESSAGE_ROUTING_HOST_EMU_DATA, /**< Routing host emulation data message type. */
+} net_nfc_message_e;
+
+/**
+ * @brief Enumeration for different types of NFC target types.
+ * @details This enumeration defines different types of NFC targets that can be detected.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_UNKNOWN_TARGET = 0x00U, /**< Unknown target type. */
+ NET_NFC_GENERIC_PICC, /**< Generic PICC (Proximity Coupling Device) target type. */
+ NET_NFC_ISO14443_A_PICC, /**< ISO/IEC 14443 Type A PICC target type. */
+ NET_NFC_ISO14443_4A_PICC, /**< ISO/IEC 14443 Part 4 Type A PICC target type. */
+ NET_NFC_ISO14443_3A_PICC, /**< ISO/IEC 14443 Part 3 Type A PICC target type. */
+ NET_NFC_MIFARE_MINI_PICC, /**< Mifare Mini PICC target type. */
+ NET_NFC_MIFARE_1K_PICC, /**< Mifare 1k PICC target type. */
+ NET_NFC_MIFARE_4K_PICC, /**< Mifare 4k PICC target type. */
+ NET_NFC_MIFARE_ULTRA_PICC, /**< Mifare Ultra PICC target type. */
+ NET_NFC_MIFARE_DESFIRE_PICC, /**< Mifare Desfire PICC target type. */
+ NET_NFC_ISO14443_B_PICC, /**< ISO/IEC 14443 Type B PICC target type. */
+ NET_NFC_ISO14443_4B_PICC, /**< ISO/IEC 14443 Part 4 Type B PICC target type. */
+ NET_NFC_ISO14443_BPRIME_PICC, /**< ISO/IEC 14443 Prime Type B PICC target type. */
+ NET_NFC_FELICA_PICC, /**< Felica PICC target type. */
+ NET_NFC_JEWEL_PICC, /**< Jewel PICC target type. */
+ NET_NFC_ISO15693_PICC, /**< ISO/IEC 15693 PICC target type. */
+ NET_NFC_BARCODE_128_PICC, /**< Barcode 128 PICC target type. */
+ NET_NFC_BARCODE_256_PICC, /**< Barcode 256 PICC target type. */
+ NET_NFC_NFCIP1_TARGET, /**< NFC-IP1 target type. */
+ NET_NFC_NFCIP1_INITIATOR, /**< NFC-IP1 initiator type. */
+} net_nfc_target_type_e;
+
+/**
+ * @brief Enumeration for different states of NFC NDEF cards.
+ * @details This enumeration defines different states of NFC NDEF cards that can be encountered.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_NDEF_CARD_INVALID = 0x00, /**< The card is not NFC forum specified tag. The ndef format will be needed. */
+ NET_NFC_NDEF_CARD_INITIALISED, /**< The card is NFC forum specified tag, but It has no actual data. So, the ndef write will be needed. */
+ NET_NFC_NDEF_CARD_READ_WRITE, /**< The card is NFC forum specified tag. The ndef read and write will be allowed. */
+ NET_NFC_NDEF_CARD_READ_ONLY /**< The card is NFC forum specified tag, but only the ndef read will be allowed. */
+} net_nfc_ndef_card_state_e;
+
+/**
+ * @brief Enumeration for different types of URI schemes.
+ * @details This enumeration defines different types of URI schemes that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_SCHEMA_FULL_URI = 0x00, /**< Protocol is specified by payload. */
+ NET_NFC_SCHEMA_HTTP_WWW, /**< http://www. */
+ NET_NFC_SCHEMA_HTTPS_WWW, /**< https://www. */
+ NET_NFC_SCHEMA_HTTP, /**< http:// */
+ NET_NFC_SCHEMA_HTTPS, /**< https:// */
+ NET_NFC_SCHEMA_TEL, /**< tel: */
+ NET_NFC_SCHEMA_MAILTO, /**< mailto: */
+ NET_NFC_SCHEMA_FTP_ANONYMOUS, /**< ftp://anonymous:anonymous@ */
+ NET_NFC_SCHEMA_FTP_FTP, /**< ftp://ftp. */
+ NET_NFC_SCHEMA_FTPS, /**< ftps:// */
+ NET_NFC_SCHEMA_SFTP, /**< sftp:// */
+ NET_NFC_SCHEMA_SMB, /**< smb:// */
+ NET_NFC_SCHEMA_NFS, /**< nfs:// */
+ NET_NFC_SCHEMA_FTP, /**< ftp:// */
+ NET_NFC_SCHEMA_DAV, /**< dav:// */
+ NET_NFC_SCHEMA_NEWS, /**< news:// */
+ NET_NFC_SCHEMA_TELNET, /**< telnet:// */
+ NET_NFC_SCHEMA_IMAP, /**< imap: */
+ NET_NFC_SCHEMA_RTSP, /**< rtsp:// */
+ NET_NFC_SCHEMA_URN, /**< urn: */
+ NET_NFC_SCHEMA_POP, /**< pop: */
+ NET_NFC_SCHEMA_SIP, /**< sip: */
+ NET_NFC_SCHEMA_SIPS, /**< sips: */
+ NET_NFC_SCHEMA_TFTP, /**< tftp: */
+ NET_NFC_SCHEMA_BTSPP, /**< btspp:// */
+ NET_NFC_SCHEMA_BTL2CAP, /**< btl2cap:// */
+ NET_NFC_SCHEMA_BTGOEP, /**< btgoep:// */
+ NET_NFC_SCHEMA_TCPOBEX, /**< tcpobex:// */
+ NET_NFC_SCHEMA_IRDAOBEX, /**< irdaobex:// */
+ NET_NFC_SCHEMA_FILE, /**< file:// */
+ NET_NFC_SCHEMA_URN_EPC_ID, /**< urn:epc:id: */
+ NET_NFC_SCHEMA_URN_EPC_TAG, /**< urn:epc:tag: */
+ NET_NFC_SCHEMA_URN_EPC_PAT, /**< urn:epc:pat: */
+ NET_NFC_SCHEMA_URN_EPC_RAW, /**< urn:epc:raw: */
+ NET_NFC_SCHEMA_URN_EPC, /**< urn:epc: */
+ NET_NFC_SCHEMA_URN_NFC, /**< urn:epc:nfc: */
+} net_nfc_schema_type_e;
+
+/**
+ * @brief Enumeration for different event filters for NFC events.
+ * @details This enumeration defines different event filters that can be used to control which NFC events are received.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_ALL_DISABLE = 0x0000, /**< Disable all NFC events. */
+ NET_NFC_ISO14443A_ENABLE = 0x0001, /**< Enable ISO/IEC 14443 Type A events. */
+ NET_NFC_ISO14443B_ENABLE = 0x0002, /**< Enable ISO/IEC 14443 Type B events. */
+ NET_NFC_ISO15693_ENABLE = 0x0004, /**< Enable ISO/IEC 15693 events. */
+ NET_NFC_FELICA_ENABLE = 0x0008, /**< Enable Felica events. */
+ NET_NFC_JEWEL_ENABLE = 0x0010, /**< Enable Jewel events. */
+ NET_NFC_IP_ENABLE = 0x0020, /**< Enable NFC-IP events. */
+ NET_NFC_ALL_ENABLE = ~0 /**< Enable all NFC events. */
+} net_nfc_event_filter_e;
+
+/**
+ * @brief Enumeration for different types of LLCP messages.
+ * @details This enumeration defines different types of LLCP messages that can be received.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_MESSAGE_LLCP_LISTEN = 1000, /**< LLCP listen message type. */
+ NET_NFC_MESSAGE_LLCP_ACCEPTED, /**< LLCP accepted message type. */
+ NET_NFC_MESSAGE_LLCP_CONNECT, /**< LLCP connect message type. */
+ NET_NFC_MESSAGE_LLCP_CONNECT_SAP, /**< LLCP connect SAP message type. */
+ NET_NFC_MESSAGE_LLCP_SEND, /**< LLCP send message type. */
+ NET_NFC_MESSAGE_LLCP_SEND_TO, /**< LLCP send to message type. */
+ NET_NFC_MESSAGE_LLCP_RECEIVE, /**< LLCP receive message type. */
+ NET_NFC_MESSAGE_LLCP_RECEIVE_FROM, /**< LLCP receive from message type. */
+ NET_NFC_MESSAGE_LLCP_DISCONNECT, /**< LLCP disconnect message type. */
+ NET_NFC_MESSAGE_LLCP_ERROR, /**< LLCP error message type. */
+ NET_NFC_MESSAGE_LLCP_CONNECT_REQ, /**< LLCP connect request message type. */
+ NET_NFC_MESSAGE_LLCP_ACCEPT, /**< LLCP accept message type. */
+ NET_NFC_MESSAGE_LLCP_REJECT, /**< LLCP reject message type. */
+ NET_NFC_MESSAGE_LLCP_REJECTED, /**< LLCP rejected message type. */
+ NET_NFC_MESSAGE_LLCP_CLOSE /**< LLCP close message type. */
+} net_nfc_llcp_message_e;
+
+/**
+ * @brief Enumeration for different types of socket types in LLCP.
+ * @details This enumeration defines different types of socket types that can be used in LLCP communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED,/**< Connection-oriented socket type. */
+ NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONLESS /**< Connectionless socket type. */
+} net_nfc_socket_type_e;
+
+/**
+ * @brief Enumeration for different types of application protocols supported by LLCP.
+ * @details This enumeration defines different types of application protocols that can be used in LLCP communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_SNEP = 0x00, /**< SNEP (Simple NDEF Exchange Protocol) application protocol. */
+ NET_NFC_NPP /**< NPP (NFC Data Exchange Format) application protocol. */
+} net_nfc_llcp_app_protocol_e;
+
+/**
+ * @brief Enumeration for different types of NFC service messages.
+ * @details This enumeration defines different types of NFC service messages that can be received.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_message_service_e {
+ NET_NFC_MESSAGE_SERVICE_RESET = 2000, /**< Reset NFC service message type. */
+ NET_NFC_MESSAGE_SERVICE_INIT, /**< Initialize NFC service message type. */
+ NET_NFC_MESSAGE_SERVICE_ACTIVATE, /**< Activate NFC service message type. */
+ NET_NFC_MESSAGE_SERVICE_DEACTIVATE, /**< Deactivate NFC service message type. */
+ NET_NFC_MESSAGE_SERVICE_DEINIT, /**< Deinitialize NFC service message type. */
+ NET_NFC_MESSAGE_SERVICE_STANDALONE_TARGET_DETECTED,/**< Standalone target detected message type. */
+ NET_NFC_MESSAGE_SERVICE_SE, /**< Secure element message type. */
+ NET_NFC_MESSAGE_SERVICE_TERMINATION, /**< Termination message type. */
+ NET_NFC_MESSAGE_SERVICE_SLAVE_TARGET_DETECTED,/**< Slave target detected message type. */
+ NET_NFC_MESSAGE_SERVICE_SLAVE_ESE_DETECTED,/**< Secure element detected message type. */
+ NET_NFC_MESSAGE_SERVICE_RESTART_POLLING_LOOP,/**< Restart polling loop message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_LISTEN, /**< LLCP listen message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_INCOMING, /**< LLCP incoming message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_ACCEPT, /**< LLCP accept message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_REJECT, /**< LLCP reject message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_SEND, /**< LLCP send message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_SEND_TO, /**< LLCP send to message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_RECEIVE, /**< LLCP receive message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_RECEIVE_FROM,/**< LLCP receive from message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_CONNECT, /**< LLCP connect message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_CONNECT_SAP, /**< LLCP connect SAP message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_DISCONNECT, /**< LLCP disconnect message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_DEACTIVATED, /**< LLCP deactivated message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_SOCKET_ERROR,/**< LLCP socket error message type. */
+ NET_NFC_MESSAGE_SERVICE_LLCP_SOCKET_ACCEPTED_ERROR,/**< LLCP socket accepted error message type. */
+ NET_NFC_MESSAGE_SERVICE_CHANGE_CLIENT_STATE,/**< Change client state message type. */
+ NET_NFC_MESSAGE_SERVICE_WATCH_DOG, /**< Watchdog message type. */
+ NET_NFC_MESSAGE_SERVICE_CLEANER, /**< Cleaner message type. */
+ NET_NFC_MESSAGE_SERVICE_SET_LAUNCH_STATE /**< Set launch state message type. */
+} net_nfc_message_service_e;
+
+/**
+ * @brief Enumeration for different types of connection handover carriers.
+ * @details This enumeration defines different types of connection handover carriers that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_CONN_HANDOVER_CARRIER_BT = 0x00, /**< Bluetooth carrier. */
+ NET_NFC_CONN_HANDOVER_CARRIER_WIFI_WPS, /**< Wi-Fi Protected Setup carrier. */
+ NET_NFC_CONN_HANDOVER_CARRIER_WIFI_P2P, /**< Wi-Fi Peer-to-Peer carrier. */
+ NET_NFC_CONN_HANDOVER_CARRIER_BT_LE, /**< Bluetooth Low Energy carrier. */
+ NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN /**< Unknown carrier. */
+} net_nfc_conn_handover_carrier_type_e;
+
+/**
+ * @brief Enumeration for different types of Secure Element (SE) types.
+ * @details This enumeration defines different types of Secure Element (SE) types that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_SE_TYPE_NONE = 0x00, /**< Invalid SE type. */
+ NET_NFC_SE_TYPE_ESE = 0x01, /**< Embedded Secure Element (eSE). */
+ NET_NFC_SE_TYPE_UICC = 0x02, /**< Universal Integrated Circuit Card (UICC). */
+ NET_NFC_SE_TYPE_SDCARD = 0x03, /**< SDCard. */
+ NET_NFC_SE_TYPE_HCE = 0x04 /**< Host Card Emulation (HCE). */
+} net_nfc_se_type_e;
+
+/**
+ * @brief Enumeration for different types of SE entry types.
+ * @details This enumeration defines different types of SE entry types that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_SE_INVALID_ENTRY = 0x00, /**< Indicates SE entry type is invalid. */
+ NET_NFC_SE_TECH_ENTRY = 0x01, /**< Technology entry type. */
+ NET_NFC_SE_PROTOCOL_ENTRY = 0x02, /**< Protocol entry type. */
+ NET_NFC_SE_AID_ENTRY = 0x04 /**< Application Identifier (AID) entry type. */
+} net_nfc_se_entry_type_e;
+
+/**
+ * @brief Enumeration for different types of SE technology and protocol types.
+ * @details This enumeration defines different types of SE technology and protocol types that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_SE_INVALID_TECH_PROTO = 0x00, /**< Indicates SE technology and protocol type is invalid. */
+ NET_NFC_SE_TECH_A_ISODEP = 0x01, /**< Type A / ISO-DEP. */
+ NET_NFC_SE_TECH_B_NFCDEP = 0x02, /**< Type B / NFC-DEP. */
+ NET_NFC_SE_TECH_A_B_ISO_NFC_DEP = 0x03, /**< Type A/B / ISO-DEP/NFC-DEP. */
+ NET_NFC_SE_TECH_F = 0x04 /**< Type F. */
+} net_nfc_se_tech_protocol_type_e;
+
+/**
+ * @brief Enumeration for different states of NFC clients.
+ * @details This enumeration defines different states of NFC clients that can be encountered.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _client_state_e {
+ NET_NFC_CLIENT_INACTIVE_STATE = 0x00, /**< Inactive state of NFC client. */
+ NET_NFC_CLIENT_ACTIVE_STATE /**< Active state of NFC client. */
+} net_nfc_client_state_e;
+
+/**
+ * @brief Enumeration for different types of launch popup checks.
+ * @details This enumeration defines different types of launch popup checks that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_launch_popup_check_e {
+ NET_NFC_CHECK_FOREGROUND = 0x00, /**< Check foreground. */
+ NET_NFC_NO_CHECK_FOREGROUND /**< No check foreground. */
+} net_nfc_launch_popup_check_e;
+
+/**
+ * @brief Enumeration for different states of launch popup selection.
+ * @details This enumeration defines different states of launch popup selection that can be encountered.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_launch_popup_state_e {
+ NET_NFC_LAUNCH_APP_SELECT = 0x00, /**< Launch app select. */
+ NET_NFC_NO_LAUNCH_APP_SELECT /**< No launch app select. */
+} net_nfc_launch_popup_state_e;
+
+/**
+ * @brief Enumeration for different types of NFC privileges.
+ * @details This enumeration defines different types of NFC privileges that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_privilege_e {
+ NET_NFC_PRIVILEGE_NFC = 0x00, /**< NFC privilege. */
+ NET_NFC_PRIVILEGE_NFC_ADMIN, /**< NFC admin privilege. */
+ NET_NFC_PRIVILEGE_NFC_TAG, /**< NFC tag privilege. */
+ NET_NFC_PRIVILEGE_NFC_P2P, /**< NFC peer-to-peer privilege. */
+ NET_NFC_PRIVILEGE_NFC_CARD_EMUL /**< NFC card emulation privilege. */
+} net_nfc_privilege_e;
+
+/**
+ * @brief Enumeration for different types of discovery modes.
+ * @details This enumeration defines different types of discovery modes that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_discovery_mode_e {
+ NET_NFC_DISCOVERY_MODE_STOP = 0x00, /**< Stop discovery mode. */
+ NET_NFC_DISCOVERY_MODE_CONFIG_POLLING = 0x01,/**< Configure polling mode. */
+ NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING = 0x02,/**< Configure listening mode. */
+ NET_NFC_DISCOVERY_MODE_CONFIG_P2P = 0x04, /**< Configure peer-to-peer mode. */
+ NET_NFC_DISCOVERY_MODE_CONFIG_ALL = NET_NFC_DISCOVERY_MODE_CONFIG_POLLING | NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING | NET_NFC_DISCOVERY_MODE_CONFIG_P2P,/**< Configure all modes. */
+ NET_NFC_DISCOVERY_MODE_CONFIG_DEFAULT = NET_NFC_DISCOVERY_MODE_CONFIG_POLLING | NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING,/**< Configure default modes. */
+ NET_NFC_DISCOVERY_MODE_CONFIG = NET_NFC_DISCOVERY_MODE_CONFIG_DEFAULT,/**< Configure modes. */
+ NET_NFC_DISCOVERY_MODE_START_LISTENING = NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING,/**< Start listening mode. */
+ NET_NFC_DISCOVERY_MODE_START_POLLING = NET_NFC_DISCOVERY_MODE_CONFIG_POLLING,/**< Start polling mode. */
+ NET_NFC_DISCOVERY_MODE_START_ALL = NET_NFC_DISCOVERY_MODE_CONFIG_ALL,/**< Start all modes. */
+ NET_NFC_DISCOVERY_MODE_START_DEFAULT = NET_NFC_DISCOVERY_MODE_CONFIG_DEFAULT,/**< Start default modes. */
+ NET_NFC_DISCOVERY_MODE_START = NET_NFC_DISCOVERY_MODE_START_DEFAULT,/**< Start modes. */
+ NET_NFC_DISCOVERY_MODE_RESUME = NET_NFC_DISCOVERY_MODE_START/**< Resume modes. */
+} net_nfc_discovery_mode_e;
+
+/**
+ * @brief Enumeration for different types of secure element (SE) types.
+ * @details This enumeration defines different types of secure element (SE) types that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_secure_element_type_e {
+ NET_NFC_SECURE_ELEMENT_TYPE_INVALID = 0x00, /**< Indicates SE type is invalid. */
+ NET_NFC_SECURE_ELEMENT_TYPE_ESE = 0x01, /**< Indicates SE type is SmartMX. */
+ NET_NFC_SECURE_ELEMENT_TYPE_UICC = 0x02, /**< Indicates SE type is UICC. */
+ NET_NFC_SECURE_ELEMENT_TYPE_SDCARD = 0x03, /**< Indicates SE type is SDCARD. */
+ NET_NFC_SECURE_ELEMENT_TYPE_HCE = 0x04, /**< Indicates SE type is HCE. */
+ NET_NFC_SECURE_ELEMENT_TYPE_UNKNOWN = 0x05 /**< Indicates SE type is unknown. */
+} net_nfc_secure_element_type_e;
+
+/**
+ * @brief Enumeration for different states of secure element (SE).
+ * @details This enumeration defines different states of secure element (SE) that can be encountered.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_secure_element_state_e {
+ NET_NFC_SECURE_ELEMENT_INACTIVE_STATE = 0x00, /**< Inactive state of SE. */
+ NET_NFC_SECURE_ELEMENT_ACTIVE_STATE = 0x01 /**< Active state of SE. */
+} net_nfc_secure_element_state_e;
+
+/**
+ * @brief Enumeration for different modes of secure element (SE).
+ * @details This enumeration defines different modes of secure element (SE) that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_secure_element_mode_e {
+ NET_NFC_SECURE_ELEMENT_WIRED_MODE = 0x00, /**< Enables wired mode communication. This mode shall be applied to eSE. */
+ NET_NFC_SECURE_ELEMENT_VIRTUAL_MODE, /**< Enables virtual mode communication. This can be applied to UICC as well as eSE. */
+ NET_NFC_SECURE_ELEMENT_OFF_MODE /**< Inactivates SE. This means, put SE in inactive state. */
+} net_nfc_secure_element_mode_e;
+
+/**
+ * @brief Enumeration for different types of screen state types.
+ * @details This enumeration defines different types of screen state types that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum {
+ NET_NFC_SCREEN_INVALID = 0x00, /**< Indicates screen state is invalid. */
+ NET_NFC_SCREEN_OFF = 0x01, /**< Screen is off. */
+ NET_NFC_SCREEN_ON_LOCK = 0x02, /**< Screen is on but locked. */
+ NET_NFC_SCREEN_ON_UNLOCK = 0x03 /**< Screen is on and unlocked. */
+} net_nfc_screen_state_type_e;
+
+/**
+ * @brief Enumeration for different types of NFC connection types.
+ * @details This enumeration defines different types of NFC connection types that can be used in NFC communication.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _net_nfc_connection_type_e {
+ NET_NFC_TAG_CONNECTION = 0x00, /**< Tag connection type. */
+ NET_NFC_P2P_CONNECTION_TARGET, /**< Peer-to-peer connection target type. */
+ NET_NFC_P2P_CONNECTION_INITIATOR, /**< Peer-to-peer connection initiator type. */
+ NET_NFC_SE_CONNECTION /**< Secure element connection type. */
+} net_nfc_connection_type_e;
+
+/**
+ * @brief Enumeration for different types of LLCP events.
+ * @details This enumeration defines different types of LLCP events that can be received.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef enum _llcp_event_e {
+ NET_NFC_LLCP_EVENT_SOCKET_ACCEPTED = 0x1, /**< LLCP socket accepted event type. */
+ NET_NFC_LLCP_EVENT_SOCKET_ERROR, /**< LLCP socket error event type. */
+ NET_NFC_LLCP_EVENT_DEACTIVATED /**< LLCP deactivated event type. */
+} net_nfc_llcp_event_e;
+
+/**
+ * @brief Handle for data structure.
+ * @details This typedef defines a handle for a data structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_data_s *net_nfc_data_h;
+
+/**
+ * @brief Handle for NDEF record structure.
+ * @details This typedef defines a handle for an NDEF record structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_ndef_record_s *net_nfc_ndef_record_h;
+
+/**
+ * @brief Handle for NDEF message structure.
+ * @details This typedef defines a handle for an NDEF message structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_ndef_message_s *net_nfc_ndef_message_h;
+
+/**
+ * @brief Handle for NFC target information structure.
+ * @details This typedef defines a handle for an NFC target information structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_target_info_s *net_nfc_target_info_h;
+
+/**
+ * @brief Handle for LLCP configuration information structure.
+ * @details This typedef defines a handle for an LLCP configuration information structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_llcp_config_info_s *net_nfc_llcp_config_info_h;
+
+/**
+ * @brief Handle for LLCP socket option structure.
+ * @details This typedef defines a handle for an LLCP socket option structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_llcp_socket_option_s *net_nfc_llcp_socket_option_h;
+
+/**
+ * @brief Handle for NFC target handle structure.
+ * @details This typedef defines a handle for an NFC target handle structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_target_handle_s *net_nfc_target_handle_h;
+
+/**
+ * @brief Handle for connection handover information structure.
+ * @details This typedef defines a handle for a connection handover information structure.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_connection_handover_info_s *net_nfc_connection_handover_info_h;
+
+/**
+ * @brief Typedef for Service Access Point (SAP) type.
+ * @details This typedef defines a type for Service Access Point (SAP).
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef uint8_t net_nfc_sap_t;
+
+/**
+ * @brief Typedef for LLCP socket type.
+ * @details This typedef defines a type for LLCP socket.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef uint32_t net_nfc_llcp_socket_t;
+
+/**
+ * @brief Callback function for LLCP socket events.
+ * @details This typedef defines a callback function for LLCP socket events.
+ * @since HAL_MODULE_NFC 1.0
+ *
+ * @param[in] message The type of LLCP message.
+ * @param[in] result The result of the operation.
+ * @param[in] data The data associated with the message.
+ * @param[in] user_data The user data passed to the callback function.
+ * @param[in] trans_data The transaction data associated with the message.
+ */
+typedef void (*net_nfc_llcp_socket_cb) (net_nfc_llcp_message_e message, int result, void *data, void *user_data, void *trans_data);
+
+/**
+ * @brief Callback function for target detection events.
+ * @details This typedef defines a callback function for target detection events.
+ * @since HAL_MODULE_NFC 1.0
+ *
+ * @param[in] data The data associated with the event.
+ * @param[in] user_param The user parameter passed to the callback function.
+ */
+typedef void (*net_nfc_target_detection_listener_cb) (void *data, void *user_param);
+
+/**
+ * @brief Callback function for secure element (SE) transaction events.
+ * @details This typedef defines a callback function for secure element (SE) transaction events.
+ * @since HAL_MODULE_NFC 1.0
+ *
+ * @param[in] data The data associated with the event.
+ * @param[in] user_param The user parameter passed to the callback function.
+ */
+typedef void (*net_nfc_se_transaction_listener_cb) (void *data, void *user_param);
+
+/**
+ * @brief Callback function for LLCP event events.
+ * @details This typedef defines a callback function for LLCP event events.
+ * @since HAL_MODULE_NFC 1.0
+ *
+ * @param[in] data The data associated with the event.
+ * @param[in] user_param The user parameter passed to the callback function.
+ */
+typedef void (*net_nfc_llcp_event_listener_cb) (void *data, void *user_param);
+
+/**
+ * @brief Callback function for HCE APDU events.
+ * @details This typedef defines a callback function for HCE APDU events.
+ * @since HAL_MODULE_NFC 1.0
+ *
+ * @param[in] data The data associated with the event.
+ * @param[in] user_param The user parameter passed to the callback function.
+ */
+typedef void (*net_nfc_hce_apdu_listener_cb) (void *data, void *user_param);
+
+/**
+ * @brief Structure for NFC data containing a buffer and its length.
+ * @details This structure defines an NFC data structure containing a buffer and its length.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_data_t {
+ uint8_t *buffer; /**< Buffer array. */
+ uint32_t length; /**< Length of the buffer. */
+} net_nfc_data_s;
+
+/**
+ * @brief Structure for NFC internal data containing a buffer and its length.
+ * @details This structure defines an NFC data structure containing a buffer and its length.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_internal_data_t {
+ uint32_t length; /**< Length of the buffer. */
+ uint8_t buffer[0]; /**< Buffer array. */
+} net_nfc_internal_data_s;
+
+/**
+ * @brief Structure for NFC target handle containing connection information.
+ * @details This structure defines an NFC target handle structure containing connection information.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_target_handle_s {
+ uint32_t connection_id; /**< Connection ID. */
+ net_nfc_connection_type_e connection_type; /**< Connection type. */
+ net_nfc_target_type_e target_type; /**< Target type. */
+ net_nfc_llcp_app_protocol_e app_type; /**< Application protocol type. */
+} net_nfc_target_handle_s;
+
+/**
+ * @brief Structure for current NFC target information containing handle and other details.
+ * @details This structure defines a current NFC target information structure containing handle and other details.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_current_target_info_s {
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ uint32_t devType; /**< Device type. */
+ int number_of_keys; /**< Number of keys. */
+ net_nfc_data_s target_info_values; /**< Target information values. */
+} net_nfc_current_target_info_s;
+
+/**
+ * @brief Structure for LLCP configuration information containing various parameters.
+ * @details This structure defines an LLCP configuration information structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_llcp_config_info_s {
+ uint16_t miu; /**< Maximum Information Unit. */
+ uint16_t wks; /**< Well-Known Services. */
+ uint8_t lto; /**< Link Time Out. */
+ uint8_t option; /**< Option. */
+} net_nfc_llcp_config_info_s;
+
+/**
+ * @brief Structure for LLCP socket option containing various parameters.
+ * @details This structure defines an LLCP socket option structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_llcp_socket_option_s {
+ uint16_t miu; /**< Maximum Information Unit. */
+ uint8_t rw; /**< Receive Window Size. */
+ net_nfc_socket_type_e type; /**< Socket type. */
+} net_nfc_llcp_socket_option_s;
+
+/**
+ * @brief Structure for internal LLCP socket containing various parameters.
+ * @details This structure defines an internal LLCP socket structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_llcp_internal_socket_s {
+ uint16_t miu; /**< Maximum Information Unit. */
+ uint8_t rw; /**< Receive Window Size. */
+ net_nfc_socket_type_e type; /**< Socket type. */
+ net_nfc_llcp_socket_t oal_socket; /**< OAL socket. */
+ net_nfc_llcp_socket_t client_socket; /**< Client socket. */
+ net_nfc_sap_t sap; /**< Service Access Point. */
+ uint8_t *service_name; /**< Service name. */
+ net_nfc_target_handle_s *device_id; /**< Device ID. */
+ net_nfc_llcp_socket_cb cb; /**< Callback function. */
+ bool close_requested; /**< Close requested flag. */
+ void *register_param; /**< Register parameter. */
+} net_nfc_llcp_internal_socket_s;
+
+/**
+ * @brief Structure for NDEF record containing various fields.
+ * @details This structure defines an NDEF record structure containing various fields.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_record_s {
+ uint8_t MB:1; /**< Message Begin bit. */
+ uint8_t ME:1; /**< Message End bit. */
+ uint8_t CF:1; /**< Chunk Flag bit. */
+ uint8_t SR:1; /**< Short Record bit. */
+ uint8_t IL:1; /**< ID Length Present bit. */
+ uint8_t TNF:3; /**< Type Name Format bits. */
+ net_nfc_data_s type_s; /**< Type field. */
+ net_nfc_data_s id_s; /**< ID field. */
+ net_nfc_data_s payload_s; /**< Payload field. */
+ struct _record_s *next; /**< Pointer to next record. */
+} net_nfc_ndef_record_s;
+
+/**
+ * @brief Structure for NDEF message containing records.
+ * @details This structure defines an NDEF message structure containing records.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_ndef_message_s {
+ uint32_t recordCount; /**< Number of records. */
+ net_nfc_ndef_record_s *records; /**< Pointer to records. */
+} net_nfc_ndef_message_s;
+
+/**
+ * @brief Structure for NFC tag information containing key-value pairs.
+ * @details This structure defines an NFC tag information structure containing key-value pairs.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_tag_info_s {
+ char *key; /**< Key. */
+ net_nfc_data_h value; /**< Value. */
+} net_nfc_tag_info_s;
+
+/**
+ * @brief Structure for NFC target information containing various details.
+ * @details This structure defines an NFC target information structure containing various details.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_target_info_s {
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ net_nfc_target_type_e devType; /**< Device type. */
+ uint8_t is_ndef_supported; /**< NDEF support flag. */
+ uint8_t ndef_card_state; /**< NDEF card state. */
+ uint32_t max_data_size; /**< Maximum data size. */
+ uint32_t actual_data_size; /**< Actual data size. */
+ int number_of_keys; /**< Number of keys. */
+ net_nfc_tag_info_s *tag_info_list; /**< Tag information list. */
+ char **keylist; /**< Key list. */
+ net_nfc_data_s raw_data; /**< Raw data. */
+} net_nfc_target_info_s;
+
+/**
+ * @brief Structure for secure element event information containing AID and parameter.
+ * @details This structure defines a secure element event information structure containing AID and parameter.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_se_event_info_s {
+ net_nfc_data_s aid; /**< AID. */
+ net_nfc_data_s param; /**< Parameter. */
+} net_nfc_se_event_info_s;
+
+/**
+ * @brief Structure for transceive information containing device type and data.
+ * @details This structure defines a transceive information structure containing device type and data.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_transceive_info_s {
+ uint32_t dev_type; /**< Device type. */
+ net_nfc_data_s trans_data; /**< Transceive data. */
+} net_nfc_transceive_info_s;
+
+/**
+ * @brief Structure for connection handover information containing type and data.
+ * @details This structure defines a connection handover information structure containing type and data.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_connection_handover_info_s {
+ net_nfc_conn_handover_carrier_type_e type; /**< Connection handover carrier type. */
+ net_nfc_data_s data; /**< Data. */
+} net_nfc_connection_handover_info_s;
+
+/**
+ * @brief Structure for NFC request message containing various parameters.
+ * @details This structure defines an NFC request message structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_msg_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+} net_nfc_request_msg_t;
+/**
+ * @brief Structure for NFC request target detected containing various parameters.
+ * @details This structure defines an NFC request target detected structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_target_detected_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ uint32_t dev_type; /**< Device type. */
+ int number_of_keys; /**< Number of keys. */
+ net_nfc_internal_data_s target_info_values; /**< Target information values. */
+} net_nfc_request_target_detected_t;
+
+/**
+ * @brief Structure for NFC request secure element event containing various parameters.
+ * @details This structure defines an NFC request secure element event structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_se_event_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ net_nfc_data_s aid; /**< AID. */
+ net_nfc_data_s param; /**< Parameter. */
+} net_nfc_request_se_event_t;
+
+/**
+ * @brief Structure for NFC request LLCP message containing various parameters.
+ * @details This structure defines an NFC request LLCP message structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_llcp_msg_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ uint32_t result; /**< Result. */
+ net_nfc_llcp_socket_t llcp_socket; /**< LLCP socket. */
+} net_nfc_request_llcp_msg_t;
+
+/**
+ * @brief Structure for NFC request HCE APDU containing various parameters.
+ * @details This structure defines an NFC request HCE APDU structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_hce_apdu_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ net_nfc_data_s apdu; /**< APDU. */
+} net_nfc_request_hce_apdu_t;
+/**
+ * @brief Structure for NFC request listen socket containing various parameters.
+ * @details This structure defines an NFC request listen socket structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_listen_socket_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ uint32_t result; /**< Result. */
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ net_nfc_llcp_socket_t client_socket; /**< Client socket. */
+ uint16_t miu; /**< Maximum Information Unit. */
+ uint8_t rw; /**< Receive Window Size. */
+ net_nfc_socket_type_e type; /**< Socket type. */
+ net_nfc_llcp_socket_t oal_socket; /**< OAL socket. */
+ net_nfc_sap_t sap; /**< Service Access Point. */
+ void *trans_param; /**< Transaction parameter. */
+ net_nfc_internal_data_s service_name; /**< Service name. */
+} net_nfc_request_listen_socket_t;
+
+/**
+ * @brief Structure for NFC request receive socket containing various parameters.
+ * @details This structure defines an NFC request receive socket structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_receive_socket_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ uint32_t result; /**< Result. */
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ net_nfc_llcp_socket_t client_socket; /**< Client socket. */
+ net_nfc_llcp_socket_t oal_socket; /**< OAL socket. */
+ size_t req_length; /**< Request length. */
+ void *trans_param; /**< Transaction parameter. */
+ net_nfc_internal_data_s data; /**< Data. */
+} net_nfc_request_receive_socket_t;
+
+/**
+ * @brief Structure for NFC request receive from socket containing various parameters.
+ * @details This structure defines an NFC request receive from socket structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_request_receive_from_socket_t {
+ uint32_t length; /**< Length of the message. */
+ uint32_t request_type; /**< Request type. */
+ uint32_t client_fd; /**< Client file descriptor. */
+ uint32_t flags; /**< Flags. */
+ void *user_param; /**< User parameter. */
+ uint32_t result; /**< Result. */
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ net_nfc_llcp_socket_t client_socket; /**< Client socket. */
+ net_nfc_llcp_socket_t oal_socket; /**< OAL socket. */
+ size_t req_length; /**< Request length. */
+ net_nfc_sap_t sap; /**< Service Access Point. */
+ void *trans_param; /**< Transaction parameter. */
+ net_nfc_internal_data_s data; /**< Data. */
+} net_nfc_request_receive_from_socket_t;
+
+/**
+ * @brief Structure for NFC stack information containing various parameters.
+ * @details This structure defines an NFC stack information structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _net_nfc_stack_information_s {
+ uint32_t net_nfc_supported_tagetType; /**< Supported target type. */
+ uint32_t net_nfc_fw_version; /**< Firmware version. */
+} net_nfc_stack_information_s;
+
+/**
+ * @brief Structure for secure element information containing various parameters.
+ * @details This structure defines a secure element information structure containing various parameters.
+ * @since HAL_MODULE_NFC 1.0
+ */
+typedef struct _secure_element_info_s {
+ net_nfc_target_handle_s *handle; /**< NFC target handle. */
+ net_nfc_secure_element_type_e secure_element_type;/**< Secure element type. */
+ net_nfc_secure_element_state_e secure_element_state;/**< Secure element state. */
+} net_nfc_secure_element_info_s;
+
+/**
+ * @brief Structure for nfc functions.
+ * @since HAL_MODULE_NFC 1.0
+ */
typedef struct _hal_backend_nfc_funcs {
- bool (*start)(net_nfc_error_e * result);;
- bool (*stop)(void);
- bool (*register_listener)(target_detection_listener_cb target_detection_listener, se_transaction_listener_cb se_transaction_listener, llcp_event_listener_cb llcp_event_listener, hce_apdu_listener_cb hce_apdu_listener, net_nfc_error_e * result);
- bool (*unregister_listener)(void);
- bool (*get_firmware_version)(data_s ** data, net_nfc_error_e * result);
- bool (*support_nfc)(net_nfc_error_e * result);
- bool (*check_firmware_version)(net_nfc_error_e * result);
- bool (*update_firmware)(net_nfc_error_e * result);
- bool (*get_stack_information)(net_nfc_stack_information_s * stack_info, net_nfc_error_e * result);
- bool (*configure_discovery)(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config, net_nfc_error_e * result);
- bool (*check_target_presence)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*connect)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*disconnect)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*check_ndef)(net_nfc_target_handle_s * handle, uint8_t * ndef_card_state, int *max_data_size, int *real_data_size, net_nfc_error_e * result);
- bool (*read_ndef)(net_nfc_target_handle_s * handle, data_s ** data, net_nfc_error_e * result);
- bool (*write_ndef)(net_nfc_target_handle_s * handle, data_s * data, net_nfc_error_e * result);
- bool (*make_read_only_ndef)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*format_ndef)(net_nfc_target_handle_s * handle, data_s * secure_key, net_nfc_error_e * result);
- bool (*transceive)(net_nfc_target_handle_s * handle, net_nfc_transceive_info_s * info, data_s ** data, net_nfc_error_e * result);
- bool (*exception_handler)(void);
- bool (*is_ready)(net_nfc_error_e * result);
- bool (*llcp_config)(net_nfc_llcp_config_info_s * config, net_nfc_error_e * result);
- bool (*llcp_check_llcp)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*llcp_activate_llcp)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*llcp_create_socket)(net_nfc_llcp_socket_t * socket, net_nfc_socket_type_e socketType, uint16_t miu, uint8_t rw, net_nfc_error_e * result, void *user_param);
- bool (*llcp_bind)(net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e * result);
- bool (*llcp_listen)(net_nfc_target_handle_s * handle, uint8_t * service_access_name, net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param);
- bool (*llcp_accept)(net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param);
- bool (*llcp_connect_by_url)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t * service_access_name, net_nfc_error_e * result, void *user_param);
- bool (*llcp_connect)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e * result, void *user_param);
- bool (*llcp_disconnect)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param);
- bool (*llcp_socket_close)(net_nfc_llcp_socket_t socket, net_nfc_error_e * result);
- bool (*llcp_recv)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param);
- bool (*llcp_send)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param);
- bool (*llcp_recv_from)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param);
- bool (*llcp_send_to)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, uint8_t service_access_point, net_nfc_error_e * result, void *user_param);
- bool (*llcp_reject)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_error_e * result);
- bool (*llcp_get_remote_config)(net_nfc_target_handle_s * handle, net_nfc_llcp_config_info_s * config, net_nfc_error_e * result);
- bool (*llcp_get_remote_socket_info)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s * option, net_nfc_error_e * result);
- bool (*secure_element_open)(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s ** handle, net_nfc_error_e * result);
- bool (*secure_element_get_atr)(net_nfc_target_handle_s * handle, data_s ** atr, net_nfc_error_e * result);
- bool (*secure_element_send_apdu)(net_nfc_target_handle_s * handle, data_s * command, data_s ** response, net_nfc_error_e * result);
- bool (*secure_element_close)(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
- bool (*get_secure_element_list)(net_nfc_secure_element_info_s * list, int *count, net_nfc_error_e * result);
- bool (*set_secure_element_mode)(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode, net_nfc_error_e * result);
- bool (*sim_test)(net_nfc_error_e * result);
- bool (*prbs_test)(net_nfc_error_e * result, uint32_t tech, uint32_t rate);
- bool (*test_mode_on)(net_nfc_error_e * result);
- bool (*test_mode_off)(net_nfc_error_e * result);
- bool (*eedata_register_set)(net_nfc_error_e * result, uint32_t mode, uint32_t reg_id, data_s * data);
- bool (*ese_test)(net_nfc_error_e * result);
- bool (*test_set_se_tech_type)(net_nfc_error_e * result, net_nfc_se_type_e type, uint32_t tech);
- bool (*hce_response_apdu)(net_nfc_target_handle_s * handle, data_s * response, net_nfc_error_e * result);
- bool (*secure_element_route_aid)(data_s * aid, net_nfc_se_type_e se_type, int power, net_nfc_error_e * result);
- bool (*secure_element_unroute_aid)(data_s * aid, net_nfc_error_e * result);
- bool (*secure_element_commit_routing)(net_nfc_error_e * result);
- bool (*secure_element_set_default_route)(net_nfc_se_type_e switch_on, net_nfc_se_type_e switch_off, net_nfc_se_type_e battery_off, net_nfc_error_e * result);
- bool (*secure_element_clear_aid_table)(net_nfc_error_e * result);
- bool (*secure_element_get_aid_table_size)(int *AIDTableSize, net_nfc_error_e * result);
- bool (*secure_element_set_route_entry)(net_nfc_se_entry_type_e type, net_nfc_se_tech_protocol_type_e value, net_nfc_se_type_e route, int power, net_nfc_error_e * result);
- bool (*secure_element_clear_routing_entry)(net_nfc_se_entry_type_e type, net_nfc_error_e * result);
- bool (*secure_element_set_listen_tech_mask)(net_nfc_se_tech_protocol_type_e screen_state, net_nfc_error_e * result);
- bool (*set_screen_state)(net_nfc_screen_state_type_e screen_state, net_nfc_error_e * result);
+ /**< Starts the NFC module */
+ int (*start)(void);
+ /**< Stops the NFC module */
+ int (*stop)(void);
+ /**< Registers listeners for specific events */
+ int (*register_listener)(net_nfc_target_detection_listener_cb target_detection_listener,
+ net_nfc_se_transaction_listener_cb se_transaction_listener,
+ net_nfc_llcp_event_listener_cb llcp_event_listener,
+ net_nfc_hce_apdu_listener_cb hce_apdu_listener);
+ /**< Unregisters the registered listener */
+ int (*unregister_listener)(void);
+ /**< Gets the firmware version of the NFC module */
+ int (*get_firmware_version)(net_nfc_data_s ** data);
+ /**< Checks whether the NFC module is supported */
+ int (*support_nfc)(void);
+ /**< Checks the firmware version of the NFC module */
+ int (*check_firmware_version)(void);
+ /**< Updates the firmware of the NFC module */
+ int (*update_firmware)(void);
+ /**< Gets the stack information of the NFC module */
+ int (*get_stack_information)(net_nfc_stack_information_s * stack_info);
+ /**< Configures the discovery mode and settings */
+ int (*configure_discovery)(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config);
+ /**< Checks whether a target is present */
+ int (*check_target_presence)(net_nfc_target_handle_s * handle);
+ /**< Connects to a target */
+ int (*connect)(net_nfc_target_handle_s * handle);
+ /**< Disconnects from a target */
+ int (*disconnect)(net_nfc_target_handle_s * handle);
+ /**< Checks whether an NDEF message is supported */
+ int (*check_ndef)(net_nfc_target_handle_s * handle, uint8_t * ndef_card_state, int *max_data_size, int *real_data_size);
+ /**< Reads an NDEF message */
+ int (*read_ndef)(net_nfc_target_handle_s * handle, net_nfc_data_s ** data);
+ /**< Writes an NDEF message */
+ int (*write_ndef)(net_nfc_target_handle_s * handle, net_nfc_data_s * data);
+ /**< Makes an NDEF message read-only */
+ int (*make_read_only_ndef)(net_nfc_target_handle_s * handle);
+ /**< Formats an NDEF message */
+ int (*format_ndef)(net_nfc_target_handle_s * handle, net_nfc_data_s * secure_key);
+ /**< Transceives data with a target */
+ int (*transceive)(net_nfc_target_handle_s * handle, net_nfc_transceive_info_s * info, net_nfc_data_s ** data);
+ /**< Handles exceptions */
+ int (*exception_handler)(void);
+ /**< Checks whether the NFC module is ready */
+ int (*is_ready)(void);
+ /**< Configures LLCP settings */
+ int (*llcp_config)(net_nfc_llcp_config_info_s * config);
+ /**< Checks whether LLCP is supported */
+ int (*llcp_check_llcp)(net_nfc_target_handle_s * handle);
+ /**< Activates LLCP */
+ int (*llcp_activate_llcp)(net_nfc_target_handle_s * handle);
+ /**< Creates a socket */
+ int (*llcp_create_socket)(net_nfc_llcp_socket_t * socket, net_nfc_socket_type_e type, uint16_t miu, uint8_t rw, void *user_param);
+ /**< Binds a socket */
+ int (*llcp_bind)(net_nfc_llcp_socket_t socket, uint8_t service_access_point);
+ /**< Listens on a socket */
+ int (*llcp_listen)(net_nfc_target_handle_s * handle, uint8_t * service_access_name, net_nfc_llcp_socket_t socket, void *user_param);
+ /**< Accepts a connection request */
+ int (*llcp_accept)(net_nfc_llcp_socket_t socket, void *user_param);
+ /**< Connects using a URL */
+ int (*llcp_connect_by_url)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t * service_access_name, void *user_param);
+ /**< Connects using a service access point */
+ int (*llcp_connect)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, void *user_param);
+ /**< Disconnects from a socket */
+ int (*llcp_disconnect)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, void *user_param);
+ /**< Closes a socket */
+ int (*llcp_socket_close)(net_nfc_llcp_socket_t socket);
+ /**< Receives data on a socket */
+ int (*llcp_recv)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param);
+ /**< Sends data on a socket */
+ int (*llcp_send)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param);
+ /**< Receives data on a socket */
+ int (*llcp_recv_from)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param);
+ /**< Sends data on a socket */
+ int (*llcp_send_to)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, uint8_t service_access_point, void *user_param);
+ /**< Rejects a connection request */
+ int (*llcp_reject)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket);
+ /**< Gets the remote LLCP configuration */
+ int (*llcp_get_remote_config)(net_nfc_target_handle_s * handle, net_nfc_llcp_config_info_s * config);
+ /**< Gets the remote socket information */
+ int (*llcp_get_remote_socket_info)(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s * option);
+ /**< Opens a secure element */
+ int (*secure_element_open)(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s ** handle);
+ /**< Gets the ATR information of a secure element */
+ int (*secure_element_get_atr)(net_nfc_target_handle_s * handle, net_nfc_data_s ** atr);
+ /**< Sends an APDU command to a secure element */
+ int (*secure_element_send_apdu)(net_nfc_target_handle_s * handle, net_nfc_data_s * command, net_nfc_data_s ** response);
+ /**< Closes a secure element */
+ int (*secure_element_close)(net_nfc_target_handle_s * handle);
+ /**< Gets the list of secure elements */
+ int (*get_secure_element_list)(net_nfc_secure_element_info_s * list, int *count);
+ /**< Sets the mode of a secure element */
+ int (*set_secure_element_mode)(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode);
+ /**< Enables test mode */
+ int (*test_mode_on)(void);
+ /**< Disables test mode */
+ int (*test_mode_off)(void);
+ /**< Sends a response APDU in HCE mode */
+ int (*hce_response_apdu)(net_nfc_target_handle_s * handle, net_nfc_data_s * response);
+ /**< Routes an AID to a secure element */
+ int (*secure_element_route_aid)(net_nfc_data_s * aid, net_nfc_se_type_e se_type, int power);
+ /**< Unroutes an AID from a secure element */
+ int (*secure_element_unroute_aid)(net_nfc_data_s * aid);
+ /**< Commits the routing table */
+ int (*secure_element_commit_routing)(void);
+ /**< Sets the default route for different states */
+ int (*secure_element_set_default_route)(net_nfc_se_type_e switch_on, net_nfc_se_type_e switch_off, net_nfc_se_type_e battery_off);
+ /**< Clears the AID table */
+ int (*secure_element_clear_aid_table)(void);
+ /**< Gets the size of the AID table */
+ int (*secure_element_get_aid_table_size)(int *table_size);
+ /**< Sets a routing entry */
+ int (*secure_element_set_route_entry)(net_nfc_se_entry_type_e type, net_nfc_se_tech_protocol_type_e value, net_nfc_se_type_e route, int power);
+ /**< Clears a routing entry */
+ int (*secure_element_clear_routing_entry)(net_nfc_se_entry_type_e type);
+ /**< Sets the technology mask for listening */
+ int (*secure_element_set_listen_tech_mask)(net_nfc_se_tech_protocol_type_e screen_state);
+ /**< Sets the screen state */
+ int (*set_screen_state)(net_nfc_screen_state_type_e screen_state);
} hal_backend_nfc_funcs;
+/**
+ * @}
+ */
+
#ifdef __cplusplus
}
#endif
+++ /dev/null
-/*
- * HAL (Hardware Abstract Layer) NFC API
- *
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __HAL_NFC_TYPES__
-#define __HAL_NFC_TYPES__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- net_nfc_error_e is enum type that returned from each functions
- it mostly contains the error codes and it may contains status codes.
- */
-typedef enum {
- /*000 */ NET_NFC_OK = 0,
- /**< Status is OK */
- /*999 */ NET_NFC_UNKNOWN_ERROR = -999,
- /**< Unknown error */
- /*998 */ NET_NFC_ALLOC_FAIL,
- /**< Memory allocation is failed */
- /*997 */ NET_NFC_THREAD_CREATE_FAIL,
- /**< Thread creation is failed */
- /*996 */ NET_NFC_INVALID_STATE,
- /**< State of NFC-Manager or nfc-stack is not normal */
- /*995 */ NET_NFC_IPC_FAIL,
- /**< Communication with ipc is failed. (from client to server)*/
- /*994 */ NET_NFC_OUT_OF_BOUND,
- /**< Index is out of bound */
- /*993 */ NET_NFC_NULL_PARAMETER,
- /**< Unexpected NULL parameter is received */
- /*992 */ NET_NFC_BUFFER_TOO_SMALL,
- /**< Requested buffer is too small to store data, this error should be received */
- /*991 */ NET_NFC_ALREADY_INITIALIZED,
- /**< You tried to initialized again without de-init */
- /*990 */ NET_NFC_COMMUNICATE_WITH_CONTROLLER_FAILED,
- /**< Communication with Controller Chipset is failed this is Fatal Error */
- /*989 */ NET_NFC_RF_TIMEOUT,
- /**< Timeout is raised while communicate with a tag */
- /*988 */ NET_NFC_RF_ERROR,
- /**< Unexpected package is received from target, you may receive this error comes by the low level RF communication fault*/
- /*987 */ NET_NFC_NOT_INITIALIZED,
- /**< Application tries to request without initialization */
- /*986 */ NET_NFC_NOT_SUPPORTED,
- /**< Request information or command is not supported in current connected target */
- /*985 */ NET_NFC_ALREADY_REGISTERED,
- /**< Requested SAP number is already used by other socket or data is already appended or registered */
- /*984 */ NET_NFC_NOT_ALLOWED_OPERATION,
- /**< Requested Operation is not allowed in the situation in critical time (such as write data on target)*/
- /*983 */ NET_NFC_BUSY,
- /**< Previous operation is not finished. don't worry to get this message, most of request will be executed in the serial queue */
- /*982 */ NET_NFC_INVALID_HANDLE,
- /**< Requested Device in not valid device */
- /*981 */ NET_NFC_TAG_READ_FAILED,
- /**< Tag reading is failed because of unexpected chunk data is received or error ack is received */
- /*980 */ NET_NFC_TAG_WRITE_FAILED,
- /**< When you try to write on read only tag or error ack is received */
- /*979 */ NET_NFC_NO_NDEF_SUPPORT,
- /**< Tag is not supported NDEF format for tag is not formatted for NDEF */
- /*978 */ NET_NFC_NO_NDEF_MESSAGE,
- /**< No data is received after NDEF reading */
- /*977 */ NET_NFC_INVALID_FORMAT,
- /**< Received data is not readable or it has illegal values or format */
- /*976 */ NET_NFC_INSUFFICIENT_STORAGE,
- /**< The connected tag does not have enough information */
- /*975 */ NET_NFC_OPERATION_FAIL,
- /**< The remote target returned error while doing a operation*/
- /*974 */ NET_NFC_NOT_CONNECTED,
- /**< remote is not connected correctly. This can be happened when the RF does not have enough strength */
- /*973 */ NET_NFC_NO_DATA_FOUND,
- /**< Requested data is not found in the list or properties */
- /*972 */ NET_NFC_SECURITY_FAIL,
- /**< Authentication is failed while communication with nfc-manager server */
- /*971 */ NET_NFC_TARGET_IS_MOVED_AWAY,
- /**< Target is lost while doing a operation */
- /*970 */ NET_NFC_TAG_IS_ALREADY_FORMATTED,
- /** Target is already formatted */
- /*969 */ NET_NFC_NOT_REGISTERED,
- /**< removal is requested but requested data is not registered */
- /*968 */ NET_NFC_INVALID_PARAM,
- /**< removal is requested but requested data is not registered */
- /*967 */ NET_NFC_PERMISSION_DENIED,
- /**< privilege check is failed */
- /*966 */ NET_NFC_NOT_ACTIVATED,
- /**< Application tries to request without activation */
- /*965 */ NET_NFC_DATA_CONFLICTED,
- /**< Data is conflicted with another one */
-
- /*499 */ NET_NFC_NDEF_TYPE_LENGTH_IS_NOT_OK = -499,
- /**< Illegal ndef record type length */
- /*498 */ NET_NFC_NDEF_PAYLOAD_LENGTH_IS_NOT_OK,
- /**< Illegal ndef record payload length */
- /*497 */ NET_NFC_NDEF_ID_LENGTH_IS_NOT_OK,
- /**< Illegal ndef record id length */
- /*496 */ NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE,
- /**< Parameter record is not expected record. for example, try to URI from text record */
- /*495 */ NET_NFC_NDEF_BUF_END_WITHOUT_ME,
- /**< NDEF messages is terminated without ME flag */
- /*494 */ NET_NFC_DEVICE_DOES_NOT_SUPPORT_NFC,
- /**< Current device does not support NFC feature or this manager does not found plugin library */
-
- /*399 */ NET_NFC_LLCP_INVALID_SOCKET = -399,
- /**< socket is not valid socket */
- /*398 */ NET_NFC_LLCP_SOCKET_DISCONNECTED,
- /**< socket is disconnected */
- /*397 */ NET_NFC_LLCP_SOCKET_FRAME_REJECTED,
- /**< send data is rejected from remote side */
-
- /*299 */ NET_NFC_P2P_SEND_FAIL = -299,
- /**< P2P data send fail */
-} net_nfc_error_e;
-
-/**
-Enum value of the record type ( TNF value )
-*/
-typedef enum {
- NET_NFC_RECORD_EMPTY = 0x0,
- NET_NFC_RECORD_WELL_KNOWN_TYPE,
- NET_NFC_RECORD_MIME_TYPE, // Media type
- NET_NFC_RECORD_URI,
- NET_NFC_RECORD_EXTERNAL_RTD,
- NET_NFC_RECORD_UNKNOWN,
- NET_NFC_RECORD_UNCHAGNED,
-} net_nfc_record_tnf_e;
-
-/**
-net_nfc_message_e is identify the events comes from nfc-manager.
-most of the events response event that you requested operations.
-and some of the events are generated by nfc-manager. (example, NET_NFC_MESSAGE_TAG_DISCOVERED, NET_NFC_MESSAGE_TAG_DETACHED,
-NET_NFC_MESSAGE_LLCP_DISCOVERED and NET_NFC_MESSAGE_LLCP_DETACHED)
-
-All of the events are delivered by the the callback function that registered with "net_nfc_set_response_callback"
-*/
-
-typedef enum {
- NET_NFC_MESSAGE_TRANSCEIVE = 0, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_tranceive"
- <br> if the operation is success, the data parameter should cast into data_h or it return NULL*/
- NET_NFC_MESSAGE_READ_NDEF, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_read_tag"
- <br> if the operation is success, the data parameter should cast into ndef_message_h or it return NULL */
- NET_NFC_MESSAGE_WRITE_NDEF, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_write_ndef"
- <br> data pointer always returns NULL */
- NET_NFC_MESSAGE_MAKE_READ_ONLY_NDEF, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_make_read_only_ndef"
- <br> data pointer always returns NULL */
- NET_NFC_MESSAGE_IS_TAG_CONNECTED, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_is_tag_conneced"
- <br> data pointer always returns NULL */
- NET_NFC_MESSAGE_GET_CURRENT_TAG_INFO, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_get_current_tag_infof"
- <br> if the operation is success, the data parameter should cast into net_nfc_target_info_h or it return NULL */
- NET_NFC_MESSAGE_GET_CURRENT_TARGET_HANDLE, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_get_current_target_handle"
- <br> if the operation is success, the data parameter should cast into net_nfc_target_handle_h or it return NULL */
- NET_NFC_MESSAGE_TAG_DISCOVERED, /**< Type: Notify Event, <br> When a tag or SE is detected, you got this event.
- <br> The data contains the target info , need to cast to net_nfc_target_info_h*/
- NET_NFC_MESSAGE_NOTIFY, /**< This Notify Event <br> when the unexpected error has occurred, this event is delivered. data pointer always returns NULL */
- NET_NFC_MESSAGE_TAG_DETACHED, /**< Type: Notify Event, <br> When a tag or SE is disappeared, you got this event.
- <br> The data contains the target info , need to cast to net_nfc_target_info_h but it does not have detail target info
- <br> please, do not use "net_nfc_get_tag_info_keys" when you got this event*/
- /*10 */ NET_NFC_MESSAGE_FORMAT_NDEF,
- /**< Type: Response Event <br> After complete "net_nfc_format_ndef", this event is delivered */
- NET_NFC_MESSAGE_LLCP_DISCOVERED, /**< Type: Notify Event <br> When LLCP is discovered and remote device is support llcp, you receive this event
- <br> data pointer contains the remote llcp configuration info. Cast to net_nfc_llcp_config_info_h*/
- NET_NFC_MESSAGE_P2P_DETACHED, /**< Type: Notify Event <br> When LLCP is de-activated by removing the device, you receive this event*/
- NET_NFC_MESSAGE_LLCP_CONFIG, /**< Type: Response Event. <br> The operation of "net_nfc_set_llcp_local_configure" is completed */
-
- NET_NFC_MESSAGE_P2P_DISCOVERED, /**< Type: Notify Event <br> The remove device is detected and ready for transferring data to remote side */
- NET_NFC_MESSAGE_P2P_SEND, /**< Type: Response Event, <br> This events is received after calling the "net_nfc_send_exchanger_data" */
- NET_NFC_MESSAGE_P2P_RECEIVE, /**< Type: Notify Event, <br> When llcp server socket receive some data, this event is delivered. */
-
- NET_NFC_MESSAGE_SE_START_TRANSACTION,
- /**< Type: Notify Event, indicates external reader start transaction*/
- NET_NFC_MESSAGE_SE_END_TRANSACTION,
- /**< Type: Notify Event, indicates external reader end transaction*/
- NET_NFC_MESSAGE_SE_TYPE_TRANSACTION,
- /**< Type: Notify Event, Indicates external reader trying to access secure element */
- /*20 */ NET_NFC_MESSAGE_SE_CONNECTIVITY,
- /**< Type: Notify Event, This event notifies the terminal host that it shall send a connectivity event from UICC */
- NET_NFC_MESSAGE_SE_FIELD_ON,
- /**< Type: Notify Event, indicates external reader field is on*/
- NET_NFC_MESSAGE_SE_FIELD_OFF,
- /**< Type: Notify Event, indicates external reader field is off*/
- NET_NFC_MESSAGE_SE_TYPE_CHANGED,
- /**< Type: Notify Event, indicates secure element type is changed*/
- NET_NFC_MESSAGE_SE_CARD_EMULATION_CHANGED,
- /**< Type: Notify Event, indicates card emulation mode is changed*/
- NET_NFC_MESSAGE_CONNECTION_HANDOVER,
- /**< Type: Response Event. <br> The result of connection handover. If it has been completed successfully, this event will include the information of alternative carrier. */
-
- NET_NFC_MESSAGE_SET_SE,
- NET_NFC_MESSAGE_GET_SE,
- NET_NFC_MESSAGE_OPEN_INTERNAL_SE,
- NET_NFC_MESSAGE_CLOSE_INTERNAL_SE,
-/*30*/ NET_NFC_MESSAGE_SEND_APDU_SE,
- NET_NFC_MESSAGE_GET_ATR_SE,
- NET_NFC_GET_SERVER_STATE,
-
- NET_NFC_MESSAGE_SIM_TEST,
-
- NET_NFC_MESSAGE_INIT,
- NET_NFC_MESSAGE_DEINIT,
-
- NET_NFC_MESSAGE_PRBS_TEST,
-
- NET_NFC_MESSAGE_GET_FIRMWARE_VERSION,
-
- NET_NFC_MESSAGE_SET_EEDATA,
-
- NET_NFC_MESSAGE_SNEP_START_SERVER,
- NET_NFC_MESSAGE_SNEP_START_CLIENT,
-/*40*/ NET_NFC_MESSAGE_SNEP_REQUEST,
- NET_NFC_MESSAGE_SNEP_STOP_SERVICE,
- NET_NFC_MESSAGE_SNEP_REGISTER_SERVER,
- NET_NFC_MESSAGE_SNEP_UNREGISTER_SERVER,
-
- NET_NFC_MESSAGE_CONNECT,
- NET_NFC_MESSAGE_DISCONNECT,
- NET_NFC_MESSAGE_SET_CARD_EMULATION,
-
-/*47*/ NET_NFC_MESSAGE_ROUTING_HOST_EMU_ACTIVATED,
- NET_NFC_MESSAGE_ROUTING_HOST_EMU_DEACTIVATED,
- NET_NFC_MESSAGE_ROUTING_HOST_EMU_DATA,
-} net_nfc_message_e;
-
-typedef enum {
- NET_NFC_UNKNOWN_TARGET = 0x00U,
-
- /* Specific PICC Devices */
-
- NET_NFC_GENERIC_PICC,
- NET_NFC_ISO14443_A_PICC,
- NET_NFC_ISO14443_4A_PICC,
- NET_NFC_ISO14443_3A_PICC,
- NET_NFC_MIFARE_MINI_PICC,
- NET_NFC_MIFARE_1K_PICC,
- NET_NFC_MIFARE_4K_PICC,
- NET_NFC_MIFARE_ULTRA_PICC,
- NET_NFC_MIFARE_DESFIRE_PICC,
- NET_NFC_ISO14443_B_PICC,
- NET_NFC_ISO14443_4B_PICC,
- NET_NFC_ISO14443_BPRIME_PICC,
- NET_NFC_FELICA_PICC,
- NET_NFC_JEWEL_PICC,
- NET_NFC_ISO15693_PICC,
- NET_NFC_BARCODE_128_PICC,
- NET_NFC_BARCODE_256_PICC,
-
- /* NFC-IP1 Device Types */
- NET_NFC_NFCIP1_TARGET,
- NET_NFC_NFCIP1_INITIATOR,
-
-} net_nfc_target_type_e;
-
-/**
-Card states for nfc tag
-*/
-typedef enum {
- NET_NFC_NDEF_CARD_INVALID = 0x00,
- /**< The card is not NFC forum specified tag. The ndef format will be needed. */
- NET_NFC_NDEF_CARD_INITIALISED,
- /**< The card is NFC forum specified tag, but It has no actual data. So, the ndef write will be needed. */
- NET_NFC_NDEF_CARD_READ_WRITE,
- /**< The card is NFC forum specified tag. The ndef read and write will be allowed. */
- NET_NFC_NDEF_CARD_READ_ONLY
- /**< The card is NFC forum specified tag, but only the ndef read will be allowed. */
-} net_nfc_ndef_card_state_e;
-
-/**
-Encoding type for string message
-*/
-typedef enum {
- NET_NFC_ENCODE_UTF_8 = 0x00,
- NET_NFC_ENCODE_UTF_16,
-} net_nfc_encode_type_e;
-
-/**
-URI scheme type defined in the NFC forum "URI Record Type Definition"
-*/
-typedef enum {
- NET_NFC_SCHEMA_FULL_URI = 0x00, /**< protocol is specify by payload */
- NET_NFC_SCHEMA_HTTP_WWW, /**< http://www. */
- NET_NFC_SCHEMA_HTTPS_WWW, /**< https://www. */
- NET_NFC_SCHEMA_HTTP, /**< http:// */
- NET_NFC_SCHEMA_HTTPS, /**< https:// */
- NET_NFC_SCHEMA_TEL, /**< tel: */
- NET_NFC_SCHEMA_MAILTO, /**< mailto: */
- NET_NFC_SCHEMA_FTP_ANONYMOUS, /**< ftp://anonymouse:anonymouse@ */
- NET_NFC_SCHEMA_FTP_FTP, /**< ftp://ftp. */
- NET_NFC_SCHEMA_FTPS, /**< ftps:// */
- NET_NFC_SCHEMA_SFTP, /**< sftp:// */
- NET_NFC_SCHEMA_SMB, /**< smb:// */
- NET_NFC_SCHEMA_NFS, /**< nfs:// */
- NET_NFC_SCHEMA_FTP, /**< ftp:// */
- NET_NFC_SCHEMA_DAV, /**< dav:// */
- NET_NFC_SCHEMA_NEWS, /**< news:// */
- NET_NFC_SCHEMA_TELNET, /**< telnet:// */
- NET_NFC_SCHEMA_IMAP, /**< imap: */
- NET_NFC_SCHEMA_RTSP, /**< rtsp:// */
- NET_NFC_SCHEMA_URN, /**< urn: */
- NET_NFC_SCHEMA_POP, /**< pop: */
- NET_NFC_SCHEMA_SIP, /**< sip: */
- NET_NFC_SCHEMA_SIPS, /**< sips: */
- NET_NFC_SCHEMA_TFTP, /**< tftp: */
- NET_NFC_SCHEMA_BTSPP, /**< btspp:// */
- NET_NFC_SCHEMA_BTL2CAP, /**< btl2cap:// */
- NET_NFC_SCHEMA_BTGOEP, /**< btgoep:// */
- NET_NFC_SCHEMA_TCPOBEX, /**< tcpobex:// */
- NET_NFC_SCHEMA_IRDAOBEX, /**< irdaobex:// */
- NET_NFC_SCHEMA_FILE, /**< file:// */
- NET_NFC_SCHEMA_URN_EPC_ID, /**< urn:epc:id: */
- NET_NFC_SCHEMA_URN_EPC_TAG, /**< urn:epc:tag: */
- NET_NFC_SCHEMA_URN_EPC_PAT, /**< urn:epc:pat: */
- NET_NFC_SCHEMA_URN_EPC_RAW, /**< urn:epc:raw: */
- NET_NFC_SCHEMA_URN_EPC, /**< urn:epc: */
- NET_NFC_SCHEMA_URN_NFC, /**< urn:epc:nfc: */
- NET_NFC_SCHEMA_MAX /**< -- indicating max-- */
-} net_nfc_schema_type_e;
-
-// this is for target detect event filter
-
-typedef enum {
- NET_NFC_ALL_DISABLE = 0x0000,
- NET_NFC_ISO14443A_ENABLE = 0x0001,
- NET_NFC_ISO14443B_ENABLE = 0x0002,
- NET_NFC_ISO15693_ENABLE = 0x0004,
- NET_NFC_FELICA_ENABLE = 0x0008,
- NET_NFC_JEWEL_ENABLE = 0x0010,
- NET_NFC_IP_ENABLE = 0x0020,
- NET_NFC_ALL_ENABLE = ~0,
-
-} net_nfc_event_filter_e;
-
-/*
-**************************************
-LLCP defines
-**************************************
-*/
-/**
-These events are delivered to the each socket callback. These events are separated events that comes from "net_nfc_set_response_callback" callback
-*/
-typedef enum {
- /* start number should be larger than "net_nfc_message_e"
- because to make seperate with net_nfc_message_e event it may conflict in
- the dispatcher and ipc part */
- NET_NFC_MESSAGE_LLCP_LISTEN = 1000,
- /**< Type: Response Event <br> this event indicates "net_nfc_listen_llcp" requested is completed*/
- NET_NFC_MESSAGE_LLCP_ACCEPTED,
- /**< Type: Notify Event. <br> Remote socket is accepted to listening socket
- <br> data pointer contains the remote socket info (Cast to net_nfc_llcp_socket_option_h)*/
- NET_NFC_MESSAGE_LLCP_CONNECT,
- /**< Type: Response Event. <br> "net_nfc_connect_llcp_with" request is completed and your socket is connected to remote site with url*/
- NET_NFC_MESSAGE_LLCP_CONNECT_SAP,
- /**< Type: Response Event.<br> "net_nfc_connect_llcp_with_sap" request is completed and your socket is connected to remote site with sap number*/
- NET_NFC_MESSAGE_LLCP_SEND,
- /**< Type: Response Event,<br> "net_nfc_send_llcp" operation is completed (connection mode)*/
- NET_NFC_MESSAGE_LLCP_SEND_TO,
- /**< Type: Response Event,<br> "net_nfc_send_llcp_to"operation is completed (connectionless mode)*/
- NET_NFC_MESSAGE_LLCP_RECEIVE,
- /**< Type: Response Event,<br> "net_nfc_receive_llcp" operation is completed (connection mode)
- <br> data pointer contains received data (Cast to data_h)*/
- NET_NFC_MESSAGE_LLCP_RECEIVE_FROM,
- /**< Type: Response Event,<br> "net_nfc_receive_llcp_from" operation is completed (connectionless mode)*/
- NET_NFC_MESSAGE_LLCP_DISCONNECT,
- /**< Type: Response Event,<br> "net_nfc_disconnect_llcp" request is completed */
- NET_NFC_MESSAGE_LLCP_ERROR,
- /**< Type: Notify Event,<br> when the socket is disconnected, you may receive this event */
- NET_NFC_MESSAGE_LLCP_CONNECT_REQ,
- /**< Type: Notify Event,<br> when the peer requests connect, you may receive this event */
- NET_NFC_MESSAGE_LLCP_ACCEPT,
- /**< Type: Response Event <br> this event indicates "net_nfc_accept_llcp" requested is completed*/
- NET_NFC_MESSAGE_LLCP_REJECT,
- /**< Type: Response Event <br> this event indicates "net_nfc_reject_llcp" requested is completed*/
- NET_NFC_MESSAGE_LLCP_REJECTED,
- /**< Type: Notify Event,<br> when the socket is rejected, you may receive this event */
- NET_NFC_MESSAGE_LLCP_CLOSE,
- /**< Type: Response Event,<br> "net_nfc_close_llcp_socket" request is completed */
-
-} net_nfc_llcp_message_e;
-
-typedef enum {
- NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED,
- NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONLESS,
-} net_nfc_socket_type_e;
-
-typedef enum {
- NET_NFC_SNEP = 0x00,
- NET_NFC_NPP,
-} llcp_app_protocol_e;
-
-typedef struct _data_s *data_h;
-
-typedef struct _ndef_record_s *ndef_record_h;
-
-typedef struct _ndef_message_s *ndef_message_h;
-
-typedef struct _net_nfc_target_info_s *net_nfc_target_info_h;
-
-typedef uint32_t net_nfc_traceive_cmd;
-
-typedef struct _net_nfc_llcp_config_info_s *net_nfc_llcp_config_info_h;
-
-typedef struct _net_nfc_llcp_socket_option_s *net_nfc_llcp_socket_option_h;
-
-typedef struct _net_nfc_target_handle_s *net_nfc_target_handle_h;
-
-typedef struct _net_nfc_connection_handover_info_s *net_nfc_connection_handover_info_h;
-
-typedef uint8_t sap_t;
-
-typedef uint32_t net_nfc_llcp_socket_t;
-
-typedef void *net_nfc_snep_handle_h;
-
-// LLCP Callback
-typedef void (*net_nfc_llcp_socket_cb) (net_nfc_llcp_message_e message, net_nfc_error_e result, void *data, void *user_data, void *trans_data);
-
-// Main Callback
-typedef void (*net_nfc_response_cb) (net_nfc_message_e message, net_nfc_error_e result, void *data, void *user_param, void *trans_data);
-
-typedef void (*net_nfc_internal_se_response_cb) (net_nfc_message_e message, net_nfc_error_e result, void *data, void *user_param, void *trans_data);
-
-typedef void (*net_nfc_set_activation_completed_cb) (net_nfc_error_e error, void *user_data);
-
-// handover
-
-typedef enum {
- NET_NFC_CONN_HANDOVER_CARRIER_BT = 0x00,
- NET_NFC_CONN_HANDOVER_CARRIER_WIFI_WPS, /* Wifi Protected Setup */
-#define NET_NFC_CONN_HANDOVER_CARRIER_WIFI_BSS NET_NFC_CONN_HANDOVER_CARRIER_WIFI_WPS
- NET_NFC_CONN_HANDOVER_CARRIER_WIFI_P2P, /* Wifi Peer-to-Peer */
-#define NET_NFC_CONN_HANDOVER_CARRIER_WIFI_IBSS NET_NFC_CONN_HANDOVER_CARRIER_WIFI_P2P
-#define NET_NFC_CONN_HANDOVER_CARRIER_WIFI_DIRECT NET_NFC_CONN_HANDOVER_CARRIER_WIFI_P2P
- NET_NFC_CONN_HANDOVER_CARRIER_BT_LE,
- NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN,
-} net_nfc_conn_handover_carrier_type_e;
-
-typedef enum {
- NET_NFC_CONN_HANDOVER_CARRIER_INACTIVATE = 0x00,
- NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATE,
- NET_NFC_CONN_HANDOVER_CARRIER_ACTIVATING,
- NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN_STATUS,
-} net_nfc_conn_handover_carrier_state_e;
-
-typedef struct _net_nfc_conn_handover_carrier_info_s *net_nfc_conn_handover_carrier_info_h;
-typedef struct _net_nfc_conn_handover_info_s *net_nfc_conn_handover_info_h;
-
-#define MIFARE_KEY_DEFAULT {(uint8_t)0xFF, (uint8_t)0xFF, (uint8_t)0xFF, (uint8_t)0xFF, (uint8_t)0xFF, (uint8_t)0xFF}
-#define MIFARE_KEY_APPLICATION_DIRECTORY {(uint8_t)0xA0, (uint8_t)0xA1, (uint8_t)0xA2, (uint8_t)0xA3, (uint8_t)0xA4, (uint8_t)0xA5}
-#define MIFARE_KEY_NET_NFC_FORUM {(uint8_t)0xD3, (uint8_t)0xF7, (uint8_t)0xD3, (uint8_t)0xF7, (uint8_t)0xD3, (uint8_t)0xF7}
-#define MIFARE_KEY_LENGTH 6
-
-typedef enum {
- NET_NFC_FELICA_POLL_NO_REQUEST = 0x00,
- NET_NFC_FELICA_POLL_SYSTEM_CODE_REQUEST,
- NET_NFC_FELICA_POLL_COMM_SPEED_REQUEST,
- NET_NFC_FELICA_POLL_MAX = 0xFF,
-} net_nfc_felica_poll_request_code_e;
-
-/**
-WIFI configuration key enums for connection handover.
-*/
-
-typedef enum {
- NET_NFC_WIFI_ATTRIBUTE_VERSION = 0x104A,
- NET_NFC_WIFI_ATTRIBUTE_CREDENTIAL = 0x100E,
- NET_NFC_WIFI_ATTRIBUTE_NET_INDEX = 0x1026,
- NET_NFC_WIFI_ATTRIBUTE_SSID = 0x1045,
- NET_NFC_WIFI_ATTRIBUTE_AUTH_TYPE = 0x1003, /*< WPA2PSK 0x0020 */
- NET_NFC_WIFI_ATTRIBUTE_ENC_TYPE = 0x100F, /*< AES 0x0008 */
- NET_NFC_WIFI_ATTRIBUTE_NET_KEY = 0x1027,
- NET_NFC_WIFI_ATTRIBUTE_MAC_ADDR = 0x1020,
- NET_NFC_WIFI_ATTRIBUTE_CHANNEL = 0x1001, /* Channel number - based on IEEE */
- NET_NFC_WIFI_ATTRIBUTE_VEN_EXT = 0x1049,
- NET_NFC_WIFI_ATTRIBUTE_VERSION2 = 0x00,
-} net_nfc_carrier_wifi_attribute_e;
-
-typedef enum {
- NET_NFC_WIFI_P2P_ATTRIBUTE_MANUFACTURER = 0x1021,
- NET_NFC_WIFI_P2P_ATTRIBUTE_MODEL_NAME = 0x1023,
- NET_NFC_WIFI_P2P_ATTRIBUTE_MODEL_NUMBER = 0x1024,
- NET_NFC_WIFI_P2P_ATTRIBUTE_OOB_DEVICE_PASSWORD = 0x102C,
- NET_NFC_WIFI_P2P_ATTRIBUTE_RF_BANDS = 0x103C,
- NET_NFC_WIFI_P2P_ATTRIBUTE_SERIAL_NUMBER = 0x1042,
- NET_NFC_WIFI_P2P_ATTRIBUTE_UUID_E = 0x1047,
- NET_NFC_WIFI_P2P_ATTRIBUTE_VEN_EXT = 0x1049,
-
- NET_NFC_WIFI_P2P_ATTRIBUTE_CAPABILITY = 0x02,
- NET_NFC_WIFI_P2P_ATTRIBUTE_DEVICE_INFO = 0x0D,
- NET_NFC_WIFI_P2P_ATTRIBUTE_OOB_GROUP_OWNER_NEGO_CHANNEL = 0x13,
- NET_NFC_WIFI_P2P_ATTRIBUTE_CHANNEL_LIST = 0x0B,
- NET_NFC_WIFI_P2P_ATTRIBUTE_GROUP_INFO = 0x0E,
- NET_NFC_WIFI_P2P_ATTRIBUTE_GROUP_ID = 0x0F,
-} net_nfc_carrier_wifi_p2p_attribute_e;
-
-typedef enum {
- NET_NFC_BT_ATTRIBUTE_UUID16_PART = 0x02, /* More 16-bit UUIDs available */
- NET_NFC_BT_ATTRIBUTE_UUID16 = 0x03, /* Complete list of 16-bit UUIDs */
- NET_NFC_BT_ATTRIBUTE_UUID32_PART = 0x04, /* More 32-bit UUIDs available */
- NET_NFC_BT_ATTRIBUTE_UUID32 = 0x05, /* Complete list of 32-bit UUIDs */
- NET_NFC_BT_ATTRIBUTE_UUID128_PART = 0x06, /* More 128-bit UUIDs available */
- NET_NFC_BT_ATTRIBUTE_UUID128 = 0x07, /* Complete list of 128-bit UUIDs */
- NET_NFC_BT_ATTRIBUTE_NAME_PART = 0x08, /* Shortened local name */
- NET_NFC_BT_ATTRIBUTE_NAME = 0x09, /* Complete local name */
- NET_NFC_BT_ATTRIBUTE_TXPOWER = 0x0a, /* TX Power level */
- NET_NFC_BT_ATTRIBUTE_OOB_COD = 0x0d, /* SSP OOB Class of Device */
- NET_NFC_BT_ATTRIBUTE_OOB_HASH_C = 0x0e, /* SSP OOB Hash C */
- NET_NFC_BT_ATTRIBUTE_OOB_HASH_R = 0x0f, /* SSP OOB Randomizer R */
- NET_NFC_BT_ATTRIBUTE_ID = 0x10, /* Device ID */
- NET_NFC_BT_ATTRIBUTE_MANUFACTURER = 0xFF, /* Manufacturer Specific Data */
- NET_NFC_BT_ATTRIBUTE_ADDRESS = 0xF0, /* Bluetooth device Address */
-} net_nfc_handover_bt_attribute_e;
-
-typedef struct _net_nfc_carrier_config_s *net_nfc_carrier_config_h;
-typedef struct _net_nfc_carrier_property_s *net_nfc_property_group_h;
-
-typedef struct _net_nfc_ch_message_s *net_nfc_ch_message_h;
-typedef struct _net_nfc_ch_carrier_s *net_nfc_ch_carrier_h;
-
-typedef enum {
- NET_NFC_SE_TYPE_NONE = 0x00,
- /**< Invalid */
- NET_NFC_SE_TYPE_ESE = 0x01,
- /**< SmartMX */
- NET_NFC_SE_TYPE_UICC = 0x02,
- /**< UICC */
- NET_NFC_SE_TYPE_SDCARD = 0x03, /* SDCard type is not currently supported */
- NET_NFC_SE_TYPE_HCE = 0x04, /* SDCard type is not currently supported */
-} net_nfc_se_type_e;
-
-typedef enum {
- NET_NFC_SE_INVALID_ENTRY = 0x00,
- /**< Indicates SE type is Invalid */
- NET_NFC_SE_TECH_ENTRY = 0x01, /*Technology */
- NET_NFC_SE_PROTOCOL_ENTRY = 0x02, /*Protocol */
- NET_NFC_SE_AID_ENTRY = 0x04, /*Using it clear aid table */
-} net_nfc_se_entry_type_e;
-
-typedef enum {
- NET_NFC_SE_INVALID_TECH_PROTO = 0x00,
- /**< Indicates SE type is Invalid */
- NET_NFC_SE_TECH_A_ISODEP = 0x01, /*Type A /ISO DEP */
- NET_NFC_SE_TECH_B_NFCDEP = 0x02, /*Type B / NFC DEP */
- NET_NFC_SE_TECH_A_B_ISO_NFC_DEP = 0x03, /*Type B / NFC DEP */
- NET_NFC_SE_TECH_F = 0x04, /*Type F */
-} net_nfc_se_tech_protocol_type_e;
-
-typedef enum {
- NET_NFC_SE_INVALID = 0x00,
- /**< Indicates SE type is Invalid */
- NET_NFC_SE_SWITCH_ON = 0x01, /* Target On */
- NET_NFC_SE_SWITCH_OFF = 0x02, /*Target Off */
- NET_NFC_SE_SCREEN_OFF = 0x08,
- NET_NFC_SE_SCREEN_ON_LOCK = 0x10,
- NET_NFC_SE_SCREEN_ON_UNLOCK = 0x20,
-} net_nfc_se_power_state_type_e;
-
-typedef enum {
- NET_NFC_SIGN_TYPE_NO_SIGN = 0,
- NET_NFC_SIGN_TYPE_PKCS_1,
- NET_NFC_SIGN_TYPE_PKCS_1_V_1_5,
- NET_NFC_SIGN_TYPE_DSA,
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
- NET_NFC_SIGN_TYPE_ECDSA,
-#endif
- NET_NFC_MAX_SIGN_TYPE,
-} net_nfc_sign_type_t;
-
-typedef enum {
- NET_NFC_CERT_FORMAT_X_509 = 0,
- NET_NFC_CERT_FORMAT_X9_86,
- NET_NFC_MAX_CERT_FORMAT,
-} net_nfc_cert_format_t;
-
-typedef enum {
- NET_NFC_SNEP_GET = 1,
- NET_NFC_SNEP_PUT = 2,
-} net_nfc_snep_type_t;
-
-typedef enum {
- NET_NFC_LLCP_REGISTERED = -1,
- NET_NFC_LLCP_UNREGISTERED = -2,
- NET_NFC_LLCP_START = -3,
- NET_NFC_LLCP_STOP = -4,
-} net_nfc_llcp_state_t;
-
-typedef enum {
- NET_NFC_CARD_EMULATION_DISABLE = 0,
- NET_NFC_CARD_EMELATION_ENABLE
-} net_nfc_card_emulation_mode_t;
-
-typedef enum {
- NET_NFC_HCE_EVENT_DEACTIVATED = 0,
- NET_NFC_HCE_EVENT_ACTIVATED = 1,
- NET_NFC_HCE_EVENT_APDU_RECEIVED = 2,
-} net_nfc_hce_event_t;
-
-typedef enum {
- NET_NFC_CARD_EMULATION_CATEGORY_UNKNOWN = 0,
- NET_NFC_CARD_EMULATION_CATEGORY_PAYMENT = 1,
- NET_NFC_CARD_EMULATION_CATEGORY_OTHER = 2,
- NET_NFC_CARD_EMULATION_CATEGORY_MAX = 3,
-} net_nfc_card_emulation_category_t;
-
-typedef enum {
- NET_NFC_POLL_START = 0x01,
- NET_NFC_POLL_STOP,
-} net_nfc_detect_mode_e;
-
-/**
- This structure is just data, to express bytes array
- */
-typedef struct _data_s {
- uint8_t *buffer;
- uint32_t length;
-} data_s;
-
-typedef struct _net_nfc_data_t {
- uint32_t length;
- uint8_t buffer[0];
-} net_nfc_data_s;
-
-typedef enum _net_nfc_connection_type_e {
- NET_NFC_TAG_CONNECTION = 0x00,
- NET_NFC_P2P_CONNECTION_TARGET,
- NET_NFC_P2P_CONNECTION_INITIATOR,
- NET_NFC_SE_CONNECTION
-} net_nfc_connection_type_e;
-
-typedef struct _net_nfc_target_handle_s {
- uint32_t connection_id;
- net_nfc_connection_type_e connection_type;
- net_nfc_target_type_e target_type;
- /*++npp++ */
- llcp_app_protocol_e app_type;
- /*--npp--*/
-} net_nfc_target_handle_s;
-
-typedef struct _net_nfc_current_target_info_s {
- net_nfc_target_handle_s *handle;
- uint32_t devType;
- int number_of_keys;
- net_nfc_data_s target_info_values;
-} net_nfc_current_target_info_s;
-
-typedef struct _net_nfc_llcp_config_info_s {
- uint16_t miu; /** The remote Maximum Information Unit (NOTE: this is MIU, not MIUX !)*/
- uint16_t wks; /** The remote Well-Known Services*/
- uint8_t lto; /** The remote Link TimeOut (in 1/100s)*/
- uint8_t option; /** The remote options*/
-} net_nfc_llcp_config_info_s;
-
-typedef struct _net_nfc_llcp_socket_option_s {
- uint16_t miu; /** The remote Maximum Information Unit */
- uint8_t rw; /** The Receive Window size (4 bits)*/
- net_nfc_socket_type_e type;
-} net_nfc_llcp_socket_option_s;
-
-typedef struct _net_nfc_llcp_internal_socket_s {
- uint16_t miu; /** The remote Maximum Information Unit */
- uint8_t rw; /** The Receive Window size (4 bits)*/
- net_nfc_socket_type_e type;
- net_nfc_llcp_socket_t oal_socket;
- net_nfc_llcp_socket_t client_socket;
- sap_t sap;
- uint8_t *service_name;
- net_nfc_target_handle_s *device_id;
- net_nfc_llcp_socket_cb cb;
- bool close_requested;
- void *register_param; /* void param that has been registered in callback register time */
-} net_nfc_llcp_internal_socket_s;
-
-/**
- ndef_record_s structure has the NDEF record data. it is only a record not a message
- */
-typedef struct _record_s {
- uint8_t MB:1;
- uint8_t ME:1;
- uint8_t CF:1;
- uint8_t SR:1;
- uint8_t IL:1;
- uint8_t TNF:3;
- data_s type_s;
- data_s id_s;
- data_s payload_s;
- struct _record_s *next;
-} ndef_record_s;
-
-/**
- NDEF message it has record counts and records (linked listed form)
- */
-typedef struct _ndef_message_s {
- uint32_t recordCount;
- ndef_record_s *records; // linked list
-} ndef_message_s;
-
-/**
- Enum value to stop or start the discovery mode
- */
-
-#define NET_NFC_MAX_UID_LENGTH 0x0AU /**< Maximum UID length expected */
-#define NET_NFC_MAX_ATR_LENGTH 0x30U /**< Maximum ATR_RES (General Bytes) */
-#define NET_NFC_ATQA_LENGTH 0x02U /**< ATQA length */
-#define NET_NFC_ATQB_LENGTH 0x0BU /**< ATQB length */
-
-#define NET_NFC_PUPI_LENGTH 0x04U /**< PUPI length */
-#define NET_NFC_APP_DATA_B_LENGTH 0x04U /**< Application Data length for Type B */
-#define NET_NFC_PROT_INFO_B_LENGTH 0x03U /**< Protocol info length for Type B */
-
-#define NET_NFC_MAX_ATR_LENGTH 0x30U /**< Maximum ATR_RES (General Bytes) */
-#define NET_NFC_MAX_UID_LENGTH 0x0AU /**< Maximum UID length expected */
-#define NET_NFC_FEL_ID_LEN 0x08U /**< Felica current ID Length */
-#define NET_NFC_FEL_PM_LEN 0x08U /**< Felica current PM Length */
-#define NET_NFC_FEL_SYS_CODE_LEN 0x02U /**< Felica System Code Length */
-
-#define NET_NFC_15693_UID_LENGTH 0x08U /**< Length of the Inventory bytes for */
-
-typedef struct _net_nfc_tag_info_s {
- char *key;
- data_h value;
-} net_nfc_tag_info_s;
-
-typedef struct _net_nfc_target_info_s {
- net_nfc_target_handle_s *handle;
- net_nfc_target_type_e devType;
- uint8_t is_ndef_supported;
- uint8_t ndefCardState;
- uint32_t maxDataSize;
- uint32_t actualDataSize;
- int number_of_keys;
- net_nfc_tag_info_s *tag_info_list;
- char **keylist;
- data_s raw_data;
-} net_nfc_target_info_s;
-
-typedef struct _net_nfc_se_event_info_s {
- data_s aid;
- data_s param;
-} net_nfc_se_event_info_s;
-
-typedef struct _net_nfc_transceive_info_s {
- uint32_t dev_type;
- data_s trans_data;
-} net_nfc_transceive_info_s;
-
-typedef struct _net_nfc_connection_handover_info_s {
- net_nfc_conn_handover_carrier_type_e type;
- data_s data;
-} net_nfc_connection_handover_info_s;
-
-typedef enum _client_state_e {
- NET_NFC_CLIENT_INACTIVE_STATE = 0x00,
- NET_NFC_CLIENT_ACTIVE_STATE,
-} client_state_e;
-
-typedef enum _net_nfc_launch_popup_check_e {
- CHECK_FOREGROUND = 0x00,
- NO_CHECK_FOREGROUND,
-} net_nfc_launch_popup_check_e;
-
-typedef enum _net_nfc_launch_popup_state_e {
- NET_NFC_LAUNCH_APP_SELECT = 0x00,
- NET_NFC_NO_LAUNCH_APP_SELECT,
-} net_nfc_launch_popup_state_e;
-
-typedef enum _net_nfc_privilege_e {
- NET_NFC_PRIVILEGE_NFC = 0x00,
- NET_NFC_PRIVILEGE_NFC_ADMIN,
- NET_NFC_PRIVILEGE_NFC_TAG,
- NET_NFC_PRIVILEGE_NFC_P2P,
- NET_NFC_PRIVILEGE_NFC_CARD_EMUL
-} net_nfc_privilege_e;
-
-/* server state */
-#define NET_NFC_SERVER_IDLE 0
-#define NET_NFC_SERVER_DISCOVERY (1 << 1)
-#define NET_NFC_TAG_CONNECTED (1 << 2)
-#define NET_NFC_SE_CONNECTED (1 << 3)
-#define NET_NFC_SNEP_CLIENT_CONNECTED (1 << 4)
-#define NET_NFC_NPP_CLIENT_CONNECTED (1 << 5)
-#define NET_NFC_SNEP_SERVER_CONNECTED (1 << 6)
-#define NET_NFC_NPP_SERVER_CONNECTED (1 << 7)
-
-// these are messages for request
-#define NET_NFC_REQUEST_MSG_HEADER \
- /* DON'T MODIFY THIS CODE - BEGIN */ \
- uint32_t length; \
- uint32_t request_type; \
- uint32_t client_fd; \
- uint32_t flags; \
- void *user_param; \
- /* DON'T MODIFY THIS CODE - END */
-
-typedef struct _net_nfc_request_msg_t {
-NET_NFC_REQUEST_MSG_HEADER} net_nfc_request_msg_t;
-
-typedef struct _net_nfc_request_target_detected_t {
- NET_NFC_REQUEST_MSG_HEADER net_nfc_target_handle_s *handle;
- uint32_t devType;
- int number_of_keys;
- net_nfc_data_s target_info_values;
-} net_nfc_request_target_detected_t;
-
-typedef struct _net_nfc_request_se_event_t {
- NET_NFC_REQUEST_MSG_HEADER data_s aid;
- data_s param;
-} net_nfc_request_se_event_t;
-
-typedef struct _net_nfc_request_llcp_msg_t {
- NET_NFC_REQUEST_MSG_HEADER uint32_t result;
- net_nfc_llcp_socket_t llcp_socket;
-} net_nfc_request_llcp_msg_t;
-
-typedef struct _net_nfc_request_hce_apdu_t {
- NET_NFC_REQUEST_MSG_HEADER data_s apdu;
-} net_nfc_request_hce_apdu_t;
-
-typedef struct _net_nfc_request_listen_socket_t {
- NET_NFC_REQUEST_MSG_HEADER uint32_t result;
- net_nfc_target_handle_s *handle;
- net_nfc_llcp_socket_t client_socket;
- uint16_t miu; /** The remote Maximum Information Unit */
- uint8_t rw; /** The Receive Window size (4 bits)*/
- net_nfc_socket_type_e type;
- net_nfc_llcp_socket_t oal_socket;
- sap_t sap;
- void *trans_param;
- net_nfc_data_s service_name;
-} net_nfc_request_listen_socket_t;
-
-typedef struct _net_nfc_request_receive_socket_t {
- NET_NFC_REQUEST_MSG_HEADER uint32_t result;
- net_nfc_target_handle_s *handle;
- net_nfc_llcp_socket_t client_socket;
- net_nfc_llcp_socket_t oal_socket;
- size_t req_length;
- void *trans_param;
- net_nfc_data_s data;
-} net_nfc_request_receive_socket_t;
-
-typedef struct _net_nfc_request_receive_from_socket_t {
- NET_NFC_REQUEST_MSG_HEADER uint32_t result;
- net_nfc_target_handle_s *handle;
- net_nfc_llcp_socket_t client_socket;
- net_nfc_llcp_socket_t oal_socket;
- size_t req_length;
- sap_t sap;
- void *trans_param;
- net_nfc_data_s data;
-} net_nfc_request_receive_from_socket_t;
-
-// these are messages for response
-
-typedef void (*target_detection_listener_cb) (void *data, void *user_param);
-typedef void (*se_transaction_listener_cb) (void *data, void *user_param);
-typedef void (*llcp_event_listener_cb) (void *data, void *user_param);
-
-/*HCE CB*/
-typedef void (*hce_active_listener_cb) (void *user_param);
-typedef void (*hce_deactive_listener_cb) (void *user_param);
-typedef void (*hce_apdu_listener_cb) (void *data, void *user_param);
-
-typedef enum _llcp_event_e {
- LLCP_EVENT_SOCKET_ACCEPTED = 0x1,
- LLCP_EVENT_SOCKET_ERROR,
- LLCP_EVENT_DEACTIVATED,
-} llcp_event_e;
-
-typedef struct _net_nfc_stack_information_s {
- uint32_t net_nfc_supported_tagetType;
- uint32_t net_nfc_fw_version;
-} net_nfc_stack_information_s;
-
-typedef enum _net_nfc_discovery_mode_e {
- NET_NFC_DISCOVERY_MODE_STOP = 0x00,
- NET_NFC_DISCOVERY_MODE_CONFIG_POLLING = 0x01,
- NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING = 0x02,
- NET_NFC_DISCOVERY_MODE_CONFIG_P2P = 0x04,
- NET_NFC_DISCOVERY_MODE_CONFIG_ALL = NET_NFC_DISCOVERY_MODE_CONFIG_POLLING | NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING | NET_NFC_DISCOVERY_MODE_CONFIG_P2P,
- NET_NFC_DISCOVERY_MODE_CONFIG_DEFAULT = NET_NFC_DISCOVERY_MODE_CONFIG_POLLING | NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING,
- NET_NFC_DISCOVERY_MODE_CONFIG = NET_NFC_DISCOVERY_MODE_CONFIG_DEFAULT,
- NET_NFC_DISCOVERY_MODE_START_LISTENING = NET_NFC_DISCOVERY_MODE_CONFIG_LISTENING,
- NET_NFC_DISCOVERY_MODE_START_POLLING = NET_NFC_DISCOVERY_MODE_CONFIG_POLLING,
- NET_NFC_DISCOVERY_MODE_START_ALL = NET_NFC_DISCOVERY_MODE_CONFIG_ALL,
- NET_NFC_DISCOVERY_MODE_START_DEFAULT = NET_NFC_DISCOVERY_MODE_CONFIG_DEFAULT,
- NET_NFC_DISCOVERY_MODE_START = NET_NFC_DISCOVERY_MODE_START_DEFAULT,
- NET_NFC_DISCOVERY_MODE_RESUME = NET_NFC_DISCOVERY_MODE_START
-} net_nfc_discovery_mode_e;
-
-typedef enum _net_nfc_secure_element_policy_e {
- SECURE_ELEMENT_POLICY_INVALID = 0x00,
- SECURE_ELEMENT_POLICY_UICC_ON = 0x01,
- SECURE_ELEMENT_POLICY_UICC_OFF = 0x02,
- SECURE_ELEMENT_POLICY_ESE_ON = 0x03,
- SECURE_ELEMENT_POLICY_ESE_OFF = 0x04,
- SECURE_ELEMENT_POLICY_HCE_ON = 0x05,
- SECURE_ELEMENT_POLICY_HCE_OFF = 0x06,
- SECURE_ELEMENT_POLICY_SDCARD_ON = 0x07,
- SECURE_ELEMENT_POLICY_SDCARD_OFF = 0x08,
-} net_nfc_secure_element_policy_e;
-
-typedef enum _net_nfc_secure_element_type_e {
- SECURE_ELEMENT_TYPE_INVALID = 0x00, /**< Indicates SE type is Invalid */
- SECURE_ELEMENT_TYPE_ESE = 0x01, /**< Indicates SE type is SmartMX */
- SECURE_ELEMENT_TYPE_UICC = 0x02, /**<Indicates SE type is UICC */
- SECURE_ELEMENT_TYPE_SDCARD = 0x03, /**<Indicates SE type is UICC */
- SECURE_ELEMENT_TYPE_HCE = 0x04, /**<Indicates SE type is HCE */
- SECURE_ELEMENT_TYPE_UNKNOWN = 0x05 /**< Indicates SE type is Unknown */
-} net_nfc_secure_element_type_e;
-
-typedef enum _net_nfc_secure_element_state_e {
- SECURE_ELEMENT_INACTIVE_STATE = 0x00, /**< state of the SE is In active*/
- SECURE_ELEMENT_ACTIVE_STATE = 0x01, /**< state of the SE is active */
-} net_nfc_secure_element_state_e;
-
-typedef enum _net_nfc_wallet_mode_e {
- NET_NFC_WALLET_MODE_MANUAL = 0x00,
- NET_NFC_WALLET_MODE_AUTOMATIC = 0x01,
- NET_NFC_WALLET_MODE_UICC = 0x02,
- NET_NFC_WALLET_MODE_ESE = 0x03,
- NET_NFC_WALLET_MODE_HCE = 0x04,
-} net_nfc_wallet_mode_e;
-
-typedef struct _secure_element_info_s {
- net_nfc_target_handle_s *handle;
- net_nfc_secure_element_type_e secure_element_type;
- net_nfc_secure_element_state_e secure_element_state;
-
-} net_nfc_secure_element_info_s;
-
-typedef enum _net_nfc_secure_element_mode_e {
- SECURE_ELEMENT_WIRED_MODE = 0x00, /**< Enables Wired Mode communication.This mode shall be applied to */
- SECURE_ELEMENT_VIRTUAL_MODE, /**< Enables Virtual Mode communication.This can be applied to UICC as well as SmartMX*/
- SECURE_ELEMENT_OFF_MODE /**< Inactivate SE.This means,put SE in in-active state */
-} net_nfc_secure_element_mode_e;
-
-typedef enum _net_nfc_message_service_e {
- NET_NFC_MESSAGE_SERVICE_RESET = 2000,
- NET_NFC_MESSAGE_SERVICE_INIT,
- NET_NFC_MESSAGE_SERVICE_ACTIVATE,
- NET_NFC_MESSAGE_SERVICE_DEACTIVATE,
- NET_NFC_MESSAGE_SERVICE_DEINIT,
- NET_NFC_MESSAGE_SERVICE_STANDALONE_TARGET_DETECTED,
- NET_NFC_MESSAGE_SERVICE_SE,
- NET_NFC_MESSAGE_SERVICE_TERMINATION,
- NET_NFC_MESSAGE_SERVICE_SLAVE_TARGET_DETECTED,
- NET_NFC_MESSAGE_SERVICE_SLAVE_ESE_DETECTED,
- NET_NFC_MESSAGE_SERVICE_RESTART_POLLING_LOOP,
- NET_NFC_MESSAGE_SERVICE_LLCP_LISTEN,
- NET_NFC_MESSAGE_SERVICE_LLCP_INCOMING,
- NET_NFC_MESSAGE_SERVICE_LLCP_ACCEPT,
- NET_NFC_MESSAGE_SERVICE_LLCP_REJECT,
- NET_NFC_MESSAGE_SERVICE_LLCP_SEND,
- NET_NFC_MESSAGE_SERVICE_LLCP_SEND_TO,
- NET_NFC_MESSAGE_SERVICE_LLCP_RECEIVE,
- NET_NFC_MESSAGE_SERVICE_LLCP_RECEIVE_FROM,
- NET_NFC_MESSAGE_SERVICE_LLCP_CONNECT,
- NET_NFC_MESSAGE_SERVICE_LLCP_CONNECT_SAP,
- NET_NFC_MESSAGE_SERVICE_LLCP_DISCONNECT,
- NET_NFC_MESSAGE_SERVICE_LLCP_DEACTIVATED,
- NET_NFC_MESSAGE_SERVICE_LLCP_SOCKET_ERROR,
- NET_NFC_MESSAGE_SERVICE_LLCP_SOCKET_ACCEPTED_ERROR,
- NET_NFC_MESSAGE_SERVICE_CHANGE_CLIENT_STATE,
- NET_NFC_MESSAGE_SERVICE_WATCH_DOG,
- NET_NFC_MESSAGE_SERVICE_CLEANER,
- NET_NFC_MESSAGE_SERVICE_SET_LAUNCH_STATE,
-} net_nfc_message_service_e;
-
-typedef enum _net_nfc_se_command_e {
- NET_NFC_SE_CMD_UICC_ON = 0,
- NET_NFC_SE_CMD_ESE_ON,
- NET_NFC_SE_CMD_ALL_OFF,
- NET_NFC_SE_CMD_ALL_ON,
-} net_nfc_se_command_e;
-
-/* connection handover info */
-
-typedef enum {
- NET_NFC_CONN_HANDOVER_ERR_REASON_RESERVED = 0x00,
- NET_NFC_CONN_HANDOVER_ERR_REASON_TEMP_MEM_CONSTRAINT,
- NET_NFC_CONN_HANDOVER_ERR_REASON_PERM_MEM_CONSTRAINT,
- NET_NFC_CONN_HANDOVER_ERR_REASON_CARRIER_SPECIFIC_CONSTRAINT,
-} net_nfc_conn_handover_error_reason_e;
-
-#define SMART_POSTER_RECORD_TYPE "Sp"
-#define URI_RECORD_TYPE "U"
-#define TEXT_RECORD_TYPE "T"
-#define GC_RECORD_TYPE "Gc"
-
-#define URI_SCHEM_FILE "file://"
-
-typedef void (*net_nfc_service_llcp_cb) (net_nfc_llcp_socket_t socket, net_nfc_error_e result, data_s * data, void *extra, void *user_param);
-
-typedef struct _net_nfc_llcp_param_t {
- net_nfc_llcp_socket_t socket;
- net_nfc_service_llcp_cb cb;
- data_s data;
- void *user_param;
-} net_nfc_llcp_param_t;
-
-typedef enum {
- NET_NFC_SCREEN_INVALID = 0x00,
- NET_NFC_SCREEN_OFF = 0x01,
- NET_NFC_SCREEN_ON_LOCK = 0x02,
- NET_NFC_SCREEN_ON_UNLOCK = 0x03,
-} net_nfc_screen_state_type_e;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_NFC__ */
-
extern "C" {
#endif
+/**
+ * @addtogroup HALAPI_HAL_NFC_MODULE
+ * @{
+ */
+
+/**
+ * @brief Gets the nfc backend
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_nfc_put_backend()
+ */
int hal_nfc_get_backend(void);
+
+/**
+ * @brief Puts the nfc backend
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_nfc_get_backend()
+ */
int hal_nfc_put_backend(void);
-bool hal_nfc_start(net_nfc_error_e *result);
-bool hal_nfc_stop(void);
-
-bool hal_nfc_register_listener(target_detection_listener_cb target_detection_listener, se_transaction_listener_cb se_transaction_listener, llcp_event_listener_cb llcp_event_listener, hce_apdu_listener_cb hce_apdu_listener, net_nfc_error_e * result);
-bool hal_nfc_unregister_listener(void);
-bool hal_nfc_support_nfc(net_nfc_error_e * result);
-bool hal_nfc_get_firmware_version(data_s ** data, net_nfc_error_e * result);
-bool hal_nfc_check_firmware_version(net_nfc_error_e * result);
-bool hal_nfc_update_firmware(net_nfc_error_e * result);
-bool hal_nfc_get_stack_information(net_nfc_stack_information_s * stack_info, net_nfc_error_e * result);
-bool hal_nfc_configure_discovery(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config, net_nfc_error_e * result);
-bool hal_nfc_check_target_presence(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_connect(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_disconnect(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_check_ndef(net_nfc_target_handle_s * handle, uint8_t * ndef_card_state, int *max_data_size, int *real_data_size, net_nfc_error_e * result);
-bool hal_nfc_read_ndef(net_nfc_target_handle_s * handle, data_s ** data, net_nfc_error_e * result);
-bool hal_nfc_write_ndef(net_nfc_target_handle_s * handle, data_s * data, net_nfc_error_e * result);
-bool hal_nfc_make_read_only_ndef(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_format_ndef(net_nfc_target_handle_s * handle, data_s * secure_key, net_nfc_error_e * result);
-bool hal_nfc_transceive(net_nfc_target_handle_s * handle, net_nfc_transceive_info_s * info, data_s ** data, net_nfc_error_e * result);
-bool hal_nfc_exception_handler(void);
-bool hal_nfc_is_ready(net_nfc_error_e * result);
-
-/* llcp api */
-bool hal_nfc_llcp_config(net_nfc_llcp_config_info_s * config, net_nfc_error_e * result);
-bool hal_nfc_llcp_check_llcp(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_llcp_activate_llcp(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_llcp_create_socket(net_nfc_llcp_socket_t * socket, net_nfc_socket_type_e socketType, uint16_t miu, uint8_t rw, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e * result);
-bool hal_nfc_llcp_listen(net_nfc_target_handle_s * handle, uint8_t * service_access_name, net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_accept(net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_connect_by_url(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t * service_access_name, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_connect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e * result,void *user_param);
-bool hal_nfc_llcp_disconnect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_socket_close(net_nfc_llcp_socket_t socket, net_nfc_error_e * result);
-bool hal_nfc_llcp_recv(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * max_len, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_send(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_recv_from(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result,void *user_param);
-bool hal_nfc_llcp_send_to(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, uint8_t service_access_point, net_nfc_error_e * result, void *user_param);
-bool hal_nfc_llcp_reject(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_error_e * result);
-bool hal_nfc_llcp_get_remote_config(net_nfc_target_handle_s * handle, net_nfc_llcp_config_info_s * config, net_nfc_error_e * result);
-bool hal_nfc_llcp_get_remote_socket_info(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s * option, net_nfc_error_e * result);
-
-/* secure element api */
-bool hal_nfc_secure_element_open(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s ** handle, net_nfc_error_e * result);
-bool hal_nfc_secure_element_get_atr(net_nfc_target_handle_s * handle, data_s ** atr, net_nfc_error_e * result);
-bool hal_nfc_secure_element_send_apdu(net_nfc_target_handle_s * handle, data_s * command, data_s ** response, net_nfc_error_e * result);
-bool hal_nfc_secure_element_close(net_nfc_target_handle_s * handle, net_nfc_error_e * result);
-bool hal_nfc_get_secure_element_list(net_nfc_secure_element_info_s * list, int *count, net_nfc_error_e * result);
-bool hal_nfc_set_secure_element_mode(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode, net_nfc_error_e * result);
-
-/* test api */
-bool hal_nfc_sim_test(net_nfc_error_e * result);
-bool hal_nfc_prbs_test(net_nfc_error_e * result, uint32_t tech, uint32_t rate);
-bool hal_nfc_test_mode_on(net_nfc_error_e * result);
-bool hal_nfc_test_mode_off(net_nfc_error_e * result);
-bool hal_nfc_eedata_register_set(net_nfc_error_e * result, uint32_t mode, uint32_t reg_id, data_s * data);
-bool hal_nfc_ese_test(net_nfc_error_e * result);
-bool hal_nfc_test_set_se_tech_type(net_nfc_error_e * result, net_nfc_se_type_e type, uint32_t tech);
-
-/* hce api */
-bool hal_nfc_hce_response_apdu(net_nfc_target_handle_s * handle, data_s * response, net_nfc_error_e * result);
-bool hal_nfc_secure_element_route_aid(data_s * aid, net_nfc_se_type_e se_type, int power, net_nfc_error_e * result);
-bool hal_nfc_secure_element_unroute_aid(data_s * aid, net_nfc_error_e * result);
-bool hal_nfc_secure_element_commit_routing(net_nfc_error_e * result);
-bool hal_nfc_secure_element_set_default_route(net_nfc_se_type_e switch_on, net_nfc_se_type_e switch_off, net_nfc_se_type_e battery_off, net_nfc_error_e * result);
-bool hal_nfc_secure_element_clear_aid_table(net_nfc_error_e * result);
-bool hal_nfc_secure_element_get_aid_table_size(int *AIDTableSize, net_nfc_error_e * result);
-bool hal_nfc_secure_element_set_route_entry(net_nfc_se_entry_type_e type, net_nfc_se_tech_protocol_type_e value, net_nfc_se_type_e route, int power, net_nfc_error_e * result);
-bool hal_nfc_secure_element_clear_routing_entry(net_nfc_se_entry_type_e type, net_nfc_error_e * result);
-bool hal_nfc_secure_element_set_listen_tech_mask(net_nfc_se_tech_protocol_type_e screen_state, net_nfc_error_e * result);
-bool hal_nfc_set_screen_state(net_nfc_screen_state_type_e screen_state, net_nfc_error_e * result);
+/**
+ * @brief Start the nfc backend
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_nfc_stop()
+ */
+int hal_nfc_start(void);
+
+/**
+ * @brief Stop the nfc backend
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @see hal_nfc_start()
+ */
+int hal_nfc_stop(void);
+
+/**
+ * @brief Registers listeners for specific events
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_register_listener(net_nfc_target_detection_listener_cb target_detection_listener,
+ net_nfc_se_transaction_listener_cb se_transaction_listener,
+ net_nfc_llcp_event_listener_cb llcp_event_listener,
+ net_nfc_hce_apdu_listener_cb hce_apdu_listener);
+
+/**
+ * @brief Unregisters the registered listener
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_unregister_listener(void);
+
+/**
+ * @brief Checks whether the NFC module is supported
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_support_nfc(void);
+
+/**
+ * @brief Gets the firmware version of the NFC module
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_get_firmware_version(net_nfc_data_s ** data);
+
+/**
+ * @brief Checks the firmware version of the NFC module
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_check_firmware_version(void);
+
+/**
+ * @brief Updates the firmware of the NFC module
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_update_firmware(void);
+
+/**
+ * @brief Gets the stack information of the NFC module
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_get_stack_information(net_nfc_stack_information_s * stack_info);
+
+/**
+ * @brief Configures the discovery mode and settings
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_configure_discovery(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config);
+
+/**
+ * @brief Checks whether a target is present
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_check_target_presence(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Connects to a target
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_connect(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Disconnects from a target
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_disconnect(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Checks whether an NDEF message is supported
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_check_ndef(net_nfc_target_handle_s * handle, uint8_t * ndef_card_state, int *max_data_size, int *real_data_size);
+
+/**
+ * @brief Reads an NDEF message
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_read_ndef(net_nfc_target_handle_s * handle, net_nfc_data_s ** data);
+
+/**
+ * @brief Writes an NDEF message
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_write_ndef(net_nfc_target_handle_s * handle, net_nfc_data_s * data);
+
+/**
+ * @brief Makes an NDEF message read-only
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_make_read_only_ndef(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Formats an NDEF message
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_format_ndef(net_nfc_target_handle_s * handle, net_nfc_data_s * secure_key);
+
+/**
+ * @brief Transceives data with a target
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_transceive(net_nfc_target_handle_s * handle, net_nfc_transceive_info_s * info, net_nfc_data_s ** data);
+
+/**
+ * @brief Handles exceptions
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_exception_handler(void);
+
+/**
+ * @brief Checks whether the NFC module is ready
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_is_ready(void);
+
+/**
+ * @brief Configures LLCP settings
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_config(net_nfc_llcp_config_info_s * config);
+
+/**
+ * @brief Checks whether LLCP is supported
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_check_llcp(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Activates LLCP
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_activate_llcp(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Creates a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_create_socket(net_nfc_llcp_socket_t * socket, net_nfc_socket_type_e type, uint16_t miu, uint8_t rw, void *user_param);
+
+/**
+ * @brief Binds a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point);
+
+/**
+ * @brief Listens on a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_listen(net_nfc_target_handle_s * handle, uint8_t * service_access_name, net_nfc_llcp_socket_t socket, void *user_param);
+
+/**
+ * @brief Accepts a connection request
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_accept(net_nfc_llcp_socket_t socket, void *user_param);
+
+/**
+ * @brief Connects using a URL
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_connect_by_url(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t * service_access_name, void *user_param);
+
+/**
+ * @brief Connects using a service access point
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_connect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point,void *user_param);
+
+/**
+ * @brief Disconnects from a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_disconnect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, void *user_param);
+
+/**
+ * @brief Closes a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_socket_close(net_nfc_llcp_socket_t socket);
+
+/**
+ * @brief Receives data on a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_recv(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * max_len, void *user_param);
+
+/**
+ * @brief Sends data on a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_send(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param);
+
+/**
+ * @brief Receives data on a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_recv_from(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data,void *user_param);
+
+/**
+ * @brief Sends data on a socket
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_send_to(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, uint8_t service_access_point, void *user_param);
+
+/**
+ * @brief Rejects a connection request
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_reject(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket);
+
+/**
+ * @brief Gets the remote LLCP configuration
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_get_remote_config(net_nfc_target_handle_s * handle, net_nfc_llcp_config_info_s * config);
+
+/**
+ * @brief Gets the remote socket information
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_llcp_get_remote_socket_info(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s * option);
+
+/**
+ * @brief Opens a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_open(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s ** handle);
+
+/**
+ * @brief Gets the ATR information of a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_get_atr(net_nfc_target_handle_s * handle, net_nfc_data_s ** atr);
+
+/**
+ * @brief Sends an APDU command to a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_send_apdu(net_nfc_target_handle_s * handle, net_nfc_data_s * command, net_nfc_data_s ** response);
+
+/**
+ * @brief Closes a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_close(net_nfc_target_handle_s * handle);
+
+/**
+ * @brief Gets the list of secure elements
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_get_secure_element_list(net_nfc_secure_element_info_s * list, int *count);
+
+/**
+ * @brief Sets the mode of a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_set_secure_element_mode(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode);
+
+/**
+ * @brief Enables test mode
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_test_mode_on(void);
+
+/**
+ * @brief Disables test mode
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_test_mode_off(void);
+
+/**
+ * @brief Sends a response APDU in HCE mode
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_hce_response_apdu(net_nfc_target_handle_s * handle, net_nfc_data_s * response);
+
+/**
+ * @brief Routes an AID to a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_route_aid(net_nfc_data_s * aid, net_nfc_se_type_e se_type, int power);
+
+/**
+ * @brief Unroutes an AID from a secure element
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_unroute_aid(net_nfc_data_s * aid);
+
+/**
+ * @brief Commits the routing table
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_commit_routing(void);
+
+/**
+ * @brief Sets the default route for different states
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_set_default_route(net_nfc_se_type_e switch_on, net_nfc_se_type_e switch_off, net_nfc_se_type_e battery_off);
+
+/**
+ * @brief Clears the AID table
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_clear_aid_table(void);
+
+/**
+ * @brief Gets the size of the AID table
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_get_aid_table_size(int *table_size);
+
+/**
+ * @brief Sets a routing entry
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_set_route_entry(net_nfc_se_entry_type_e type, net_nfc_se_tech_protocol_type_e value, net_nfc_se_type_e route, int power);
+
+/**
+ * @brief Clears a routing entry
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_clear_routing_entry(net_nfc_se_entry_type_e type);
+
+/**
+ * @brief Sets the technology mask for listening
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_secure_element_set_listen_tech_mask(net_nfc_se_tech_protocol_type_e screen_state);
+
+/**
+ * @brief Sets the screen state
+ * @since HAL_MODULE_NFC 1.0
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int hal_nfc_set_screen_state(net_nfc_screen_state_type_e screen_state);
#ifdef __cplusplus
}
}
EXPORT
-bool hal_nfc_start(net_nfc_error_e *result)
+int hal_nfc_start(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->start)
return -ENOTSUP;
- return g_nfc_funcs->start(result);
+ return g_nfc_funcs->start();
}
EXPORT
-bool hal_nfc_stop(void)
+int hal_nfc_stop(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
}
EXPORT
-bool hal_nfc_register_listener(target_detection_listener_cb target_detection_listener, se_transaction_listener_cb se_transaction_listener, llcp_event_listener_cb llcp_event_listener, hce_apdu_listener_cb hce_apdu_listener, net_nfc_error_e * result)
+int hal_nfc_register_listener(net_nfc_target_detection_listener_cb target_detection_listener,
+ net_nfc_se_transaction_listener_cb se_transaction_listener,
+ net_nfc_llcp_event_listener_cb llcp_event_listener,
+ net_nfc_hce_apdu_listener_cb hce_apdu_listener)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->register_listener)
return -ENOTSUP;
- return g_nfc_funcs->register_listener(target_detection_listener, se_transaction_listener, llcp_event_listener, hce_apdu_listener, result);
+ return g_nfc_funcs->register_listener(target_detection_listener, se_transaction_listener, llcp_event_listener, hce_apdu_listener);
}
EXPORT
-bool hal_nfc_unregister_listener(void)
+int hal_nfc_unregister_listener(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
}
EXPORT
-bool hal_nfc_get_firmware_version(data_s ** data, net_nfc_error_e * result)
+int hal_nfc_get_firmware_version(net_nfc_data_s ** data)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->get_firmware_version)
return -ENOTSUP;
- return g_nfc_funcs->get_firmware_version(data, result);
+ return g_nfc_funcs->get_firmware_version(data);
}
EXPORT
-bool hal_nfc_support_nfc(net_nfc_error_e * result)
+int hal_nfc_support_nfc(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->support_nfc)
return -ENOTSUP;
- return g_nfc_funcs->support_nfc(result);
+ return g_nfc_funcs->support_nfc();
}
EXPORT
-bool hal_nfc_check_firmware_version(net_nfc_error_e * result)
+int hal_nfc_check_firmware_version(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->check_firmware_version)
return -ENOTSUP;
- return g_nfc_funcs->check_firmware_version(result);
+ return g_nfc_funcs->check_firmware_version();
}
EXPORT
-bool hal_nfc_update_firmware(net_nfc_error_e * result)
+int hal_nfc_update_firmware(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->update_firmware)
return -ENOTSUP;
- return g_nfc_funcs->update_firmware(result);
+ return g_nfc_funcs->update_firmware();
}
EXPORT
-bool hal_nfc_get_stack_information(net_nfc_stack_information_s * stack_info, net_nfc_error_e * result)
+int hal_nfc_get_stack_information(net_nfc_stack_information_s * stack_info)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->get_stack_information)
return -ENOTSUP;
- return g_nfc_funcs->get_stack_information(stack_info, result);
+ return g_nfc_funcs->get_stack_information(stack_info);
}
EXPORT
-bool hal_nfc_configure_discovery(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config, net_nfc_error_e * result)
+int hal_nfc_configure_discovery(net_nfc_discovery_mode_e mode, net_nfc_event_filter_e config)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->configure_discovery)
return -ENOTSUP;
- return g_nfc_funcs->configure_discovery(mode, config, result);
+ return g_nfc_funcs->configure_discovery(mode, config);
}
EXPORT
-bool hal_nfc_check_target_presence(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_check_target_presence(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->check_target_presence)
return -ENOTSUP;
- return g_nfc_funcs->check_target_presence(handle, result);
+ return g_nfc_funcs->check_target_presence(handle);
}
EXPORT
-bool hal_nfc_connect(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_connect(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->connect)
return -ENOTSUP;
- return g_nfc_funcs->connect(handle, result);
+ return g_nfc_funcs->connect(handle);
}
EXPORT
-bool hal_nfc_disconnect(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_disconnect(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->disconnect)
return -ENOTSUP;
- return g_nfc_funcs->disconnect(handle, result);
+ return g_nfc_funcs->disconnect(handle);
}
EXPORT
-bool hal_nfc_check_ndef(net_nfc_target_handle_s * handle, uint8_t * ndef_card_state, int *max_data_size, int *real_data_size, net_nfc_error_e * result)
+int hal_nfc_check_ndef(net_nfc_target_handle_s * handle, uint8_t * ndef_card_state, int *max_data_size, int *real_data_size)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->check_ndef)
return -ENOTSUP;
- return g_nfc_funcs->check_ndef(handle, ndef_card_state, max_data_size, real_data_size, result);
+ return g_nfc_funcs->check_ndef(handle, ndef_card_state, max_data_size, real_data_size);
}
EXPORT
-bool hal_nfc_read_ndef(net_nfc_target_handle_s * handle, data_s ** data, net_nfc_error_e * result)
+int hal_nfc_read_ndef(net_nfc_target_handle_s * handle, net_nfc_data_s ** data)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->read_ndef)
return -ENOTSUP;
- return g_nfc_funcs->read_ndef(handle, data, result);
+ return g_nfc_funcs->read_ndef(handle, data);
}
EXPORT
-bool hal_nfc_write_ndef(net_nfc_target_handle_s * handle, data_s * data, net_nfc_error_e * result)
+int hal_nfc_write_ndef(net_nfc_target_handle_s * handle, net_nfc_data_s * data)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->write_ndef)
return -ENOTSUP;
- return g_nfc_funcs->write_ndef(handle, data, result);
+ return g_nfc_funcs->write_ndef(handle, data);
}
EXPORT
-bool hal_nfc_make_read_only_ndef(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_make_read_only_ndef(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->make_read_only_ndef)
return -ENOTSUP;
- return g_nfc_funcs->make_read_only_ndef(handle, result);
+ return g_nfc_funcs->make_read_only_ndef(handle);
}
EXPORT
-bool hal_nfc_format_ndef(net_nfc_target_handle_s * handle, data_s * secure_key, net_nfc_error_e * result)
+int hal_nfc_format_ndef(net_nfc_target_handle_s * handle, net_nfc_data_s * secure_key)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->format_ndef)
return -ENOTSUP;
- return g_nfc_funcs->format_ndef(handle, secure_key, result);
+ return g_nfc_funcs->format_ndef(handle, secure_key);
}
EXPORT
-bool hal_nfc_transceive(net_nfc_target_handle_s * handle, net_nfc_transceive_info_s * info, data_s ** data, net_nfc_error_e * result)
+int hal_nfc_transceive(net_nfc_target_handle_s * handle, net_nfc_transceive_info_s * info, net_nfc_data_s ** data)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->transceive)
return -ENOTSUP;
- return g_nfc_funcs->transceive(handle, info, data, result);
+ return g_nfc_funcs->transceive(handle, info, data);
}
EXPORT
-bool hal_nfc_exception_handler(void)
+int hal_nfc_exception_handler(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
}
EXPORT
-bool hal_nfc_is_ready(net_nfc_error_e * result)
+int hal_nfc_is_ready(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->is_ready)
return -ENOTSUP;
- return g_nfc_funcs->is_ready(result);
+ return g_nfc_funcs->is_ready();
}
/* llcp api */
EXPORT
-bool hal_nfc_llcp_config(net_nfc_llcp_config_info_s * config, net_nfc_error_e * result)
+int hal_nfc_llcp_config(net_nfc_llcp_config_info_s * config)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_config)
return -ENOTSUP;
- return g_nfc_funcs->llcp_config(config, result);
+ return g_nfc_funcs->llcp_config(config);
}
EXPORT
-bool hal_nfc_llcp_check_llcp(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_llcp_check_llcp(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_check_llcp)
return -ENOTSUP;
- return g_nfc_funcs->llcp_check_llcp(handle, result);
+ return g_nfc_funcs->llcp_check_llcp(handle);
}
EXPORT
-bool hal_nfc_llcp_activate_llcp(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_llcp_activate_llcp(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_activate_llcp)
return -ENOTSUP;
- return g_nfc_funcs->llcp_activate_llcp(handle, result);
+ return g_nfc_funcs->llcp_activate_llcp(handle);
}
EXPORT
-bool hal_nfc_llcp_create_socket(net_nfc_llcp_socket_t * socket, net_nfc_socket_type_e socketType, uint16_t miu, uint8_t rw, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_create_socket(net_nfc_llcp_socket_t * socket, net_nfc_socket_type_e type, uint16_t miu, uint8_t rw, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_create_socket)
return -ENOTSUP;
- return g_nfc_funcs->llcp_create_socket(socket, socketType, miu, rw, result, user_param);
+ return g_nfc_funcs->llcp_create_socket(socket, type, miu, rw, user_param);
}
EXPORT
-bool hal_nfc_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e * result)
+int hal_nfc_llcp_bind(net_nfc_llcp_socket_t socket, uint8_t service_access_point)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_bind)
return -ENOTSUP;
- return g_nfc_funcs->llcp_bind(socket, service_access_point, result);
+ return g_nfc_funcs->llcp_bind(socket, service_access_point);
}
EXPORT
-bool hal_nfc_llcp_listen(net_nfc_target_handle_s * handle, uint8_t * service_access_name, net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_listen(net_nfc_target_handle_s * handle, uint8_t * service_access_name, net_nfc_llcp_socket_t socket, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_listen)
return -ENOTSUP;
- return g_nfc_funcs->llcp_listen(handle, service_access_name, socket, result, user_param);
+ return g_nfc_funcs->llcp_listen(handle, service_access_name, socket, user_param);
}
EXPORT
-bool hal_nfc_llcp_accept(net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_accept(net_nfc_llcp_socket_t socket, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_accept)
return -ENOTSUP;
- return g_nfc_funcs->llcp_accept(socket, result, user_param);
+ return g_nfc_funcs->llcp_accept(socket, user_param);
}
EXPORT
-bool hal_nfc_llcp_connect_by_url(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t * service_access_name, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_connect_by_url(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t * service_access_name, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_connect_by_url)
return -ENOTSUP;
- return g_nfc_funcs->llcp_connect_by_url(handle, socket, service_access_name, result, user_param);
+ return g_nfc_funcs->llcp_connect_by_url(handle, socket, service_access_name, user_param);
}
EXPORT
-bool hal_nfc_llcp_connect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_connect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, uint8_t service_access_point, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_connect)
return -ENOTSUP;
- return g_nfc_funcs->llcp_connect(handle, socket, service_access_point, result, user_param);
+ return g_nfc_funcs->llcp_connect(handle, socket, service_access_point, user_param);
}
EXPORT
-bool hal_nfc_llcp_disconnect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_disconnect(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_disconnect)
return -ENOTSUP;
- return g_nfc_funcs->llcp_disconnect(handle, socket, result, user_param);
+ return g_nfc_funcs->llcp_disconnect(handle, socket, user_param);
}
EXPORT
-bool hal_nfc_llcp_socket_close(net_nfc_llcp_socket_t socket, net_nfc_error_e * result)
+int hal_nfc_llcp_socket_close(net_nfc_llcp_socket_t socket)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_socket_close)
return -ENOTSUP;
- return g_nfc_funcs->llcp_socket_close(socket, result);
+ return g_nfc_funcs->llcp_socket_close(socket);
}
EXPORT
-bool hal_nfc_llcp_recv(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_recv(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_recv)
return -ENOTSUP;
- return g_nfc_funcs->llcp_recv(handle, socket, data, result, user_param);
+ return g_nfc_funcs->llcp_recv(handle, socket, data, user_param);
}
EXPORT
-bool hal_nfc_llcp_send(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_send(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_send)
return -ENOTSUP;
- return g_nfc_funcs->llcp_send(handle, socket, data, result, user_param);
+ return g_nfc_funcs->llcp_send(handle, socket, data, user_param);
}
EXPORT
-bool hal_nfc_llcp_recv_from(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_recv_from(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_recv_from)
return -ENOTSUP;
- return g_nfc_funcs->llcp_recv_from(handle, socket, data, result, user_param);
+ return g_nfc_funcs->llcp_recv_from(handle, socket, data, user_param);
}
EXPORT
-bool hal_nfc_llcp_send_to(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, data_s * data, uint8_t service_access_point, net_nfc_error_e * result, void *user_param)
+int hal_nfc_llcp_send_to(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_data_s * data, uint8_t service_access_point, void *user_param)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_send_to)
return -ENOTSUP;
- return g_nfc_funcs->llcp_send_to(handle, socket, data, service_access_point, result, user_param);
+ return g_nfc_funcs->llcp_send_to(handle, socket, data, service_access_point, user_param);
}
EXPORT
-bool hal_nfc_llcp_reject(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_error_e * result)
+int hal_nfc_llcp_reject(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_reject)
return -ENOTSUP;
- return g_nfc_funcs->llcp_reject(handle, socket, result);
+ return g_nfc_funcs->llcp_reject(handle, socket);
}
EXPORT
-bool hal_nfc_llcp_get_remote_config(net_nfc_target_handle_s * handle, net_nfc_llcp_config_info_s * config, net_nfc_error_e * result)
+int hal_nfc_llcp_get_remote_config(net_nfc_target_handle_s * handle, net_nfc_llcp_config_info_s * config)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_get_remote_config)
return -ENOTSUP;
- return g_nfc_funcs->llcp_get_remote_config(handle, config, result);
+ return g_nfc_funcs->llcp_get_remote_config(handle, config);
}
EXPORT
-bool hal_nfc_llcp_get_remote_socket_info(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s * option, net_nfc_error_e * result)
+int hal_nfc_llcp_get_remote_socket_info(net_nfc_target_handle_s * handle, net_nfc_llcp_socket_t socket, net_nfc_llcp_socket_option_s * option)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->llcp_get_remote_socket_info)
return -ENOTSUP;
- return g_nfc_funcs->llcp_get_remote_socket_info(handle, socket, option, result);
+ return g_nfc_funcs->llcp_get_remote_socket_info(handle, socket, option);
}
/* secure element api */
EXPORT
-bool hal_nfc_secure_element_open(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s ** handle, net_nfc_error_e * result)
+int hal_nfc_secure_element_open(net_nfc_secure_element_type_e element_type, net_nfc_target_handle_s ** handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_open)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_open(element_type, handle, result);
+ return g_nfc_funcs->secure_element_open(element_type, handle);
}
EXPORT
-bool hal_nfc_secure_element_get_atr(net_nfc_target_handle_s * handle, data_s ** atr, net_nfc_error_e * result)
+int hal_nfc_secure_element_get_atr(net_nfc_target_handle_s * handle, net_nfc_data_s ** atr)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_get_atr)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_get_atr(handle, atr, result);
+ return g_nfc_funcs->secure_element_get_atr(handle, atr);
}
EXPORT
-bool hal_nfc_secure_element_send_apdu(net_nfc_target_handle_s * handle, data_s * command, data_s ** response, net_nfc_error_e * result)
+int hal_nfc_secure_element_send_apdu(net_nfc_target_handle_s * handle, net_nfc_data_s * command, net_nfc_data_s ** response)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_send_apdu)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_send_apdu(handle, command, response, result);
+ return g_nfc_funcs->secure_element_send_apdu(handle, command, response);
}
EXPORT
-bool hal_nfc_secure_element_close(net_nfc_target_handle_s * handle, net_nfc_error_e * result)
+int hal_nfc_secure_element_close(net_nfc_target_handle_s * handle)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_close)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_close(handle, result);
+ return g_nfc_funcs->secure_element_close(handle);
}
EXPORT
-bool hal_nfc_get_secure_element_list(net_nfc_secure_element_info_s * list, int *count, net_nfc_error_e * result)
+int hal_nfc_get_secure_element_list(net_nfc_secure_element_info_s * list, int *count)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->get_secure_element_list)
return -ENOTSUP;
- return g_nfc_funcs->get_secure_element_list(list, count, result);
+ return g_nfc_funcs->get_secure_element_list(list, count);
}
EXPORT
-bool hal_nfc_set_secure_element_mode(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode, net_nfc_error_e * result)
+int hal_nfc_set_secure_element_mode(net_nfc_secure_element_type_e element_type, net_nfc_secure_element_mode_e mode)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->set_secure_element_mode)
return -ENOTSUP;
- return g_nfc_funcs->set_secure_element_mode(element_type, mode, result);
+ return g_nfc_funcs->set_secure_element_mode(element_type, mode);
}
-/* test api */
-
EXPORT
-bool hal_nfc_sim_test(net_nfc_error_e * result)
-{
- if (!g_nfc_funcs)
- return -ENOTSUP;
- if (!g_nfc_funcs->sim_test)
- return -ENOTSUP;
-
- return g_nfc_funcs->sim_test(result);
-}
-
-EXPORT
-bool hal_nfc_prbs_test(net_nfc_error_e * result, uint32_t tech, uint32_t rate)
-{
- if (!g_nfc_funcs)
- return -ENOTSUP;
- if (!g_nfc_funcs->prbs_test)
- return -ENOTSUP;
-
- return g_nfc_funcs->prbs_test(result, tech, rate);
-}
-
-EXPORT
-bool hal_nfc_test_mode_on(net_nfc_error_e * result)
+int hal_nfc_test_mode_on(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->test_mode_on)
return -ENOTSUP;
- return g_nfc_funcs->test_mode_on(result);
+ return g_nfc_funcs->test_mode_on();
}
EXPORT
-bool hal_nfc_test_mode_off(net_nfc_error_e * result)
+int hal_nfc_test_mode_off(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->test_mode_off)
return -ENOTSUP;
- return g_nfc_funcs->test_mode_off(result);
-}
-
-EXPORT
-bool hal_nfc_eedata_register_set(net_nfc_error_e * result, uint32_t mode, uint32_t reg_id, data_s * data)
-{
- if (!g_nfc_funcs)
- return -ENOTSUP;
- if (!g_nfc_funcs->eedata_register_set)
- return -ENOTSUP;
-
- return g_nfc_funcs->eedata_register_set(result, mode, reg_id, data);
+ return g_nfc_funcs->test_mode_off();
}
EXPORT
-bool hal_nfc_ese_test(net_nfc_error_e * result)
-{
- if (!g_nfc_funcs)
- return -ENOTSUP;
- if (!g_nfc_funcs->ese_test)
- return -ENOTSUP;
-
- return g_nfc_funcs->ese_test(result);
-}
-
-EXPORT
-bool hal_nfc_test_set_se_tech_type(net_nfc_error_e * result, net_nfc_se_type_e type, uint32_t tech)
-{
- if (!g_nfc_funcs)
- return -ENOTSUP;
- if (!g_nfc_funcs->test_set_se_tech_type)
- return -ENOTSUP;
-
- return g_nfc_funcs->test_set_se_tech_type(result, type, tech);
-}
-
-/* hce api */
-
-EXPORT
-bool hal_nfc_hce_response_apdu(net_nfc_target_handle_s * handle, data_s * response, net_nfc_error_e * result)
+int hal_nfc_hce_response_apdu(net_nfc_target_handle_s * handle, net_nfc_data_s * response)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->hce_response_apdu)
return -ENOTSUP;
- return g_nfc_funcs->hce_response_apdu(handle, response, result);
+ return g_nfc_funcs->hce_response_apdu(handle, response);
}
EXPORT
-bool hal_nfc_secure_element_route_aid(data_s * aid, net_nfc_se_type_e se_type, int power, net_nfc_error_e * result)
+int hal_nfc_secure_element_route_aid(net_nfc_data_s * aid, net_nfc_se_type_e se_type, int power)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_route_aid)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_route_aid(aid, se_type, power, result);
+ return g_nfc_funcs->secure_element_route_aid(aid, se_type, power);
}
EXPORT
-bool hal_nfc_secure_element_unroute_aid(data_s * aid, net_nfc_error_e * result)
+int hal_nfc_secure_element_unroute_aid(net_nfc_data_s * aid)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_unroute_aid)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_unroute_aid(aid, result);
+ return g_nfc_funcs->secure_element_unroute_aid(aid);
}
EXPORT
-bool hal_nfc_secure_element_commit_routing(net_nfc_error_e * result)
+int hal_nfc_secure_element_commit_routing(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_commit_routing)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_commit_routing(result);
+ return g_nfc_funcs->secure_element_commit_routing();
}
EXPORT
-bool hal_nfc_secure_element_set_default_route(net_nfc_se_type_e switch_on, net_nfc_se_type_e switch_off, net_nfc_se_type_e battery_off, net_nfc_error_e * result)
+int hal_nfc_secure_element_set_default_route(net_nfc_se_type_e switch_on, net_nfc_se_type_e switch_off, net_nfc_se_type_e battery_off)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_set_default_route)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_set_default_route(switch_on, switch_off, battery_off, result);
+ return g_nfc_funcs->secure_element_set_default_route(switch_on, switch_off, battery_off);
}
EXPORT
-bool hal_nfc_secure_element_clear_aid_table(net_nfc_error_e * result)
+int hal_nfc_secure_element_clear_aid_table(void)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_clear_aid_table)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_clear_aid_table(result);
+ return g_nfc_funcs->secure_element_clear_aid_table();
}
EXPORT
-bool hal_nfc_secure_element_get_aid_table_size(int *AIDTableSize, net_nfc_error_e * result)
+int hal_nfc_secure_element_get_aid_table_size(int *AIDTableSize)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_get_aid_table_size)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_get_aid_table_size(AIDTableSize, result);
+ return g_nfc_funcs->secure_element_get_aid_table_size(AIDTableSize);
}
EXPORT
-bool hal_nfc_secure_element_set_route_entry(net_nfc_se_entry_type_e type, net_nfc_se_tech_protocol_type_e value, net_nfc_se_type_e route, int power, net_nfc_error_e * result)
+int hal_nfc_secure_element_set_route_entry(net_nfc_se_entry_type_e type, net_nfc_se_tech_protocol_type_e value, net_nfc_se_type_e route, int power)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_set_route_entry)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_set_route_entry(type, value, route, power, result);
+ return g_nfc_funcs->secure_element_set_route_entry(type, value, route, power);
}
EXPORT
-bool hal_nfc_secure_element_clear_routing_entry(net_nfc_se_entry_type_e type, net_nfc_error_e * result)
+int hal_nfc_secure_element_clear_routing_entry(net_nfc_se_entry_type_e type)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_clear_routing_entry)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_clear_routing_entry(type, result);
+ return g_nfc_funcs->secure_element_clear_routing_entry(type);
}
EXPORT
-bool hal_nfc_secure_element_set_listen_tech_mask(net_nfc_se_tech_protocol_type_e screen_state, net_nfc_error_e * result)
+int hal_nfc_secure_element_set_listen_tech_mask(net_nfc_se_tech_protocol_type_e screen_state)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->secure_element_set_listen_tech_mask)
return -ENOTSUP;
- return g_nfc_funcs->secure_element_set_listen_tech_mask(screen_state, result);
+ return g_nfc_funcs->secure_element_set_listen_tech_mask(screen_state);
}
EXPORT
-bool hal_nfc_set_screen_state(net_nfc_screen_state_type_e screen_state, net_nfc_error_e * result)
+int hal_nfc_set_screen_state(net_nfc_screen_state_type_e screen_state)
{
if (!g_nfc_funcs)
return -ENOTSUP;
if (!g_nfc_funcs->set_screen_state)
return -ENOTSUP;
- return g_nfc_funcs->set_screen_state(screen_state, result);
+ return g_nfc_funcs->set_screen_state(screen_state);
}