#include "legicrfsim.h"
#include "hitag2.h"
#include "hitagS.h"
+#include "iso15693.h"
#include "lfsampling.h"
#include "BigBuf.h"
#include "mifareutil.h"
#include "LCD.h"
#endif
+static uint32_t hw_capabilities;
// Craig Young - 14a stand-alone code
#ifdef WITH_ISO14443a
extern char *_bootphase1_version_pointer, _flash_start, _flash_end, _bootrom_start, _bootrom_end, __data_src_start__;
+void set_hw_capabilities(void)
+{
+ if (I2C_is_available()) {
+ hw_capabilities |= HAS_SMARTCARD_SLOT;
+ }
+
+ if (false) { // TODO: implement a test
+ hw_capabilities |= HAS_EXTRA_FLASH_MEM;
+ }
+}
+
+
void SendVersion(void)
{
+ set_hw_capabilities();
+
char temp[USB_CMD_DATA_SIZE]; /* Limited data payload in USB packets */
char VersionString[USB_CMD_DATA_SIZE] = { '\0' };
// Send Chip ID and used flash memory
uint32_t text_and_rodata_section_size = (uint32_t)&__data_src_start__ - (uint32_t)&_flash_start;
uint32_t compressed_data_section_size = common_area.arg1;
- cmd_send(CMD_ACK, *(AT91C_DBGU_CIDR), text_and_rodata_section_size + compressed_data_section_size, 0, VersionString, strlen(VersionString));
+ cmd_send(CMD_ACK, *(AT91C_DBGU_CIDR), text_and_rodata_section_size + compressed_data_section_size, hw_capabilities, VersionString, strlen(VersionString));
}
// measure the USB Speed by sending SpeedTestBufferSize bytes to client and measuring the elapsed time.
case CMD_PCF7931_WRITE:
WritePCF7931(c->d.asBytes[0],c->d.asBytes[1],c->d.asBytes[2],c->d.asBytes[3],c->d.asBytes[4],c->d.asBytes[5],c->d.asBytes[6], c->d.asBytes[9], c->d.asBytes[7]-128,c->d.asBytes[8]-128, c->arg[0], c->arg[1], c->arg[2]);
break;
+ case CMD_PCF7931_BRUTEFORCE:
+ BruteForcePCF7931(c->arg[0], (c->arg[1] & 0xFF), c->d.asBytes[9], c->d.asBytes[7]-128,c->d.asBytes[8]-128);
+ break;
case CMD_EM4X_READ_WORD:
EM4xReadWord(c->arg[0], c->arg[1],c->arg[2]);
break;
case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693:
AcquireRawAdcSamplesIso15693();
break;
- case CMD_RECORD_RAW_ADC_SAMPLES_ISO_15693:
- RecordRawAdcSamplesIso15693();
+
+ case CMD_SNOOP_ISO_15693:
+ SnoopIso15693();
break;
case CMD_ISO_15693_COMMAND: