unleashed-firmware/lib/nfc_protocols/nfca.h
gornekich d31578508a
[FL-2245] Introduce Mifare Classic Emulation (#1242)
* digital signal: introduce digital signal
* nfca: add nfca signal encoder
* nfc: add mifare classic emulation scene
* nfca: add classic emulation support to lib and hal
* mifare classic: support basic read commands
* nfc: add mifare classic menu scene
* mifare classic: start parsing commands in emulation
* mifare classic: add nested auth
* nfc: fix errors
* mifare classic: add encrypt function
* nfc: fix mifare classic save
* lib hex: add hex uint64_t ASCII parser
* flipper format: add uint64 hex format support
* nfc: add mifare classic key map
* nfc: hide mifare classic keys on emulation
* mifare classic: add NACK responce
* nfc: add partial bytes support in transparent mode
* nfc: mifare classic add shadow file support
* digital signal: move arr buffer from BSS to heap
* mifare classic: process access bits more careful
* nfca: fix memory leack
* nfc: format sources
* mifare classic: cleun up

Co-authored-by: あく <alleteam@gmail.com>
2022-05-24 17:00:15 +03:00

28 lines
632 B
C

#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <lib/digital_signal/digital_signal.h>
typedef struct {
DigitalSignal* one;
DigitalSignal* zero;
DigitalSignal* tx_signal;
} NfcaSignal;
uint16_t nfca_get_crc16(uint8_t* buff, uint16_t len);
void nfca_append_crc16(uint8_t* buff, uint16_t len);
bool nfca_emulation_handler(
uint8_t* buff_rx,
uint16_t buff_rx_len,
uint8_t* buff_tx,
uint16_t* buff_tx_len);
NfcaSignal* nfca_signal_alloc();
void nfca_signal_free(NfcaSignal* nfca_signal);
void nfca_signal_encode(NfcaSignal* nfca_signal, uint8_t* data, uint16_t bits, uint8_t* parity);