From 74277a286ba2a4e1d79f1cc85bbc0fe30c4a9534 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 26 Jan 2023 18:58:51 +0100 Subject: [PATCH] Parse SEND STATS message. --- aqhome/libtest.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aqhome/libtest.c b/aqhome/libtest.c index 5110a79..2636d77 100644 --- a/aqhome/libtest.c +++ b/aqhome/libtest.c @@ -113,6 +113,23 @@ void _packetReceived(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len) GWEN_Text_DumpString(ptr, len, 2); GWEN_Time_free(ti); 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); + } + }