Files
unleashed-firmware/lib/lfrfid/protocols/lfrfid_protocols.h
T
Vladimir KuznichenkovandŠtefan Croitoru 76bddb682f feat: add Indala 224-bit (long format) RFID protocol support (#4343)
* feat: add Indala 224-bit (long format) RFID protocol support

Add complete Indala 224-bit protocol: decode, encode, emulate, and
write/clone via T5577. Uses PSK2 modulation (RF/32, bitrate 2) with
a 30-bit preamble (1 + 29 zeros) and 224-bit data payload.

Decoder performs PSK2 differential decoding (data = phase XOR next_phase)
from the shift register, handles both normal and inverted preambles for
phase-alternating cards, and validates across 6 consecutive frames.

Writer configures T5577 with block 0 = 0x000820E0 matching Proxmark3
reference implementation. Encoder uses PSK2 carrier-flip modulation
where carrier phase inverts on data bit = 1.

Verified against Proxmark3 lf indala clone output:
  80000001B23523A6C2E31EBA3CBEE4AFB3C6AD1FCF649393928C14E5

Includes unit tests for roundtrip encode/decode and PSK2 phase
alternation edge case.

* Append Indala224 to protocol enum, move its test registration

* fbt format

* Indala224: don't drop a full-frame phase run

---------

Co-authored-by: Štefan Croitoru <66339601+turbospok@users.noreply.github.com>
2026-10-07 17:00:22 +03:00

63 lines
1.6 KiB
C

#pragma once
#include <toolbox/protocols/protocol.h>
#include "../tools/t5577.h"
#include "../tools/em4305.h"
#include "../tools/hitagmicro.h"
#include "../tools/hitags.h"
typedef enum {
LFRFIDFeatureASK = 1 << 0, /** ASK Demodulation */
LFRFIDFeaturePSK = 1 << 1, /** PSK Demodulation */
} LFRFIDFeature;
typedef enum {
LFRFIDProtocolEM4100,
LFRFIDProtocolEM4100_32,
LFRFIDProtocolEM4100_16,
LFRFIDProtocolElectra,
LFRFIDProtocolH10301,
LFRFIDProtocolIdteck,
LFRFIDProtocolIndala26,
LFRFIDProtocolIOProxXSF,
LFRFIDProtocolAwid,
LFRFIDProtocolFDXA,
LFRFIDProtocolFDXB,
LFRFIDProtocolHidGeneric,
LFRFIDProtocolHidExGeneric,
LFRFIDProtocolPyramid,
LFRFIDProtocolViking,
LFRFIDProtocolJablotron,
LFRFIDProtocolParadox,
LFRFIDProtocolPACStanley,
LFRFIDProtocolKeri,
LFRFIDProtocolGallagher,
LFRFIDProtocolNexwatch,
LFRFIDProtocolSecurakey,
LFRFIDProtocolGProxII,
LFRFIDProtocolNoralsy,
LFRFIDProtocolIndala224,
LFRFIDProtocolMax,
} LFRFIDProtocol;
extern const ProtocolBase* const lfrfid_protocols[];
typedef enum {
LFRFIDWriteTypeT5577,
LFRFIDWriteTypeEM4305,
LFRFIDWriteTypeHitagMicro, // ID82xx / Hitag micro magic chips (EM4100 emulation)
LFRFIDWriteTypeHitagS, // ID8268 / Hitag S magic chips (EM4100 emulation)
LFRFIDWriteTypeMax,
} LFRFIDWriteType;
typedef struct {
LFRFIDWriteType write_type;
union {
LFRFIDT5577 t5577;
LFRFIDEM4305 em4305;
LFRFIDHitagMicro hitagmicro;
LFRFIDHitagS hitags;
};
} LFRFIDWriteRequest;