+static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, uint8_t *bs, size_t bs_len){
+
+ PrintAndLog("Trying FC: %u; CN: %u", fc, cn);
+ if ( !getAWIDBits(fmtlen, fc, cn, bs)) {
+ PrintAndLog("Error with tag bitstream generation.");
+ return FALSE;
+ }
+
+ uint64_t arg1 = (10<<8) + 8; // fcHigh = 10, fcLow = 8
+ uint64_t arg2 = 50; // clk RF/50 invert=0
+ UsbCommand c = {CMD_FSK_SIM_TAG, {arg1, arg2, bs_len}};
+ memcpy(c.d.asBytes, bs, bs_len);
+ clearCommandBuffer();
+ SendCommand(&c);
+ msleep(delay);
+ return TRUE;
+}
+static int sendPing(){
+ UsbCommand resp;
+ UsbCommand ping = {CMD_PING};
+ clearCommandBuffer();
+ SendCommand(&ping);
+ if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
+ PrintAndLog("aborted via keyboard!");
+ return 0;
+ }
+ PrintAndLog("Device didnt respond to ABORT");
+ return 1;
+}
+