aqhome: Improved serial port handling, added parsers for different msg types.

This commit is contained in:
Martin Preuss
2023-02-04 00:58:28 +01:00
parent 7ac88f3fb9
commit 1620e4c0e5
14 changed files with 1117 additions and 211 deletions

View File

@@ -10,6 +10,7 @@
#define AQH_SERIAL_H
#include <aqhome/api.h>
#include "aqhome/msg.h"
#include <gwenhywfar/buffer.h>
@@ -24,7 +25,7 @@ extern "C" {
typedef struct AQH_SERIAL AQH_SERIAL;
typedef void (*AQH_SERIAL_PACKETRECEIVED_FN)(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len);
typedef void (*AQH_SERIAL_PACKETRECEIVED_FN)(AQH_SERIAL *sr, AQH_MSG *msg);
@@ -44,6 +45,8 @@ AQHOME_API int AQH_Serial_SendPacket(AQH_SERIAL *sr, uint8_t destAddr, const uin
AQHOME_API int AQH_Serial_Loop(AQH_SERIAL *sr);
AQHOME_API int AQH_Serial_AddMessageToSend(AQH_SERIAL *sr, AQH_MSG *msg);
AQHOME_API int AQH_Serial_StartWriting(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len);