Parse SEND STATS message.

This commit is contained in:
Martin Preuss
2023-01-26 18:58:51 +01:00
parent e8e6df0fba
commit 74277a286b

View File

@@ -113,6 +113,23 @@ void _packetReceived(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len)
GWEN_Text_DumpString(ptr, len, 2); GWEN_Text_DumpString(ptr, len, 2);
GWEN_Time_free(ti); GWEN_Time_free(ti);
GWEN_Buffer_free(dbuf); GWEN_Buffer_free(dbuf);
if (ptr[2]==2) {
uint32_t secs;
int packetsOut;
int collisions;
int aborted;
/* send error stats */
secs=(ptr[4])+(ptr[5]<<8)+(ptr[6]<<16)+(ptr[7]<<24);
packetsOut=(ptr[8])+(ptr[9]<<8);
collisions=(ptr[10])+(ptr[11]<<8);
aborted=(ptr[12])+(ptr[13]<<8);
fprintf(stdout, " -> %08x packets sent=%d, collisions=%d, aborted=%d\n",
(unsigned int) secs,
packetsOut, collisions, aborted);
}
} }