From 7b3276ee11780bccc7fcfcea5ff8aa9c02109379 Mon Sep 17 00:00:00 2001 From: Amin Ben Ramdhane Date: Thu, 31 Mar 2022 11:55:05 +0100 Subject: [PATCH] Add support for Device.WiFi.DataElements.Network.Device.{i}.MultiAPDevice.AssocIEEE1905DeviceRef parameter --- dmtree/tr181/ieee1905.c | 11 ++++++++++- dmtree/tr181/wifi.c | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dmtree/tr181/ieee1905.c b/dmtree/tr181/ieee1905.c index c32bb6a8..b6b8f0dd 100644 --- a/dmtree/tr181/ieee1905.c +++ b/dmtree/tr181/ieee1905.c @@ -18,6 +18,15 @@ struct ieee1905_device_nonieee1905neighbor_args char *neighbor; }; +/************************************************************************** +* LINKER +***************************************************************************/ +static int get_linker_IEEE1905Device(char *refparam, struct dmctx *dmctx, void *data, char *instance, char **linker) +{ + *linker = dmjson_get_value((json_object *)data, 1, "ieee1905id"); + return 0; +} + /************************************************************* * ENTRY METHOD **************************************************************/ @@ -1692,7 +1701,7 @@ DMLEAF tIEEE1905ALForwardingTableForwardingRuleParams[] = { DMOBJ tIEEE1905ALNetworkTopologyObj[] = { /* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/ //{"ChangeLog", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyChangeLogInst, NULL, NULL, NULL, tIEEE1905ALNetworkTopologyChangeLogParams, NULL, BBFDM_BOTH, NULL, "2.9"}, -{"IEEE1905Device", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceObj, tIEEE1905ALNetworkTopologyIEEE1905DeviceParams, NULL, BBFDM_BOTH, LIST_KEY{"IEEE1905Id", NULL}, "2.9"}, +{"IEEE1905Device", &DMREAD, NULL, NULL, NULL, browseIEEE1905ALNetworkTopologyIEEE1905DeviceInst, NULL, NULL, tIEEE1905ALNetworkTopologyIEEE1905DeviceObj, tIEEE1905ALNetworkTopologyIEEE1905DeviceParams, get_linker_IEEE1905Device, BBFDM_BOTH, LIST_KEY{"IEEE1905Id", NULL}, "2.9"}, {0} }; diff --git a/dmtree/tr181/wifi.c b/dmtree/tr181/wifi.c index c871bcd8..141aa590 100644 --- a/dmtree/tr181/wifi.c +++ b/dmtree/tr181/wifi.c @@ -5131,13 +5131,14 @@ static int get_WiFiDataElementsNetworkDeviceMultiAPDevice_LastContactTime(char * return 0; } -/* static int get_WiFiDataElementsNetworkDeviceMultiAPDevice_AssocIEEE1905DeviceRef(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { - *value = dmjson_get_value(((struct wifi_data_element_args *)data)->dump2_obj, 2, "MultiAPDevice", "AssocIEEE1905DeviceRef"); + char *device_id = dmjson_get_value(((struct wifi_data_element_args *)data)->dump2_obj, 1, "ID"); + adm_entry_get_linker_param(ctx, "Device.IEEE1905.AL.NetworkTopology.IEEE1905Device.", device_id, value); return 0; } +/* static int get_WiFiDataElementsNetworkDeviceMultiAPDevice_EasyMeshControllerOperationMode(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) { *value = dmjson_get_value(((struct wifi_data_element_args *)data)->dump2_obj, 2, "MultiAPDevice", "EasyMeshControllerOperationMode"); @@ -6753,7 +6754,7 @@ DMLEAF tWiFiDataElementsNetworkDeviceMultiAPDeviceParams[] = { /* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/ // {"ManufacturerOUI", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceMultiAPDevice_ManufacturerOUI, NULL, BBFDM_BOTH, "2.15"}, {"LastContactTime", &DMREAD, DMT_TIME, get_WiFiDataElementsNetworkDeviceMultiAPDevice_LastContactTime, NULL, BBFDM_BOTH, "2.15"}, -// {"AssocIEEE1905DeviceRef", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceMultiAPDevice_AssocIEEE1905DeviceRef, NULL, BBFDM_BOTH, "2.15"}, +{"AssocIEEE1905DeviceRef", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceMultiAPDevice_AssocIEEE1905DeviceRef, NULL, BBFDM_BOTH, "2.15"}, // {"EasyMeshControllerOperationMode", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceMultiAPDevice_EasyMeshControllerOperationMode, NULL, BBFDM_BOTH, "2.15"}, // {"EasyMeshAgentOperationMode", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceMultiAPDevice_EasyMeshAgentOperationMode, NULL, BBFDM_BOTH, "2.15"}, {0}