nfc_tag_device Struct Reference

nfc_tag_device Struct Reference

#include < nfc_tag.h >

Data Fields

struct hw_device_t   common
int(*  init )(const struct nfc_tag_device *dev)
int(*  setContent )(const struct nfc_tag_device *dev, const uint8_t *data, size_t len)
int(*  getMemorySize )(const struct nfc_tag_device *dev)

Detailed Description

Definition at line 44 of file nfc_tag.h .

Field Documentation

struct hw_device_t common

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 .

int(* getMemorySize)(const struct nfc_tag_device *dev)

Returns the memory size of the data area.

Definition at line 80 of file nfc_tag.h .

int(* init)(const struct nfc_tag_device *dev)

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: