add: split PacketResponseNG status to status and reason

This commit is contained in:
douniwan5788 2024-09-24 02:21:01 +08:00
commit 96d462acee
8 changed files with 36 additions and 16 deletions

View file

@ -84,8 +84,9 @@ typedef struct {
typedef struct {
uint32_t magic;
uint16_t length : 15; // length of the variable part, 0 if none.
bool ng : 1;
int16_t status;
bool ng : 1;
int8_t status;
int8_t reason;
uint16_t cmd;
} PACKED PacketResponseNGPreamble;
@ -101,7 +102,8 @@ typedef struct {
uint16_t cmd;
uint16_t length;
uint32_t magic; // NG
int16_t status; // NG
int8_t status; // NG
int8_t reason; // NG
uint16_t crc; // NG
uint64_t oldarg[3]; // OLD
union {
@ -869,6 +871,9 @@ typedef struct {
// Regular quit
#define PM3_SQUIT -100
// reserved for future protocol change
#define PM3_RESERVED -128
// LF
#define LF_FREQ2DIV(f) ((int)(((12000.0 + (f)/2.0)/(f))-1))
#define LF_DIVISOR_125 LF_FREQ2DIV(125)