Common interface for accessing various iButton protocols. More...
#include <stdint.h>
#include <stddef.h>
#include "protocols/protocol_common.h"
#include "ibutton_key.h"
Go to the source code of this file.
Typedefs | |
typedef struct iButtonProtocols | iButtonProtocols |
Functions | |
iButtonProtocols * | ibutton_protocols_alloc (void) |
Allocate an iButtonProtocols object. | |
void | ibutton_protocols_free (iButtonProtocols *protocols) |
Destroy an iButtonProtocols object, free resources. | |
uint32_t | ibutton_protocols_get_protocol_count (void) |
Get the total number of available protocols. | |
size_t | ibutton_protocols_get_max_data_size (iButtonProtocols *protocols) |
Get maximum data size out of all protocols available. | |
iButtonProtocolId | ibutton_protocols_get_id_by_name (iButtonProtocols *protocols, const char *name) |
Get the protocol id based on its name. | |
const char * | ibutton_protocols_get_manufacturer (iButtonProtocols *protocols, iButtonProtocolId id) |
Get the manufacturer name based on the protocol id. | |
const char * | ibutton_protocols_get_name (iButtonProtocols *protocols, iButtonProtocolId id) |
Get the protocol name based on the protocol id. | |
uint32_t | ibutton_protocols_get_features (iButtonProtocols *protocols, iButtonProtocolId id) |
Get protocol features bitmask by protocol id. | |
bool | ibutton_protocols_read (iButtonProtocols *protocols, iButtonKey *key) |
Read a physical device (a key or an emulator) | |
bool | ibutton_protocols_write_id (iButtonProtocols *protocols, iButtonKey *key) |
Write the key to a blank. | |
bool | ibutton_protocols_write_copy (iButtonProtocols *protocols, iButtonKey *key) |
Write the key to another one of the same type. | |
void | ibutton_protocols_emulate_start (iButtonProtocols *protocols, iButtonKey *key) |
Start emulating the key. | |
void | ibutton_protocols_emulate_stop (iButtonProtocols *protocols, iButtonKey *key) |
Stop emulating the key. | |
bool | ibutton_protocols_save (iButtonProtocols *protocols, const iButtonKey *key, const char *file_name) |
Save the key data to a file. | |
bool | ibutton_protocols_load (iButtonProtocols *protocols, iButtonKey *key, const char *file_name) |
Load the key from a file. | |
void | ibutton_protocols_render_uid (iButtonProtocols *protocols, const iButtonKey *key, FuriString *result) |
Format a string containing defice UID. | |
void | ibutton_protocols_render_data (iButtonProtocols *protocols, const iButtonKey *key, FuriString *result) |
Format a string containing device full data. | |
void | ibutton_protocols_render_brief_data (iButtonProtocols *protocols, const iButtonKey *key, FuriString *result) |
Format a string containing device brief data. | |
void | ibutton_protocols_render_error (iButtonProtocols *protocols, const iButtonKey *key, FuriString *result) |
Format a string containing error message (for invalid keys) | |
bool | ibutton_protocols_is_valid (iButtonProtocols *protocols, const iButtonKey *key) |
Check whether the key data is valid. | |
void | ibutton_protocols_get_editable_data (iButtonProtocols *protocols, const iButtonKey *key, iButtonEditableData *editable) |
Get a pointer to the key's editable data (for in-place editing) | |
void | ibutton_protocols_apply_edits (iButtonProtocols *protocols, const iButtonKey *key) |
Make all necessary internal adjustments after editing the key. | |
Common interface for accessing various iButton protocols.
iButtonProtocols * ibutton_protocols_alloc | ( | void | ) |
Allocate an iButtonProtocols object.
void ibutton_protocols_apply_edits | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key ) |
Make all necessary internal adjustments after editing the key.
[in] | protocols | pointer to an iButtonProtocols object |
[in,out] | key | pointer to the key to be adjusted |
void ibutton_protocols_emulate_start | ( | iButtonProtocols * | protocols, |
iButtonKey * | key ) |
Start emulating the key.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be emulated |
void ibutton_protocols_emulate_stop | ( | iButtonProtocols * | protocols, |
iButtonKey * | key ) |
Stop emulating the key.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be emulated |
void ibutton_protocols_free | ( | iButtonProtocols * | protocols | ) |
Destroy an iButtonProtocols object, free resources.
[in] | protocols | pointer to an iButtonProtocols object |
void ibutton_protocols_get_editable_data | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key, | ||
iButtonEditableData * | editable ) |
Get a pointer to the key's editable data (for in-place editing)
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be checked |
[out] | editable | pointer to a structure to contain the editable data |
uint32_t ibutton_protocols_get_features | ( | iButtonProtocols * | protocols, |
iButtonProtocolId | id ) |
Get protocol features bitmask by protocol id.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | id | id of the protocol in question |
iButtonProtocolId ibutton_protocols_get_id_by_name | ( | iButtonProtocols * | protocols, |
const char * | name ) |
Get the protocol id based on its name.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | name | pointer to a string containing the name |
const char * ibutton_protocols_get_manufacturer | ( | iButtonProtocols * | protocols, |
iButtonProtocolId | id ) |
Get the manufacturer name based on the protocol id.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | id | id of the protocol in question |
size_t ibutton_protocols_get_max_data_size | ( | iButtonProtocols * | protocols | ) |
Get maximum data size out of all protocols available.
[in] | protocols | pointer to an iButtonProtocols object |
const char * ibutton_protocols_get_name | ( | iButtonProtocols * | protocols, |
iButtonProtocolId | id ) |
Get the protocol name based on the protocol id.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | id | id of the protocol in question |
bool ibutton_protocols_is_valid | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key ) |
Check whether the key data is valid.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be checked |
bool ibutton_protocols_load | ( | iButtonProtocols * | protocols, |
iButtonKey * | key, | ||
const char * | file_name ) |
Load the key from a file.
[in] | protocols | pointer to an iButtonProtocols object |
[out] | key | pointer to the key to load into (must be allocated before) |
[in] | file_name | full absolute path to the file name |
bool ibutton_protocols_read | ( | iButtonProtocols * | protocols, |
iButtonKey * | key ) |
Read a physical device (a key or an emulator)
[in] | protocols | pointer to an iButtonProtocols object |
[out] | key | pointer to the key to read into (must be allocated before) |
void ibutton_protocols_render_brief_data | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key, | ||
FuriString * | result ) |
Format a string containing device brief data.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be rendered |
[out] | result | pointer to the FuriString instance (must be initialized) |
void ibutton_protocols_render_data | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key, | ||
FuriString * | result ) |
Format a string containing device full data.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be rendered |
[out] | result | pointer to the FuriString instance (must be initialized) |
void ibutton_protocols_render_error | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key, | ||
FuriString * | result ) |
Format a string containing error message (for invalid keys)
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be rendered |
[out] | result | pointer to the FuriString instance (must be initialized) |
void ibutton_protocols_render_uid | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key, | ||
FuriString * | result ) |
Format a string containing defice UID.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be rendered |
[out] | result | pointer to the FuriString instance (must be initialized) |
bool ibutton_protocols_save | ( | iButtonProtocols * | protocols, |
const iButtonKey * | key, | ||
const char * | file_name ) |
Save the key data to a file.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be saved |
[in] | file_name | full absolute path to the file name |
bool ibutton_protocols_write_copy | ( | iButtonProtocols * | protocols, |
iButtonKey * | key ) |
Write the key to another one of the same type.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be written |
bool ibutton_protocols_write_id | ( | iButtonProtocols * | protocols, |
iButtonKey * | key ) |
Write the key to a blank.
[in] | protocols | pointer to an iButtonProtocols object |
[in] | key | pointer to the key to be written |