AqHome: Added a test for sending/receiving asynchronously.

This commit is contained in:
Martin Preuss
2023-01-25 21:47:06 +01:00
parent 7b769807bd
commit 22d96dbab0
4 changed files with 273 additions and 3 deletions

View File

@@ -24,6 +24,10 @@ extern "C" {
typedef struct AQH_SERIAL AQH_SERIAL;
typedef void (*AQH_SERIAL_PACKETRECEIVED_FN)(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len);
AQHOME_API AQH_SERIAL *AQH_Serial_new(const char *deviceName, uint8_t addr);
AQHOME_API void AQH_Serial_free(AQH_SERIAL *sr);
@@ -39,6 +43,13 @@ AQHOME_API int AQH_Serial_Send(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len);
AQHOME_API int AQH_Serial_SendPacket(AQH_SERIAL *sr, uint8_t destAddr, const uint8_t *ptr, uint8_t len);
AQHOME_API int AQH_Serial_Loop(AQH_SERIAL *sr);
AQHOME_API int AQH_Serial_StartWriting(AQH_SERIAL *sr, const uint8_t *ptr, uint8_t len);
AQHOME_API void AQH_Serial_SetPacketReceivedFn(AQH_SERIAL *sr, AQH_SERIAL_PACKETRECEIVED_FN fn);
#ifdef __cplusplus
}
#endif