doc errors

This commit is contained in:
Philippe Teuwen 2019-04-20 10:34:54 +02:00
commit e4006a7563
4 changed files with 22 additions and 20 deletions

View file

@ -1567,7 +1567,7 @@ void __attribute__((noreturn)) AppMain(void) {
int16_t ret = receive_ng(&rx); int16_t ret = receive_ng(&rx);
if (ret == PM3_SUCCESS) { if (ret == PM3_SUCCESS) {
PacketReceived(&rx); PacketReceived(&rx);
} else if (ret != PM3_NODATA) { } else if (ret != PM3_ENODATA) {
Dbprintf("Error in frame reception"); Dbprintf("Error in frame reception");
// TODO DOEGOX if error, shall we resync ? // TODO DOEGOX if error, shall we resync ?
} }

View file

@ -158,7 +158,7 @@ static int16_t receive_ng_internal(PacketCommandNG *rx, uint32_t read_ng(uint8_t
PacketCommandNGRaw rx_raw; PacketCommandNGRaw rx_raw;
size_t bytes = read_ng((uint8_t *)&rx_raw.pre, sizeof(PacketCommandNGPreamble)); size_t bytes = read_ng((uint8_t *)&rx_raw.pre, sizeof(PacketCommandNGPreamble));
if (bytes == 0) if (bytes == 0)
return PM3_NODATA; return PM3_ENODATA;
if (bytes != sizeof(PacketCommandNGPreamble)) if (bytes != sizeof(PacketCommandNGPreamble))
return PM3_EIO; return PM3_EIO;
rx->magic = rx_raw.pre.magic; rx->magic = rx_raw.pre.magic;
@ -229,6 +229,6 @@ int16_t receive_ng(PacketCommandNG *rx) {
// Check if there is a FPC packet available // Check if there is a FPC packet available
return receive_ng_internal(rx, usart_read_ng, true); return receive_ng_internal(rx, usart_read_ng, true);
#else #else
return PM3_NODATA; return PM3_ENODATA;
#endif #endif
} }

View file

@ -174,7 +174,7 @@ Commands do WaitForResponseTimeoutW (or dl_it) which uses getReply to fetch resp
API transition API transition
============== ==============
In short, to mode from one format to the other, we need for each command: In short, to move from one format to the other, we need for each command:
* (client TX) SendCommandOLD -> SendCommandNG (with all stuff in ad-hoc structs in "data" field) * (client TX) SendCommandOLD -> SendCommandNG (with all stuff in ad-hoc structs in "data" field)
* (pm3 RX) PacketCommandNG parsing, from "oldarg" to only the "data" field * (pm3 RX) PacketCommandNG parsing, from "oldarg" to only the "data" field

View file

@ -393,39 +393,41 @@ typedef struct {
#define FLAG_NONEWLINE 0x0010 #define FLAG_NONEWLINE 0x0010
#define FLAG_NOPROMPT 0x0100 #define FLAG_NOPROMPT 0x0100
// Error codes // Error codes Usages:
// Success (no error) // Success (no error)
#define PM3_SUCCESS 0 #define PM3_SUCCESS 0
// Undefined error // Undefined error
#define PM3_EUNDEF -1 #define PM3_EUNDEF -1
// Invalid argument(s) // Invalid argument(s) client: user input parsing
#define PM3_EINVARG -2 #define PM3_EINVARG -2
// Operation not supported by device // Operation not supported by device client/pm3: probably only on pm3 once client becomes universal
#define PM3_EDEVNOTSUPP -3 #define PM3_EDEVNOTSUPP -3
// Operation timed out // Operation timed out client: no response in time from pm3
#define PM3_ETIMEOUT -4 #define PM3_ETIMEOUT -4
// Operation aborted (by user) // Operation aborted (by user) client/pm3: kbd/button pressed
#define PM3_EOPABORTED -5 #define PM3_EOPABORTED -5
// Not (yet) implemented // Not (yet) implemented client/pm3: TBD placeholder
#define PM3_ENOTIMPL -6 #define PM3_ENOTIMPL -6
// Error while RF transmission // Error while RF transmission client/pm3: fail between pm3 & card
#define PM3_ERFTRANS -7 #define PM3_ERFTRANS -7
// Input / output error // Input / output error pm3: error in client frame reception
#define PM3_EIO -8 #define PM3_EIO -8
// Buffer overflow // Buffer overflow client/pm3: specified buffer too large for the operation
#define PM3_EOVFLOW -9 #define PM3_EOVFLOW -9
// Software error // Software error client/pm3: e.g. error in parsing some data
#define PM3_ESOFT -10 #define PM3_ESOFT -10
// Flash error // Flash error client/pm3: error in RDV4 Flash operation
#define PM3_EFLASH -11 #define PM3_EFLASH -11
// Memory allocation error // Memory allocation error client: error in memory allocation (maybe also for pm3 BigBuff?)
#define PM3_EMALLOC -12 #define PM3_EMALLOC -12
// File error // File error client: error related to file access on host
#define PM3_EFILE -13 #define PM3_EFILE -13
// No data
#define PM3_NODATA -98 // No data pm3: reserved, no host frame available (not really an error)
// Quit program #define PM3_ENODATA -98
// Quit program client: reserved, order to quit the program
#define PM3_EFATAL -99 #define PM3_EFATAL -99