Described restrictions for common HAL object methods in nfc.h.
Follow up from change Ibe4300275286ef275b2097534c84f1029d761d87
which extends comments to the nfc_nci_module_t and nfc_nci_device_t
structures.
Change-Id: I060bda450912ff3fc041027faa8f03c24e310870
diff --git a/include/hardware/nfc.h b/include/hardware/nfc.h
index 3edfeb6..0a8ed72 100644
--- a/include/hardware/nfc.h
+++ b/include/hardware/nfc.h
@@ -59,6 +59,12 @@
* nfc_nci_module_t should contain module-specific parameters
*/
typedef struct nfc_nci_module_t {
+ /**
+ * Common methods of the NFC NCI module. This *must* be the first member of
+ * nfc_nci_module_t as users of this structure will cast a hw_module_t to
+ * nfc_nci_module_t pointer in contexts where it's known the hw_module_t references a
+ * nfc_nci_module_t.
+ */
struct hw_module_t common;
} nfc_nci_module_t;
@@ -108,6 +114,12 @@
* All methods in the NCI HAL are asynchronous.
*/
typedef struct nfc_nci_device {
+ /**
+ * Common methods of the NFC NCI device. This *must* be the first member of
+ * nfc_nci_device_t as users of this structure will cast a hw_device_t to
+ * nfc_nci_device_t pointer in contexts where it's known the hw_device_t references a
+ * nfc_nci_device_t.
+ */
struct hw_device_t common;
/*
* (*open)() Opens the NFC controller device and performs initialization.
@@ -213,7 +225,7 @@
/**
* Common methods of the NFC NXP PN544 module. This *must* be the first member of
* nfc_module_t as users of this structure will cast a hw_module_t to
- * nfc_module_t pointer in contexts where it's known the hw_module_t references an
+ * nfc_module_t pointer in contexts where it's known the hw_module_t references a
* nfc_module_t.
*/
struct hw_module_t common;
@@ -236,7 +248,7 @@
/**
* Common methods of the NFC NXP PN544 device. This *must* be the first member of
* nfc_pn544_device_t as users of this structure will cast a hw_device_t to
- * nfc_pn544_device_t pointer in contexts where it's known the hw_device_t references an
+ * nfc_pn544_device_t pointer in contexts where it's known the hw_device_t references a
* nfc_pn544_device_t.
*/
struct hw_device_t common;