mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-22 01:08:11 -07:00
b9fa2943ed
Add Write Single Block poller functions for ISO 15693-3 and SLIX/SLIX2, enable the Write scene for both protocols, and skip blocks that already contain the correct data to minimise RF session time and avoid timeouts on large tags (e.g. 80-block ICODE SLIX2). Tested on NXP ICODE SLIX2 (UID E0 04 01 09 05 05 09 37, 80 x 4 byte blocks).
61 lines
1.7 KiB
C
61 lines
1.7 KiB
C
#pragma once
|
|
|
|
#include "iso15693_3.h"
|
|
|
|
#include <toolbox/bit_buffer.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Check if the buffer contains an error frame and if it does, determine
|
|
* the error type.
|
|
* NOTE: No changes are done to the result if no error is present.
|
|
*
|
|
* @param [out] data Pointer to the resulting error value.
|
|
* @param [in] buf Data buffer to be checked
|
|
*
|
|
* @return True if data contains an error frame or is empty, false otherwise
|
|
*/
|
|
bool iso15693_3_error_response_parse(Iso15693_3Error* error, const BitBuffer* buf);
|
|
|
|
Iso15693_3Error iso15693_3_inventory_response_parse(uint8_t* data, const BitBuffer* buf);
|
|
|
|
Iso15693_3Error
|
|
iso15693_3_system_info_response_parse(Iso15693_3SystemInfo* data, const BitBuffer* buf);
|
|
|
|
Iso15693_3Error
|
|
iso15693_3_read_block_response_parse(uint8_t* data, uint8_t block_size, const BitBuffer* buf);
|
|
|
|
Iso15693_3Error iso15693_3_write_block_response_parse(const BitBuffer* buf);
|
|
|
|
Iso15693_3Error iso15693_3_get_block_security_response_parse(
|
|
uint8_t* data,
|
|
uint16_t block_count,
|
|
const BitBuffer* buf);
|
|
|
|
void iso15693_3_append_uid(const Iso15693_3Data* data, BitBuffer* buf);
|
|
|
|
void iso15693_3_append_block(const Iso15693_3Data* data, uint8_t block_num, BitBuffer* buf);
|
|
|
|
void iso15693_3_set_block_locked(Iso15693_3Data* data, uint8_t block_index, bool locked);
|
|
|
|
void iso15693_3_set_block_data(
|
|
Iso15693_3Data* data,
|
|
uint8_t block_num,
|
|
const uint8_t* block_data,
|
|
size_t block_data_size);
|
|
|
|
void iso15693_3_append_block_security(
|
|
const Iso15693_3Data* data,
|
|
uint8_t block_num,
|
|
BitBuffer* buf);
|
|
|
|
// NOTE: the uid parameter has reversed byte order with respect to data
|
|
bool iso15693_3_is_equal_uid(const Iso15693_3Data* data, const uint8_t* uid);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|