Loading...
Searching...
No Matches
nfc_device_base_i.h
Go to the documentation of this file.
1
8#pragma once
9
10#include "nfc_device_base.h"
11
12#include <flipper_format.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
23typedef NfcDeviceData* (*NfcDeviceAlloc)(void);
24
30typedef void (*NfcDeviceFree)(NfcDeviceData* data);
31
40typedef void (*NfcDeviceReset)(NfcDeviceData* data);
41
48typedef void (*NfcDeviceCopy)(NfcDeviceData* data, const NfcDeviceData* other);
49
58typedef bool (*NfcDeviceVerify)(NfcDeviceData* data, const FuriString* device_type);
59
70typedef bool (*NfcDeviceLoad)(NfcDeviceData* data, FlipperFormat* ff, uint32_t version);
71
81typedef bool (*NfcDeviceSave)(const NfcDeviceData* data, FlipperFormat* ff);
82
90typedef bool (*NfcDeviceEqual)(const NfcDeviceData* data, const NfcDeviceData* other);
91
101typedef const char* (*NfcDeviceGetName)(const NfcDeviceData* data, NfcDeviceNameType name_type);
102
113typedef const uint8_t* (*NfcDeviceGetUid)(const NfcDeviceData* data, size_t* uid_len);
114
125typedef bool (*NfcDeviceSetUid)(NfcDeviceData* data, const uint8_t* uid, size_t uid_len);
126
135typedef NfcDeviceData* (*NfcDeviceGetBaseData)(const NfcDeviceData* data);
136
158
159#ifdef __cplusplus
160}
161#endif
Flipper File Format helper library.
Common top-level types for the NFC protocol stack.
NfcDeviceNameType
Verbosity level of the displayed NFC device name.
Definition nfc_device_base.h:14
void NfcDeviceData
Generic opaque type for protocol-specific NFC device data.
Definition nfc_device_base.h:22
bool(* NfcDeviceSave)(const NfcDeviceData *data, FlipperFormat *ff)
Save NFC device data to a FlipperFormat file.
Definition nfc_device_base_i.h:81
void(* NfcDeviceCopy)(NfcDeviceData *data, const NfcDeviceData *other)
Copy source instance's data into the destination so that they become equal.
Definition nfc_device_base_i.h:48
const char *(* NfcDeviceGetName)(const NfcDeviceData *data, NfcDeviceNameType name_type)
Get a protocol-specific stateful NFC device name.
Definition nfc_device_base_i.h:101
bool(* NfcDeviceSetUid)(NfcDeviceData *data, const uint8_t *uid, size_t uid_len)
Set the NFC device's unique identifier (UID).
Definition nfc_device_base_i.h:125
bool(* NfcDeviceLoad)(NfcDeviceData *data, FlipperFormat *ff, uint32_t version)
Load NFC device data from a FlipperFormat file.
Definition nfc_device_base_i.h:70
const uint8_t *(* NfcDeviceGetUid)(const NfcDeviceData *data, size_t *uid_len)
Get the NFC device's unique identifier (UID).
Definition nfc_device_base_i.h:113
bool(* NfcDeviceEqual)(const NfcDeviceData *data, const NfcDeviceData *other)
Compare two NFC device data instances.
Definition nfc_device_base_i.h:90
NfcDeviceData *(* NfcDeviceGetBaseData)(const NfcDeviceData *data)
Get the NFC device data associated with the parent protocol.
Definition nfc_device_base_i.h:135
bool(* NfcDeviceVerify)(NfcDeviceData *data, const FuriString *device_type)
Deprecated.
Definition nfc_device_base_i.h:58
void(* NfcDeviceFree)(NfcDeviceData *data)
Delete the protocol-specific NFC device data instance.
Definition nfc_device_base_i.h:30
void(* NfcDeviceReset)(NfcDeviceData *data)
Reset the NFC device data instance.
Definition nfc_device_base_i.h:40
NfcDeviceData *(* NfcDeviceAlloc)(void)
Allocate the protocol-specific NFC device data instance.
Definition nfc_device_base_i.h:23
Definition flipper_format.c:12
Definition string.c:4
Generic NFC device interface.
Definition nfc_device_base_i.h:142
NfcDeviceEqual is_equal
Pointer to the is_equal() function.
Definition nfc_device_base_i.h:152
NfcDeviceFree free
Pointer to the free() function.
Definition nfc_device_base_i.h:146
NfcDeviceCopy copy
Pointer to the copy() function.
Definition nfc_device_base_i.h:148
const char * protocol_name
Pointer to a statically-allocated string with the protocol name.
Definition nfc_device_base_i.h:144
NfcDeviceGetUid get_uid
Pointer to the get_uid() function.
Definition nfc_device_base_i.h:154
NfcDeviceSave save
Pointer to the save() function.
Definition nfc_device_base_i.h:151
NfcDeviceVerify verify
Deprecated.
Definition nfc_device_base_i.h:149
NfcDeviceGetBaseData get_base_data
Pointer to the get_base_data() function.
Definition nfc_device_base_i.h:156
NfcDeviceSetUid set_uid
Pointer to the set_uid() function.
Definition nfc_device_base_i.h:155
NfcDeviceLoad load
Pointer to the load() function.
Definition nfc_device_base_i.h:150
NfcDeviceGetName get_name
Pointer to the get_name() function.
Definition nfc_device_base_i.h:153
NfcDeviceReset reset
Pointer to the reset() function.
Definition nfc_device_base_i.h:147
NfcDeviceAlloc alloc
Pointer to the alloc() function.
Definition nfc_device_base_i.h:145