more work on IPC data protocol.
This commit is contained in:
@@ -53,7 +53,7 @@ GWEN_MSG *AQH_ValuesDataIpcMsg_new(uint16_t code, uint32_t flags, const AQH_VALU
|
||||
int count;
|
||||
int payloadSize;
|
||||
|
||||
count=AQH_Value_List_GetCount(valueList);
|
||||
count=valueList?AQH_Value_List_GetCount(valueList):0;
|
||||
payloadSize=AQH_MSGDATA_VALUES_OFFS_VALUES+(count*AQH_MSGDATA_VALUES_VALUES_SIZE);
|
||||
|
||||
msg=GWEN_IpcMsg_new(AQH_IPC_PROTOCOL_DATA_ID, AQH_IPC_PROTOCOL_DATA_VERSION, code, payloadSize, NULL);
|
||||
@@ -192,6 +192,22 @@ const char *AQH_ValuesDataIpcMsg_GetValueName(const GWEN_MSG *msg, int idx)
|
||||
|
||||
|
||||
|
||||
const char *AQH_ValuesDataIpcMsg_GetValueUnits(const GWEN_MSG *msg, int idx)
|
||||
{
|
||||
uint32_t pos;
|
||||
|
||||
pos=
|
||||
AQH_MSGDATA_VALUES_OFFS_VALUES+
|
||||
(idx*AQH_MSGDATA_VALUES_VALUES_SIZE)+
|
||||
AQH_MSGDATA_VALUES_VALUES_OFFS_UNITS;
|
||||
|
||||
if (GWEN_Msg_GetBytesInBuffer(msg)>=pos+GWEN_MSGIPC_OFFS_PAYLOAD)
|
||||
return (const char*) (GWEN_Msg_GetConstBuffer(msg)+GWEN_MSGIPC_OFFS_PAYLOAD+pos);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int AQH_ValuesDataIpcMsg_IsValid(const GWEN_MSG *msg)
|
||||
{
|
||||
int msgLen;
|
||||
|
||||
Reference in New Issue
Block a user