lf hid improvements - encoding and long tag simulation

**DEVICE FIRMWARE UPDATE**
The code changes needed to support long tag emulation required an update to the device firmware. As of this patch, devices running older firmware will not be able to read or emulate HID tags until the firmware is updated. Additionally, devices with the firmware from this update or newer will not properly read or encode HID tags with a prior version client.

The 'lf hid encode' command has been further refined, and is now entirely parameterized to support use of fields other than facility code and card number. The client help data has been updated to show the correct syntax.
This commit is contained in:
grauerfuchs 2018-08-30 21:01:21 -04:00
commit be59094de9
7 changed files with 311 additions and 353 deletions

View file

@ -15,12 +15,22 @@
#include <stdbool.h>
#include "hidcardformatutils.h"
typedef struct hidcardformatdescriptor_s{
bool hasCardNumber;
bool hasFacilityCode;
bool hasIssueLevel;
bool hasOEMCode;
bool hasParity;
} hidcardformatdescriptor_t;
// Structure for defined HID card formats available for packing/unpacking
typedef struct hidcardformat_s{
const char* Name;
bool (*Pack)(/*in*/hidproxcard_t* card, /*out*/hidproxmessage_t* packed);
bool (*Unpack)(/*in*/hidproxmessage_t* packed, /*out*/hidproxcard_t* card);
const char* Descrp;
hidcardformatdescriptor_t Fields;
} hidcardformat_t;
void HIDListFormats();