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

@@ -11,6 +11,7 @@
#include "aqhome/serial.h"
#include <termios.h>
#include <inttypes.h>
@@ -22,14 +23,14 @@ struct AQH_SERIAL {
char *deviceName;
int fd;
uint8_t address;
int intendedAttnState;
uint8_t readBuffer[AQH_SERIAL_BUFFERSIZE];
uint8_t bytesToRead;
uint8_t readPos;
AQH_MSG *currentlyReceivedMsg;
uint8_t writeBuffer[AQH_SERIAL_BUFFERSIZE];
uint8_t bytesToWrite;
uint8_t writePos;
AQH_MSG_LIST *receivedMessageList;
AQH_MSG_LIST *sendMessageList;
struct termios previousOptions;
AQH_SERIAL_PACKETRECEIVED_FN packetReceivedFn;
};