added argument "DEVICENAME" to GETDEVICES request.
faster if only a specific device is requested.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_devices.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_values.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_getvalues.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_getdevices.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_getdata.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_multidata.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_setdata.h"
|
||||
@@ -113,6 +114,21 @@ int AQH_DataClient_ReadLocalArgs(AQH_DATACLIENT *dc,
|
||||
|
||||
|
||||
|
||||
int AQH_DataClient_ReadConfigFile(AQH_DATACLIENT *dc)
|
||||
{
|
||||
GWEN_DB_NODE *dbConfig;
|
||||
|
||||
dbConfig=AQH_LoadConfigFile();
|
||||
if (dbConfig) {
|
||||
GWEN_DB_Group_free(dc->dbLocalArgs);
|
||||
dc->dbLocalArgs=dbConfig;
|
||||
return 0;
|
||||
}
|
||||
return GWEN_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
||||
|
||||
GWEN_DB_NODE *AQH_DataClient_GetDbLocalArgs(const AQH_DATACLIENT *dc)
|
||||
{
|
||||
return dc?dc->dbLocalArgs:NULL;
|
||||
@@ -173,7 +189,7 @@ void AQH_DataClient_SetTimeout(AQH_DATACLIENT *dc, int i)
|
||||
|
||||
|
||||
|
||||
AQH_DEVICE_LIST *AQH_DataClient_GetDevices(AQH_DATACLIENT *dc)
|
||||
AQH_DEVICE_LIST *AQH_DataClient_GetDevices(AQH_DATACLIENT *dc, const char *deviceName)
|
||||
{
|
||||
if (dc) {
|
||||
AQH_MESSAGE *msgOut;
|
||||
@@ -183,7 +199,7 @@ AQH_DEVICE_LIST *AQH_DataClient_GetDevices(AQH_DATACLIENT *dc)
|
||||
|
||||
fullDeviceList=AQH_Device_List_new();
|
||||
msgId=++(dc->lastMsgId);
|
||||
msgOut=AQH_IpcMessage_new(dc->protoId, dc->protoVer, AQH_MSGTYPE_IPC_DATA_GETDEVICES_REQ, msgId, 0, 0, NULL);
|
||||
msgOut=AQH_IpcdMessageGetDevices_new(AQH_MSGTYPE_IPC_DATA_GETDEVICES_REQ, msgId, 0, deviceName);
|
||||
AQH_Endpoint_AddMsgOut(dc->ipcEndpoint, msgOut);
|
||||
|
||||
while( (msgIn=AQH_IpcEndpoint_WaitForResponseMsg(dc->ipcEndpoint, msgId, dc->timeoutInSeconds)) ) {
|
||||
|
||||
Reference in New Issue
Block a user