diff options
author | Martijn Coenen <maco@google.com> | 2012-09-30 11:06:22 -0700 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2012-09-30 11:08:49 -0700 |
commit | 442752aecdc54c32e77227e792fca64dcf1c1fb8 (patch) | |
tree | 0c785855de65831c16d33f93776b5644edd4bf21 /include/hardware | |
parent | cecacd4e71c35fd50dbe1e9855cbab0faa17b550 (diff) | |
download | hardware_libhardware-442752aecdc54c32e77227e792fca64dcf1c1fb8.zip hardware_libhardware-442752aecdc54c32e77227e792fca64dcf1c1fb8.tar.gz hardware_libhardware-442752aecdc54c32e77227e792fca64dcf1c1fb8.tar.bz2 |
NFC HAL: Use a separate callback for data.
Bug: 7258325
Change-Id: I02d8ea1bdcb8ea6a9430e3dc286f5c2647277f72
Diffstat (limited to 'include/hardware')
-rw-r--r-- | include/hardware/nfc.h | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/include/hardware/nfc.h b/include/hardware/nfc.h index 31410fb..09523b3 100644 --- a/include/hardware/nfc.h +++ b/include/hardware/nfc.h @@ -71,11 +71,10 @@ enum { HAL_NFC_OPEN_CPLT_EVT = 0x00, HAL_NFC_CLOSE_CPLT_EVT = 0x01, HAL_NFC_POST_INIT_CPLT_EVT = 0x02, - HAL_NFC_NCI_RX_EVT = 0x03, - HAL_NFC_PRE_DISCOVER_CPLT_EVT = 0x04, - HAL_NFC_REQUEST_CONTROL_EVT = 0x05, - HAL_NFC_RELEASE_CONTROL_EVT = 0x06, - HAL_NFC_ERROR_EVT = 0x07 + HAL_NFC_PRE_DISCOVER_CPLT_EVT = 0x03, + HAL_NFC_REQUEST_CONTROL_EVT = 0x04, + HAL_NFC_RELEASE_CONTROL_EVT = 0x05, + HAL_NFC_ERROR_EVT = 0x06 }; /* @@ -92,27 +91,16 @@ enum { }; /* - * nfc_rx_data - * Struct used to pass received NCI packets up to the stack - */ -typedef struct nfc_rx_data { - uint16_t len; - uint8_t *p_data; -} nfc_rx_data_t; - -/* + * The callback passed in from the NFC stack that the HAL + * can use to pass events back to the stack. */ -typedef union -{ - nfc_status_t status; - nfc_rx_data_t nci_rx; -} nfc_event_data_t; +typedef void (nfc_stack_callback_t) (nfc_event_t event, nfc_status_t event_status); /* * The callback passed in from the NFC stack that the HAL - * can use to pass events back to the stack. + * can use to pass incomming data to the stack. */ -typedef void (nfc_stack_callback_t) (nfc_event_t event, nfc_event_data_t* p_data); +typedef void (nfc_stack_data_callback_t) (uint16_t data_len, uint8_t* p_data); /* nfc_nci_device_t starts with a hw_device_t struct, * followed by device-specific methods and members. @@ -135,7 +123,8 @@ typedef struct nfc_nci_device { * If open() returns any other value, the NCI stack will stop. * */ - int (*open)(const struct nfc_nci_device *p_dev, nfc_stack_callback_t *p_cback); + int (*open)(const struct nfc_nci_device *p_dev, nfc_stack_callback_t *p_cback, + nfc_stack_data_callback_t *p_data_cback); /* * (*write)() Performs an NCI write. |