Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
nfc_tag_device Struct Reference
#include <
nfc_tag.h
>
Definition at line
44
of file
nfc_tag.h
.
Common methods of the NFC tag device. This
must
be the first member of nfc_tag_device_t as users of this structure will cast a
hw_device_t
to nfc_tag_device_t pointer in contexts where it's known the
hw_device_t
references a nfc_tag_device_t.
Definition at line
51
of file
nfc_tag.h
.
Returns the memory size of the data area.
Definition at line
80
of file
nfc_tag.h
.
Initialize the NFC tag.
The driver must:
-
Set the static lock bytes to read only
-
Configure the Capability Container to disable write acess eg: 0xE1 0x10 <size> 0x0F
This function is called once before any calls to
setContent()
.
Return 0 on success or -errno on error.
Definition at line
65
of file
nfc_tag.h
.
int(* setContent)(const struct
nfc_tag_device
*dev, const uint8_t *data, size_t len)
|
Set the NFC tag content.
The driver must write <data> in the data area of the tag starting at byte 0 of block 4 and zero the rest of the data area.
Returns 0 on success or -errno on error.
Definition at line
75
of file
nfc_tag.h
.
The documentation for this struct was generated from the following file:
-
hardware/libhardware/include/hardware/
nfc_tag.h
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2019-10-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-10-02 UTC."],[],[],null,["# Android Hardware Abstraction Layer: nfc_tag_device Struct Reference\n\nnfc_tag_device Struct Reference\n===============================\n\n[Data Fields](#pub-attribs) \nnfc_tag_device Struct Reference \n\n`\n#include \u003c\n`[nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)`\n\u003e\n`\n\n|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| struct [hw_device_t](/reference/hal/structhw__device__t) | [common](/reference/hal/structnfc__tag__device#a86a0ca82dd3f02023e259b8b5e155dbe) |\n| ||\n| int(\\* | [init](/reference/hal/structnfc__tag__device#ae5eddc2663eab28a5880c1c3ece3c2cd) )(const struct [nfc_tag_device](/reference/hal/structnfc__tag__device) \\*dev) |\n| ||\n| int(\\* | [setContent](/reference/hal/structnfc__tag__device#a33335a1531a79b11436d1272d2ec696b) )(const struct [nfc_tag_device](/reference/hal/structnfc__tag__device) \\*dev, const uint8_t \\*data, size_t len) |\n| ||\n| int(\\* | [getMemorySize](/reference/hal/structnfc__tag__device#a93d3375699112cf6216b01be934f26d1) )(const struct [nfc_tag_device](/reference/hal/structnfc__tag__device) \\*dev) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[44](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\nof file\n[nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------|\n| struct [hw_device_t](/reference/hal/structhw__device__t) common |\n\n\nCommon methods of the NFC tag device. This\n*must*\nbe the first member of nfc_tag_device_t as users of this structure will cast a\n[hw_device_t](/reference/hal/structhw__device__t)\nto nfc_tag_device_t pointer in contexts where it's known the\n[hw_device_t](/reference/hal/structhw__device__t)\nreferences a nfc_tag_device_t.\n\n\nDefinition at line\n[51](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\nof file\n[nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\n.\n\n|---------------------------------------------------------------------------------------------------|\n| int(\\* getMemorySize)(const struct [nfc_tag_device](/reference/hal/structnfc__tag__device) \\*dev) |\n\n\nReturns the memory size of the data area.\n\n\nDefinition at line\n[80](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\nof file\n[nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\n.\n\n|------------------------------------------------------------------------------------------|\n| int(\\* init)(const struct [nfc_tag_device](/reference/hal/structnfc__tag__device) \\*dev) |\n\n\nInitialize the NFC tag.\n\n\nThe driver must:\n\n- Set the static lock bytes to read only\n- Configure the Capability Container to disable write acess eg: 0xE1 0x10 \\\u003csize\\\u003e 0x0F\n\n\nThis function is called once before any calls to\n[setContent()](/reference/hal/structnfc__tag__device#a33335a1531a79b11436d1272d2ec696b)\n.\n\n\nReturn 0 on success or -errno on error.\n\n\nDefinition at line\n[65](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\nof file\n[nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* setContent)(const struct [nfc_tag_device](/reference/hal/structnfc__tag__device) \\*dev, const uint8_t \\*data, size_t len) |\n\n\nSet the NFC tag content.\n\n\nThe driver must write \\\u003cdata\\\u003e in the data area of the tag starting at byte 0 of block 4 and zero the rest of the data area.\n\n\nReturns 0 on success or -errno on error.\n\n\nDefinition at line\n[75](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\nof file\n[nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [nfc_tag.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/nfc_tag.h)"]]