CHG: refactor CRC16 algos. This is a big change, most likely some parts broke, hard to test it all.

This commit is contained in:
iceman1001 2018-02-01 15:19:47 +01:00
commit 52d69ed4ee
35 changed files with 512 additions and 674 deletions

View file

@ -1,5 +1,6 @@
// ISO15693 commons
// Adrian Dabrowski 2010 and others, GPLv2
// Christian Herrmann 2018
#ifndef ISO15693_H__
#define ISO15693_H__
@ -9,11 +10,6 @@
#include <stdlib.h>
#include "crc16.h"
// ISO15693 CRC
#define ISO15_CRC_PRESET (uint16_t)0xFFFF
#define ISO15_CRC_POLY (uint16_t)0x8408
#define ISO15_CRC_CHECK ((uint16_t)(~0xF0B8 & 0xFFFF)) // use this for checking of a correct crc
// REQUEST FLAGS
#define ISO15_REQ_SUBCARRIER_SINGLE 0x00 // Tag should respond using one subcarrier (ASK)
@ -71,13 +67,8 @@
#define ISO15_CMD_SYSINFO 0x2B
#define ISO15_CMD_SECSTATUS 0x2C
uint16_t Iso15693Crc(uint8_t *d, size_t n);
int Iso15693AddCrc(uint8_t *d, size_t n);
bool Iso15693CheckCrc(uint8_t *d, size_t n);
char* Iso15693sprintUID(char *target, uint8_t *uid);
//-----------------------------------------------------------------------------
// Map a sequence of octets (~layer 2 command) into the set of bits to feed
// to the FPGA, to transmit that command to the tag.