Parse SEND STATS message.
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user