Save DeviceId structure from inform request.
This commit is contained in:
1 parent
0dac040b63
commit
291efc0097
1 file changed
+5
-1
+5
-1
@@ -206,7 +206,11 @@ inform = (currentRequest, cwmpRequest) ->
|
|||||||
updateAndRespond()
|
updateAndRespond()
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
db.devicesCollection.insert({_id : currentRequest.deviceId, _registered : now}, (err) ->
|
deviceIdDetails = {}
|
||||||
|
for k, v of cwmpRequest.methodRequest.deviceId
|
||||||
|
deviceIdDetails["_#{k}"] = v
|
||||||
|
|
||||||
|
db.devicesCollection.insert({_id : currentRequest.deviceId, _registered : now, _deviceId : deviceIdDetails}, (err) ->
|
||||||
throw err if err
|
throw err if err
|
||||||
util.log("#{currentRequest.deviceId}: New device registered")
|
util.log("#{currentRequest.deviceId}: New device registered")
|
||||||
_tasks.push({device: currentRequest.deviceId, name : 'refreshObject', objectName : ''})
|
_tasks.push({device: currentRequest.deviceId, name : 'refreshObject', objectName : ''})
|
||||||
|
|||||||
Reference in new issue
Block a user