add processing delay to the deploy template

This commit is contained in:
Maggie Salak 2022-03-02 17:31:11 +01:00
Родитель a0b7f95c56
Коммит 0b1225ceee
3 изменённых файлов: 21 добавлений и 1 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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')]"
}
}
}

Просмотреть файл

@ -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,'&region=',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,'&region=',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"
}
}