bitfield removed from esp32 fw

This commit is contained in:
Jelmer
2023-02-04 02:20:34 +01:00
parent 2be1b7d40e
commit c8eafdb3cb
2 changed files with 12 additions and 11 deletions

View File

@@ -29,14 +29,14 @@ struct blockData {
struct AvailDataReq {
uint8_t checksum;
uint8_t lastPacketLQI : 7;
uint8_t lastPacketRSSI : 7; // is negative
int8_t temperature : 7; // zero if not reported/not supported to be reported. else, this minus CHECKIN_TEMP_OFFSET is temp in degrees C
uint16_t batteryMv : 12;
uint8_t hwType : 5; // 32 types of tags supported
uint8_t wakeupReason : 2; // supports 4 types of wakeup reasons
uint8_t capabilities; // undefined, as of now
} __packed; // 7 bytes
uint8_t lastPacketLQI;
int8_t lastPacketRSSI;
int8_t temperature;
uint16_t batteryMv;
uint8_t hwType;
uint8_t wakeupReason;
uint8_t capabilities; // undefined, as of now
} __packed;
struct espAvailDataReq {
uint8_t checksum;
@@ -53,8 +53,8 @@ struct AvailDataInfo {
uint8_t checksum;
uint64_t dataVer; // MD5 of potential traffic
uint32_t dataSize;
uint8_t dataType : 4; // allows for 16 different datatypes
uint8_t dataTypeArgument : 4; // extra specification or instruction for the tag (LUT to be used for drawing image)
uint8_t dataType; // allows for 16 different datatypes
uint8_t dataTypeArgument; // extra specification or instruction for the tag (LUT to be used for drawing image)
uint16_t nextCheckIn; // when should the tag check-in again? Measured in minutes
} __packed;

View File

@@ -272,7 +272,8 @@ void processDataReq(struct espAvailDataReq* eadr) {
taginfo->lastseen = now;
taginfo->expectedNextCheckin = now + 300;
taginfo->button = (eadr->adr.wakeupReason==WAKEUP_REASON_GPIO);
Serial.printf("t=%d, lqi=%d, rssi=%d, ", eadr->adr.temperature, eadr->adr.lastPacketLQI, eadr->adr.lastPacketRSSI);
Serial.printf("hwtype=%d, reason=%d, volt=%d", eadr->adr.hwType,eadr->adr.wakeupReason,eadr->adr.batteryMv);
sprintf(buffer, "<ADR %02X%02X%02X%02X%02X%02X\n\0", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
Serial.print(buffer);
//wsString((String)buffer);