More work on node/pc interface.
- added AQH_MSG_ENDPOINT - added AQH_MsgEndpointLog - added AQH_MsgEndpointTcp - added AQH_MsgEndpointTty - added AQH_MsgEndpointMgr
This commit is contained in:
26
aqhome/msg.c
26
aqhome/msg.c
@@ -51,6 +51,20 @@ void AQH_Msg_free(AQH_MSG *msg)
|
||||
|
||||
|
||||
|
||||
AQH_MSG *AQH_Msg_dup(const AQH_MSG *srcMsg)
|
||||
{
|
||||
AQH_MSG *msg;
|
||||
|
||||
msg=AQH_Msg_new();
|
||||
memmove(msg->buffer, srcMsg->buffer, AQH_MAXMSGSIZE);
|
||||
msg->bytesInBuffer=srcMsg->bytesInBuffer;
|
||||
msg->currentPos=srcMsg->currentPos;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t *AQH_Msg_GetBuffer(AQH_MSG *msg)
|
||||
{
|
||||
if (msg)
|
||||
@@ -230,6 +244,18 @@ int AQH_Msg_AddChecksum(AQH_MSG *msg)
|
||||
|
||||
|
||||
|
||||
void AQH_Msg_DumpToBuffer(const AQH_MSG *msg, GWEN_BUFFER *dbuf, const char *sText)
|
||||
{
|
||||
GWEN_Buffer_AppendArgs(dbuf,
|
||||
"0x%02x->0x%02x: %d %s\n",
|
||||
AQH_Msg_GetSourceAddress(msg),
|
||||
AQH_Msg_GetDestAddress(msg),
|
||||
AQH_Msg_GetMsgType(msg),
|
||||
sText);
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t _calcChecksum(const uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user