mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-04-20 03:10:45 +08:00
chg: cleanup from offical repo
This commit is contained in:
parent
646ff0ce68
commit
2e6699273e
6 changed files with 5 additions and 16 deletions
|
@ -30,8 +30,6 @@
|
||||||
#include "cmdcrc.h"
|
#include "cmdcrc.h"
|
||||||
#include "cmdanalyse.h"
|
#include "cmdanalyse.h"
|
||||||
|
|
||||||
unsigned int current_command = CMD_UNKNOWN;
|
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
static int CmdQuit(const char *Cmd);
|
static int CmdQuit(const char *Cmd);
|
||||||
static int CmdRev(const char *Cmd);
|
static int CmdRev(const char *Cmd);
|
||||||
|
@ -140,7 +138,7 @@ int getCommand(UsbCommand* response) {
|
||||||
* Waits for a certain response type. This method waits for a maximum of
|
* Waits for a certain response type. This method waits for a maximum of
|
||||||
* ms_timeout milliseconds for a specified response command.
|
* ms_timeout milliseconds for a specified response command.
|
||||||
*@brief WaitForResponseTimeout
|
*@brief WaitForResponseTimeout
|
||||||
* @param cmd command to wait for
|
* @param cmd command to wait for, or CMD_UNKNOWN to take any command.
|
||||||
* @param response struct to copy received command into.
|
* @param response struct to copy received command into.
|
||||||
* @param ms_timeout
|
* @param ms_timeout
|
||||||
* @return true if command was returned, otherwise false
|
* @return true if command was returned, otherwise false
|
||||||
|
@ -158,7 +156,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
while ( getCommand(response) ) {
|
while ( getCommand(response) ) {
|
||||||
if (response->cmd == cmd)
|
if (cmd == CMD_UNKNOWN || response->cmd == cmd)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,6 +164,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (msclock() - start_time > 3000 && show_warning) {
|
if (msclock() - start_time > 3000 && show_warning) {
|
||||||
|
// 3 seconds elapsed (but this doesn't mean the timeout was exceeded)
|
||||||
PrintAndLogEx(NORMAL, "Waiting for a response from the proxmark...");
|
PrintAndLogEx(NORMAL, "Waiting for a response from the proxmark...");
|
||||||
PrintAndLogEx(NORMAL, "You can cancel this operation by pressing the pm3 button");
|
PrintAndLogEx(NORMAL, "You can cancel this operation by pressing the pm3 button");
|
||||||
show_warning = false;
|
show_warning = false;
|
||||||
|
|
|
@ -15,9 +15,6 @@ void ReceiveCommand(UsbCommand* rxcmd);
|
||||||
void CloseProxmark();
|
void CloseProxmark();
|
||||||
int OpenProxmark();
|
int OpenProxmark();
|
||||||
|
|
||||||
// FIXME: what the fuckity fuck
|
|
||||||
unsigned int current_command = CMD_UNKNOWN;
|
|
||||||
|
|
||||||
#define FLASH_START 0x100000
|
#define FLASH_START 0x100000
|
||||||
|
|
||||||
#ifdef HAS_512_FLASH
|
#ifdef HAS_512_FLASH
|
||||||
|
|
|
@ -17,9 +17,6 @@
|
||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
#include "proxendian.h"
|
#include "proxendian.h"
|
||||||
|
|
||||||
// FIXME: what the fuckity fuck
|
|
||||||
unsigned int current_command = CMD_UNKNOWN;
|
|
||||||
|
|
||||||
#define FLASH_START 0x100000
|
#define FLASH_START 0x100000
|
||||||
#define FLASH_SIZE (256*1024)
|
#define FLASH_SIZE (256*1024)
|
||||||
#define FLASH_END (FLASH_START + FLASH_SIZE)
|
#define FLASH_END (FLASH_START + FLASH_SIZE)
|
||||||
|
|
|
@ -19,7 +19,6 @@ usb_dev_handle *devh = NULL;
|
||||||
static unsigned int claimed_iface = 0;
|
static unsigned int claimed_iface = 0;
|
||||||
unsigned char return_on_error = 0;
|
unsigned char return_on_error = 0;
|
||||||
unsigned char error_occured = 0;
|
unsigned char error_occured = 0;
|
||||||
extern unsigned int current_command;
|
|
||||||
|
|
||||||
void SendCommand(UsbCommand *c)
|
void SendCommand(UsbCommand *c)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +27,7 @@ void SendCommand(UsbCommand *c)
|
||||||
#if 0
|
#if 0
|
||||||
printf("Sending %d bytes\n", sizeof(UsbCommand));
|
printf("Sending %d bytes\n", sizeof(UsbCommand));
|
||||||
#endif
|
#endif
|
||||||
current_command = c->cmd;
|
|
||||||
ret = usb_bulk_write(devh, 0x01, (char*)c, sizeof(UsbCommand), 1000);
|
ret = usb_bulk_write(devh, 0x01, (char*)c, sizeof(UsbCommand), 1000);
|
||||||
if (ret<0) {
|
if (ret<0) {
|
||||||
error_occured = 1;
|
error_occured = 1;
|
||||||
|
|
|
@ -29,7 +29,7 @@ GZIP=gzip
|
||||||
|
|
||||||
OBJDIR = obj
|
OBJDIR = obj
|
||||||
|
|
||||||
INCLUDE = -I../include -I../common
|
INCLUDE = -I../include -I../common -I.
|
||||||
|
|
||||||
TAR=tar
|
TAR=tar
|
||||||
TARFLAGS = -C .. -rvf
|
TARFLAGS = -C .. -rvf
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "crc16.h"
|
#include "crc16.h"
|
||||||
|
|
||||||
// REQUEST FLAGS
|
// REQUEST FLAGS
|
||||||
|
|
||||||
#define ISO15_REQ_SUBCARRIER_SINGLE 0x00 // Tag should respond using one subcarrier (ASK)
|
#define ISO15_REQ_SUBCARRIER_SINGLE 0x00 // Tag should respond using one subcarrier (ASK)
|
||||||
#define ISO15_REQ_SUBCARRIER_TWO 0x01 // Tag should respond using two subcarriers (FSK)
|
#define ISO15_REQ_SUBCARRIER_TWO 0x01 // Tag should respond using two subcarriers (FSK)
|
||||||
#define ISO15_REQ_DATARATE_LOW 0x00 // Tag should respond using low data rate
|
#define ISO15_REQ_DATARATE_LOW 0x00 // Tag should respond using low data rate
|
||||||
|
@ -22,13 +21,11 @@
|
||||||
#define ISO15_REQ_PROTOCOL_EXT 0x08 // RFU
|
#define ISO15_REQ_PROTOCOL_EXT 0x08 // RFU
|
||||||
|
|
||||||
// REQUEST FLAGS when INVENTORY is not set
|
// REQUEST FLAGS when INVENTORY is not set
|
||||||
|
|
||||||
#define ISO15_REQ_SELECT 0x10 // only selected cards response
|
#define ISO15_REQ_SELECT 0x10 // only selected cards response
|
||||||
#define ISO15_REQ_ADDRESS 0x20 // this req contains an address
|
#define ISO15_REQ_ADDRESS 0x20 // this req contains an address
|
||||||
#define ISO15_REQ_OPTION 0x40 // Command specific option selector
|
#define ISO15_REQ_OPTION 0x40 // Command specific option selector
|
||||||
|
|
||||||
//REQUEST FLAGS when INVENTORY is set
|
//REQUEST FLAGS when INVENTORY is set
|
||||||
|
|
||||||
#define ISO15_REQINV_AFI 0x10 // AFI Field is present
|
#define ISO15_REQINV_AFI 0x10 // AFI Field is present
|
||||||
#define ISO15_REQINV_SLOT1 0x20 // 1 Slot
|
#define ISO15_REQINV_SLOT1 0x20 // 1 Slot
|
||||||
#define ISO15_REQINV_SLOT16 0x00 // 16 Slots
|
#define ISO15_REQINV_SLOT16 0x00 // 16 Slots
|
||||||
|
|
Loading…
Add table
Reference in a new issue