ipc2: started working on event-based ipc handling.

This commit is contained in:
Martin Preuss
2025-01-09 01:42:19 +01:00
parent b2193afa46
commit acbe4505b9
11 changed files with 963 additions and 5 deletions

38
aqhome/ipc2/msgreader_p.h Normal file
View File

@@ -0,0 +1,38 @@
/****************************************************************************
* This file is part of the project AqHome.
* AqHome (c) by 2025 Martin Preuss, all rights reserved.
*
* The license for this file can be found in the file COPYING which you
* should have received along with this file.
****************************************************************************/
#ifndef AQH_MSGREADER_P_H
#define AQH_MSGREADER_P_H
#include "./msgreader.h"
#include <gwenhywfar/ringbuffer.h>
#define AQH_MSG_READER_RINGBUFFER_SIZE 1024
#define AQH_MSG_READER_HEADERBUFFER_SIZE 4
typedef struct AQH_MSG_READER AQH_MSG_READER;
struct AQH_MSG_READER {
int fdSocket;
AQH_OBJECT *fdObject;
GWEN_RINGBUFFER *ringBuffer;
int bytesReceived;
int bytesLeft;
uint8_t headerBuffer[AQH_MSG_READER_HEADERBUFFER_SIZE];
uint8_t *currentMsgBuf;
};
#endif