adapted to latest changes in gwen, more work on data and nodes servers.
This commit is contained in:
@@ -51,6 +51,7 @@ AQHOMED *AqHomed_new(void)
|
||||
GWEN_NEW_OBJECT(AQHOMED, aqh);
|
||||
aqh->rootEndpoint=GWEN_MsgEndpoint_new("root", 0);
|
||||
aqh->nodeDb=AQH_NodeDb_new();
|
||||
aqh->requestTree=GWEN_MsgRequest_new();
|
||||
|
||||
return aqh;
|
||||
}
|
||||
@@ -60,6 +61,7 @@ AQHOMED *AqHomed_new(void)
|
||||
void AqHomed_free(AQHOMED *aqh)
|
||||
{
|
||||
if (aqh) {
|
||||
GWEN_MsgRequest_free(aqh->requestTree);
|
||||
GWEN_MsgEndpoint_free(aqh->rootEndpoint);
|
||||
aqh->rootEndpoint=NULL;
|
||||
aqh->ttyEndpoint=NULL;
|
||||
@@ -164,5 +166,56 @@ int AqHomed_GetTimeout(const AQHOMED *aqh)
|
||||
|
||||
|
||||
|
||||
GWEN_MSG_REQUEST *AqHomed_GetRequestTree(const AQHOMED *aqh)
|
||||
{
|
||||
return aqh?aqh->requestTree:NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AqHomed_AddRequestToTree(AQHOMED *aqh, GWEN_MSG_REQUEST *rq)
|
||||
{
|
||||
if (aqh && rq)
|
||||
GWEN_MsgRequest_Tree2_AddChild(aqh->requestTree, rq);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const AQHNODE_DEVICE_LIST *AqHomed_GetDeviceDefList(const AQHOMED *aqh)
|
||||
{
|
||||
return aqh?aqh->deviceDefList:NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const AQHNODE_DEVICE *AqHomed_FindDeviceDef(const AQHOMED *aqh, uint32_t manufacturer, uint16_t deviceType, uint16_t deviceVersion)
|
||||
{
|
||||
if (aqh && aqh->deviceDefList) {
|
||||
const AQHNODE_DEVICE *device;
|
||||
|
||||
device=AQHNODE_Device_List_First(aqh->deviceDefList);
|
||||
while(device) {
|
||||
if (AQHNODE_Device_GetManufacturer(device)==manufacturer &&
|
||||
AQHNODE_Device_GetDeviceType(device)==deviceType &&
|
||||
AQHNODE_Device_GetDeviceVersion(device)==(deviceVersion & 0xff00))
|
||||
return device;
|
||||
device=AQHNODE_Device_List_Next(device);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const AQHNODE_DEVICE *AqHomed_GetDeviceDefByName(const AQHOMED *aqh, const char *name)
|
||||
{
|
||||
if (aqh && aqh->deviceDefList && name)
|
||||
return AQHNODE_Device_List_GetByName(aqh->deviceDefList, name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user