aqhome: started reworking message code to use gwen's new msgio code.
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
|
||||
GWEN_INHERIT(AQH_MSG_ENDPOINT, AQH_MSG_ENDPOINT_LOG)
|
||||
GWEN_INHERIT(AQH_MSG_ENDPOINT, AQH_MSG_ENDPOINT_LOG_OLD)
|
||||
|
||||
|
||||
static void GWENHYWFAR_CB _freeData(void *bp, void *p);
|
||||
@@ -45,12 +45,12 @@ AQH_MSG_ENDPOINT *AQH_MsgEndpointLog_new(const char *filename)
|
||||
{
|
||||
int fd;
|
||||
AQH_MSG_ENDPOINT *ep;
|
||||
AQH_MSG_ENDPOINT_LOG *xep;
|
||||
AQH_MSG_ENDPOINT_LOG_OLD *xep;
|
||||
|
||||
ep=AQH_MsgEndpoint_new(-1, AQH_MSG_ENDPOINT_ENDPOINTGROUP_NET, "LOG");
|
||||
GWEN_NEW_OBJECT(AQH_MSG_ENDPOINT_LOG, xep);
|
||||
GWEN_NEW_OBJECT(AQH_MSG_ENDPOINT_LOG_OLD, xep);
|
||||
xep->filename=strdup(filename);
|
||||
GWEN_INHERIT_SETDATA(AQH_MSG_ENDPOINT, AQH_MSG_ENDPOINT_LOG, ep, xep, _freeData);
|
||||
GWEN_INHERIT_SETDATA(AQH_MSG_ENDPOINT, AQH_MSG_ENDPOINT_LOG_OLD, ep, xep, _freeData);
|
||||
AQH_MsgEndpoint_SetAcceptedEndpointGroups(ep, AQH_MSG_ENDPOINT_ENDPOINTGROUP_BUS);
|
||||
AQH_MsgEndpoint_SetAcceptedMsgGroups(ep, AQH_MSG_ENDPOINT_MSGGROUP_ALL);
|
||||
AQH_MsgEndpoint_AddFlags(ep, AQH_MSG_ENDPOINT_FLAGS_NOIO);
|
||||
@@ -63,9 +63,9 @@ AQH_MSG_ENDPOINT *AQH_MsgEndpointLog_new(const char *filename)
|
||||
|
||||
void _freeData(void *bp, void *p)
|
||||
{
|
||||
AQH_MSG_ENDPOINT_LOG *xep;
|
||||
AQH_MSG_ENDPOINT_LOG_OLD *xep;
|
||||
|
||||
xep=(AQH_MSG_ENDPOINT_LOG*) p;
|
||||
xep=(AQH_MSG_ENDPOINT_LOG_OLD*) p;
|
||||
free(xep->filename);
|
||||
GWEN_FREE_OBJECT(xep);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void _run(AQH_MSG_ENDPOINT *ep)
|
||||
|
||||
void _logMessage(AQH_MSG_ENDPOINT *ep, const AQH_MSG *msg)
|
||||
{
|
||||
AQH_MSG_ENDPOINT_LOG *xep;
|
||||
AQH_MSG_ENDPOINT_LOG_OLD *xep;
|
||||
const uint8_t *ptr;
|
||||
uint8_t len;
|
||||
uint8_t msgType;
|
||||
@@ -104,7 +104,7 @@ void _logMessage(AQH_MSG_ENDPOINT *ep, const AQH_MSG *msg)
|
||||
GWEN_BUFFER *dbuf;
|
||||
GWEN_TIME *ti;
|
||||
|
||||
xep=GWEN_INHERIT_GETDATA(AQH_MSG_ENDPOINT, AQH_MSG_ENDPOINT_LOG, ep);
|
||||
xep=GWEN_INHERIT_GETDATA(AQH_MSG_ENDPOINT, AQH_MSG_ENDPOINT_LOG_OLD, ep);
|
||||
dbuf=GWEN_Buffer_new(0, 256, 0, 1);
|
||||
ti=GWEN_CurrentTime();
|
||||
GWEN_Time_toString(ti, "YYYY-MM-DD hh:mm:ss ", dbuf);
|
||||
|
||||
Reference in New Issue
Block a user