Abstract interface definitions for the NFC device system. More...
Go to the source code of this file.
Data Structures | |
struct | NfcDeviceBase |
Generic NFC device interface. More... | |
Typedefs | |
typedef NfcDeviceData *(* | NfcDeviceAlloc) (void) |
Allocate the protocol-specific NFC device data instance. | |
typedef void(* | NfcDeviceFree) (NfcDeviceData *data) |
Delete the protocol-specific NFC device data instance. | |
typedef void(* | NfcDeviceReset) (NfcDeviceData *data) |
Reset the NFC device data instance. | |
typedef void(* | NfcDeviceCopy) (NfcDeviceData *data, const NfcDeviceData *other) |
Copy source instance's data into the destination so that they become equal. | |
typedef bool(* | NfcDeviceVerify) (NfcDeviceData *data, const FuriString *device_type) |
Deprecated. | |
typedef bool(* | NfcDeviceLoad) (NfcDeviceData *data, FlipperFormat *ff, uint32_t version) |
Load NFC device data from a FlipperFormat file. | |
typedef bool(* | NfcDeviceSave) (const NfcDeviceData *data, FlipperFormat *ff) |
Save NFC device data to a FlipperFormat file. | |
typedef bool(* | NfcDeviceEqual) (const NfcDeviceData *data, const NfcDeviceData *other) |
Compare two NFC device data instances. | |
typedef const char *(* | NfcDeviceGetName) (const NfcDeviceData *data, NfcDeviceNameType name_type) |
Get a protocol-specific stateful NFC device name. | |
typedef const uint8_t *(* | NfcDeviceGetUid) (const NfcDeviceData *data, size_t *uid_len) |
Get the NFC device's unique identifier (UID). | |
typedef bool(* | NfcDeviceSetUid) (NfcDeviceData *data, const uint8_t *uid, size_t uid_len) |
Set the NFC device's unique identifier (UID). | |
typedef NfcDeviceData *(* | NfcDeviceGetBaseData) (const NfcDeviceData *data) |
Get the NFC device data associated with the parent protocol. | |
Abstract interface definitions for the NFC device system.
This file is an implementation detail. It must not be included in any public API-related headers.
typedef NfcDeviceData *(* NfcDeviceAlloc) (void) |
Allocate the protocol-specific NFC device data instance.
typedef void(* NfcDeviceCopy) (NfcDeviceData *data, const NfcDeviceData *other) |
Copy source instance's data into the destination so that they become equal.
[in,out] | data | pointer to the destination instance. |
[in] | other | pointer to the source instance. |
typedef bool(* NfcDeviceEqual) (const NfcDeviceData *data, const NfcDeviceData *other) |
Compare two NFC device data instances.
[in] | data | pointer to the first instance to be compared. |
[in] | other | pointer to the second instance to be compared. |
typedef void(* NfcDeviceFree) (NfcDeviceData *data) |
Delete the protocol-specific NFC device data instance.
[in,out] | data | pointer to the instance to be deleted. |
typedef NfcDeviceData *(* NfcDeviceGetBaseData) (const NfcDeviceData *data) |
Get the NFC device data associated with the parent protocol.
The protocol the instance's data is associated with must have a parent.
[in] | data | pointer to the instance to be queried. |
typedef const char *(* NfcDeviceGetName) (const NfcDeviceData *data, NfcDeviceNameType name_type) |
Get a protocol-specific stateful NFC device name.
The return value may change depending on the instance's internal state and the name_type parameter.
[in] | data | pointer to the instance to be queried. |
[in] | name_type | type of the name to be displayed. |
typedef const uint8_t *(* NfcDeviceGetUid) (const NfcDeviceData *data, size_t *uid_len) |
Get the NFC device's unique identifier (UID).
The UID length is protocol-dependent. Additionally, a particular protocol might support several UID lengths.
[in] | data | pointer to the instance to be queried. |
[out] | uid_len | pointer to the variable to contain the UID length. |
typedef bool(* NfcDeviceLoad) (NfcDeviceData *data, FlipperFormat *ff, uint32_t version) |
Load NFC device data from a FlipperFormat file.
The FlipperFormat file structure must be initialised and open by the calling code.
[in,out] | data | pointer to the instance to be loaded into. |
[in] | ff | pointer to the FlipperFormat file instance. |
[in] | version | file format version to use when loading. |
typedef void(* NfcDeviceReset) (NfcDeviceData *data) |
Reset the NFC device data instance.
The behaviour is protocol-specific. Usually, required fields are zeroed or set to their initial values.
[in,out] | data | pointer to the instance to be reset. |
typedef bool(* NfcDeviceSave) (const NfcDeviceData *data, FlipperFormat *ff) |
Save NFC device data to a FlipperFormat file.
The FlipperFormat file structure must be initialised and open by the calling code.
[in] | data | pointer to the instance to be saved. |
[in] | ff | pointer to the FlipperFormat file instance. |
typedef bool(* NfcDeviceSetUid) (NfcDeviceData *data, const uint8_t *uid, size_t uid_len) |
Set the NFC device's unique identifier (UID).
The UID length must be supported by the protocol in question.
[in,out] | data | pointer to the instance to be modified. |
[in] | uid | pointer to the byte array containing the new UID. |
[in] | uid_len | length of the UID. |
typedef bool(* NfcDeviceVerify) (NfcDeviceData *data, const FuriString *device_type) |
Deprecated.
Do not use in new protocols.
[in,out] | data | pointer to the instance to be tested. |
[in] | device_type | pointer to a FuriString containing a device type identifier. |