aqhome: Prepared reorganizing IPC and nodes code around built-in event2 api.
This commit is contained in:
@@ -54,3 +54,5 @@ const char *AQH_IpcdMessage_MsgTypeToChar(uint16_t i)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#include <aqhome/api.h>
|
||||
#include <aqhome/ipc2/message.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
#define AQH_IPC_PROTOCOL_DATA_ID 2
|
||||
#define AQH_IPC_PROTOCOL_DATA_VERSION 1
|
||||
|
||||
@@ -59,6 +59,30 @@ AQH_MESSAGE *AQH_IpcdMessageDevices_new(uint16_t code, uint32_t msgId, uint32_t
|
||||
|
||||
|
||||
|
||||
AQH_MESSAGE *AQH_IpcdMessageDevices_newForOneDevice(uint16_t code, uint32_t msgId, uint32_t refMsgId,
|
||||
uint32_t flags, const AQH_DEVICE *device)
|
||||
{
|
||||
AQH_MESSAGE *msg;
|
||||
GWEN_BUFFER *buf;
|
||||
int rv;
|
||||
|
||||
buf=GWEN_Buffer_new(0, 256, 0, 1);
|
||||
GWEN_Tag16_WriteUint32TagToBuffer(AQH_MSGDATA_DEVICES_TAGS_FLAGS, flags, buf);
|
||||
rv=AQH_Tag16_WriteDeviceAsTagToBuffer(AQH_MSGDATA_DEVICES_TAGS_DEVICE, device, buf);
|
||||
if (rv<0) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "here (%d)", rv);
|
||||
GWEN_Buffer_free(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
msg=AQH_IpcMessage_new(AQH_IPC_PROTOCOL_DATA_ID, AQH_IPC_PROTOCOL_DATA_VERSION, code, msgId, refMsgId,
|
||||
GWEN_Buffer_GetUsedBytes(buf), (const uint8_t*) GWEN_Buffer_GetStart(buf));
|
||||
GWEN_Buffer_free(buf);
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
AQH_DEVICE_LIST *AQH_IpcdMessageDevices_ReadDeviceList(const GWEN_TAG16_LIST *tagList)
|
||||
{
|
||||
if (tagList) {
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcdMessageDevices_new(uint16_t code, uint32_t msgId, uint32_t refMsgId,
|
||||
uint32_t flags, const AQH_DEVICE_LIST *deviceList);
|
||||
AQHOME_API AQH_MESSAGE *AQH_IpcdMessageDevices_newForOneDevice(uint16_t code, uint32_t msgId, uint32_t refMsgId,
|
||||
uint32_t flags, const AQH_DEVICE *device);
|
||||
|
||||
AQHOME_API AQH_DEVICE_LIST *AQH_IpcdMessageDevices_ReadDeviceList(const GWEN_TAG16_LIST *tagList);
|
||||
AQHOME_API AQH_DEVICE *AQH_IpcdMessageDevices_ReadFirstDevice(const GWEN_TAG16_LIST *tagList);
|
||||
AQHOME_API uint32_t AQH_IpcdMessageDevices_GetFlags(const GWEN_TAG16_LIST *tagList);
|
||||
|
||||
Reference in New Issue
Block a user