diff --git a/LoRaEngine/LoraKeysManagerFacade/CreateEdgeDevice.cs b/LoRaEngine/LoraKeysManagerFacade/CreateEdgeDevice.cs index 9f384e69f..23c1b7b30 100644 --- a/LoRaEngine/LoraKeysManagerFacade/CreateEdgeDevice.cs +++ b/LoRaEngine/LoraKeysManagerFacade/CreateEdgeDevice.cs @@ -27,6 +27,7 @@ namespace LoraKeysManagerFacade private const string NetworkTagName = "network"; private const string HostAddressPropertyName = "hostAddress"; private const string NetworkId = "quickstartnetwork"; + private const string ProcessingDelayPropertyName = "ProcessingDelayInMilliseconds"; private static readonly Uri DefaultHostAddress = new Uri("ws://mylns:5000"); private readonly RegistryManager registryManager; private readonly IHttpClientFactory httpClientFactory; @@ -64,6 +65,7 @@ namespace LoraKeysManagerFacade // optional arguments _ = queryStrings.TryGetValue("spiSpeed", out var spiSpeed); _ = queryStrings.TryGetValue("spiDev", out var spiDev); + _ = queryStrings.TryGetValue("processingDelay", out var processingDelay); _ = bool.TryParse(Environment.GetEnvironmentVariable("DEPLOY_DEVICE"), out var deployEndDevice); @@ -142,6 +144,7 @@ namespace LoraKeysManagerFacade var twin = new Twin(); twin.Properties.Desired = new TwinCollection($"{{FacadeServerUrl:'https://{GetEnvironmentVariable("FACADE_HOST_NAME")}.azurewebsites.net/api/',FacadeAuthCode: '{facadeKey}'}}"); twin.Properties.Desired[HostAddressPropertyName] = DefaultHostAddress; + twin.Properties.Desired[ProcessingDelayPropertyName] = processingDelay; twin.Tags[NetworkTagName] = NetworkId; var remoteTwin = await this.registryManager.GetTwinAsync(deviceName); diff --git a/Template/azuredeploy.json b/Template/azuredeploy.json index a9f2c179d..5d5bb9a91 100644 --- a/Template/azuredeploy.json +++ b/Template/azuredeploy.json @@ -80,6 +80,13 @@ "metadata": { "description": "Controls whether the standalone discovery service should be deployed." } + }, + "processingDelay" : { + "type": "int", + "metadata": { + "defaultValue": 400, + "description": "Processing delay (in milliseconds) to be used in a Network Server which does not own a connection for a leaf device" + } } }, "variables": { @@ -291,6 +298,9 @@ }, "stationEui": { "value": "[parameters('stationEui')]" + }, + "processingDelay": { + "value": "[parameters('processingDelay')]" } } } diff --git a/Template/createEdgeDevice.json b/Template/createEdgeDevice.json index 557e3947e..c29eb0746 100644 --- a/Template/createEdgeDevice.json +++ b/Template/createEdgeDevice.json @@ -60,6 +60,13 @@ "metadata": { "description": "The StationEUI of the sample concentrator device" } + }, + "processingDelay" : { + "type": "int", + "metadata": { + "defaultValue": 400, + "description": "Processing delay (in milliseconds) to be used in a Network Server which does not own a connection for a leaf device" + } } }, "variables": { @@ -73,7 +80,7 @@ "properties": { "mode": "Incremental", "templateLink": { - "uri": "[Concat(listsecrets(resourceId('Microsoft.Web/sites/functions', concat(parameters('solutionPrefix'), 'function'), 'CreateEdgeDevice'),'2015-08-01').trigger_url,'®ion=',parameters('region'),'&resetPin=',parameters('resetPin'),'&stationEui=',parameters('stationEui'),'&spiDev=',parameters('spiDev'),'&spiSpeed=',parameters('spiSpeed'),'&deviceName=',parameters('edgeGatewayName'),'&publishingUserName=', list(resourceId('Microsoft.Web/sites/config', variables('functionAppName'), 'publishingcredentials'), '2016-08-01').properties.publishingUserName,'&publishingPassword=',list(resourceId('Microsoft.Web/sites/config', variables('functionAppName'), 'publishingcredentials'), '2016-08-01').properties.publishingPassword)]", + "uri": "[Concat(listsecrets(resourceId('Microsoft.Web/sites/functions', concat(parameters('solutionPrefix'), 'function'), 'CreateEdgeDevice'),'2015-08-01').trigger_url,'®ion=',parameters('region'),'&resetPin=',parameters('resetPin'),'&stationEui=',parameters('stationEui'),'&spiDev=',parameters('spiDev'),'&spiSpeed=',parameters('spiSpeed'),'&deviceName=',parameters('edgeGatewayName'),'&processingDelay=',parameters('processingDelay'),'&publishingUserName=', list(resourceId('Microsoft.Web/sites/config', variables('functionAppName'), 'publishingcredentials'), '2016-08-01').properties.publishingUserName,'&publishingPassword=',list(resourceId('Microsoft.Web/sites/config', variables('functionAppName'), 'publishingcredentials'), '2016-08-01').properties.publishingPassword)]", "contentVersion": "1.0.0.0" } }