Support for TR-181 data model when looking for ConnectionRequestURL and SoftwareVersion parameters.

This commit is contained in:
Zaid Abdulla committed 2014-07-25 22:33:12 +03:00
1 parent 4c0c590791
commit 4add20fe82
2 files changed
+17 -3

No files matched your search

+5 -1
View File
@@ -84,6 +84,7 @@ exports.getDevicePreset = (deviceId, presets, objects, aliases, callback) ->
if commandfile of deviceCustomCommands
projection["_customCommands.#{c.command.split(' ', 1)}"] = 1
when 'software_version'
projection['Device.DeviceInfo.SoftwareVersion'] = 1
projection['InternetGatewayDevice.DeviceInfo.SoftwareVersion'] = 1
when 'add_tag', 'delete_tag'
projection['_tags'] = 1
@@ -204,7 +205,10 @@ exports.getDevicePreset = (deviceId, presets, objects, aliases, callback) ->
when 'software_version'
devicePreset.softwareVersion ?= {}
devicePreset.softwareVersion.preset = c.software_version
devicePreset.softwareVersion.current = common.getParamValueFromPath(device, 'InternetGatewayDevice.DeviceInfo.SoftwareVersion')
if device?.Device? # TR-181 data model
devicePreset.softwareVersion.current = common.getParamValueFromPath(device, 'Device.DeviceInfo.SoftwareVersion')
else # TR-098 data model
devicePreset.softwareVersion.current = common.getParamValueFromPath(device, 'InternetGatewayDevice.DeviceInfo.SoftwareVersion')
else
throw new Error('Unknown configuration type')