Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,21 @@
[submodule ".\\avnet_rsl10_2devices\\HardwareDefinitions"]
path = .\\avnet_rsl10_2devices\\HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
[submodule "avnet_lightranger5/AzureSphereDevX"]
path = avnet_lightranger5/AzureSphereDevX
[submodule "avnet_sensors_converge/avnet_lightranger5/AzureSphereDevX"]
path = avnet_sensors_converge/avnet_lightranger5/AzureSphereDevX
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.git
[submodule "avnet_lightranger5/HardwareDefinitions"]
path = avnet_lightranger5/HardwareDefinitions
[submodule "avnet_sensors_converge/avnet_lightranger5/HardwareDefinitions"]
path = avnet_sensors_converge/avnet_lightranger5/HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
[submodule "avnet_sensors_converge/avnet_tempHum13/AzureSphereDevX"]
path = avnet_sensors_converge/avnet_tempHum13/AzureSphereDevX
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.git
[submodule "avnet_sensors_converge/avnet_tempHum13/HardwareDefinitions"]
path = avnet_sensors_converge/avnet_tempHum13/HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
[submodule "avnet_rsl10_2devices/AzureSphereDevX"]
path = avnet_rsl10_2devices/AzureSphereDevX
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.git
[submodule "avnet_rsl10_2devices/HardwareDefinitions"]
path = avnet_rsl10_2devices/HardwareDefinitions
url = https://github.com/Azure-Sphere-DevX/AzureSphereDevX.HardwareDefinitions.git
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"code": "AVTe2f",
"name": "AVT EndtoEnd21",
"authType": 2,
"description": "2.1 Device template for the DevX avnet_end_to_end example.",
"isIotEdgeEnable": false,
"attributes": [
{
"name": "Temperature",
"type": "DECIMAL",
"description": null,
"unit": "Degrees C"
},
{
"name": "Humidity",
"type": "DECIMAL",
"description": null,
"unit": "% moisture"
},
{
"name": "Pressure",
"type": "DECIMAL",
"description": null,
"unit": null
},
{
"name": "MsgId",
"type": "INTEGER"
}
],
"settings": [
{
"name": "Software Version",
"type": "STRING",
"localName": "SoftwareVersion",
"defaultValue": "\"\"",
"isReadOnly": true
},
{
"name": "Timestamp of last startup",
"type": "STRING",
"localName": "DeviceStartUtc",
"defaultValue": "\" \"",
"isReadOnly": true
},
{
"name": "Current UTC time for device twin update",
"type": "STRING",
"localName": "ReportedUTC",
"defaultValue": "\"\"",
"isReadOnly": true
},
{
"name": "Timestamp of last connection",
"type": "STRING",
"localName": "DeviceConnectUtc",
"defaultValue": "\" \"",
"isReadOnly": true
},
{
"name": "Reported Humidity",
"type": "DECIMAL",
"localName": "ReportedHumidity",
"defaultValue": "0",
"isReadOnly": true
},
{
"name": "Desired Sample Rate",
"type": "INTEGER",
"localName": "DesiredSampleRate",
"defaultValue": "75",
"dataValidation": "0 to 120",
"isReadOnly": false
},
{
"name": "Reported Temperature",
"type": "DECIMAL",
"localName": "ReportedTemperature",
"defaultValue": "0",
"isReadOnly": true
}
],
"messageVersion": "2.1",
"dataFrequency": 60
}
8 changes: 4 additions & 4 deletions avnet_end_to_end/app_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"Name": "avnet_end_to_end",
"ComponentId": "b217fd65-ac8d-4d7c-b62c-0d07b5df6357",
"EntryPoint": "/bin/app",
"CmdArgs": [ "--ScopeID", "REPLACE_WITH_YOUR_ID_SCOPE" ],
"CmdArgs": [ "--ScopeID", "0ne001DB429" ],
"Capabilities": {
"Gpio": [ "$NETWORK_CONNECTED_LED", "$LED2" ],
"AllowedConnections": [
"global.azure-devices-provisioning.net",
"REPLACE_WITH_YOUR_IOT_HUB_ENDPOINT_URL"
"poc-iotc-sphere-iothub-eu.azure-devices.net"
],
"DeviceAuthentication": "REPLACE_WITH_YOUR_AZURE_SPHERE_TENANT_ID"
"DeviceAuthentication": "8d34f65c-532e-4dcf-a1d6-3e811c1e5c68"
},
"ApplicationType": "Default"
}
}
7 changes: 4 additions & 3 deletions avnet_end_to_end/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static DX_TIMER_HANDLER(publish_message_handler)
if (dx_isAvnetConnected()) {

// Serialize telemetry as JSON
bool serialization_result = dx_avnetJsonSerialize(msgBuffer, sizeof(msgBuffer), NULL, 4,
bool serialization_result = dx_jsonSerialize(msgBuffer, sizeof(msgBuffer), 4,
DX_JSON_INT, "MsgId", msgId++,
DX_JSON_DOUBLE, "Temperature", temperature,
DX_JSON_DOUBLE, "Humidity", humidity,
Expand All @@ -54,7 +54,7 @@ static DX_TIMER_HANDLER(publish_message_handler)

Log_Debug("%s\n", msgBuffer);

dx_azurePublish(msgBuffer, strlen(msgBuffer), messageProperties, NELEMS(messageProperties), &contentProperties);
dx_avnetPublish(msgBuffer, strlen(msgBuffer), messageProperties, NELEMS(messageProperties), &contentProperties, NULL);

} else {
Log_Debug("JSON Serialization failed: Buffer too small\n");
Expand All @@ -69,7 +69,7 @@ static DX_TIMER_HANDLER(report_properties_handler)
float temperature = 25.05f;
double humidity = 60.25;

if (dx_isAzureConnected()) {
if (dx_isAvnetConnected()) {

// Update twin with current UTC (Universal Time Coordinate) in ISO format
dx_deviceTwinReportValue(&dt_reported_utc, dx_getCurrentUtc(msgBuffer, sizeof(msgBuffer)));
Expand Down Expand Up @@ -152,6 +152,7 @@ static void NetworkConnectionState(bool connected)
/// </summary>
static void InitPeripheralsAndHandlers(void)
{
dx_avnetSetDebugLevel(AVT_DEBUG_LEVEL_VERBOSE); // comment out to supress IoTConnect debug
dx_avnetConnect(&dx_config, NETWORK_INTERFACE);
dx_gpioSetOpen(gpio_bindings, NELEMS(gpio_bindings));
dx_timerSetStart(timer_bindings, NELEMS(timer_bindings));
Expand Down
1 change: 1 addition & 0 deletions avnet_end_to_end/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "app_exit_codes.h"
#include "dx_azure_iot.h"
#include "dx_avnet_iot_connect.h"
#include "dx_config.h"
#include "dx_json_serializer.h"
#include "dx_terminate.h"
Expand Down
13 changes: 7 additions & 6 deletions avnet_gw_send_message/app_manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"SchemaVersion": 1,
"Name": "avnet_gateway_example",
"ComponentId": "353d8b5e-d3ab-43f7-b65a-10f14b766d21",
"Name": "avnet_end_to_end",
"ComponentId": "b217fd65-ac8d-4d7c-b62c-0d07b5df6357",
"EntryPoint": "/bin/app",
"CmdArgs": ["--ScopeID", "REPLACE_WITH_YOUR_ID_SCOPE"],
"CmdArgs": [ "--ScopeID", "0ne001DB429" ],
"Capabilities": {
"Gpio": [ "$NETWORK_CONNECTED_LED", "$LED2" ],
"AllowedConnections": [
"global.azure-devices-provisioning.net",
"REPLACE_WITH_YOUR_IOT_HUB_ENDPOINT_URL"
"poc-iotc-sphere-iothub-eu.azure-devices.net"
],
"DeviceAuthentication": "REPLACE_WITH_YOUR_AZURE_SPHERE_TENANT_ID"
"DeviceAuthentication": "8d34f65c-532e-4dcf-a1d6-3e811c1e5c68"
},
"ApplicationType": "Default"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"code": "devXDemo21",
"name": "devXDemo21",
"tag": "spheregwdevice",
"authType": 2,
"isIotEdgeEnable": false,
"attributes": [
{
"name": "temperature",
"type": "DECIMAL",
"tag": "temperaturechilddevice",
"unit": "C"
},
{
"name": "humidity",
"type": "DECIMAL",
"tag": "humiditychilddevice",
"unit": "% moisture"
},
{
"name": "pressure",
"type": "DECIMAL",
"tag": "pressurechilddevice",
"unit": "psi"
}
],
"dataFrequency": 60,
"messageVersion": "2.1",
"msgCode": "138913Y"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"code": "devXDemo",
"name": "devXDemo",
"tag": "spheregwdevice",
"authType": 2,
"description": null,
"isIotEdgeEnable": false,
"attributes": [
{
"name": "temperature",
"type": "NUMBER",
"tag": "temperaturechilddevice",
"description": null,
"unit": "C"
},
{
"name": "humidity",
"type": "NUMBER",
"tag": "humiditychilddevice",
"description": null,
"unit": "% moisture"
},
{
"name": "pressure",
"type": "NUMBER",
"tag": "pressurechilddevice",
"description": null,
"unit": "psi"
}
],
"dataFrequency": 60,
"messageVersion": "1.0",
"msgCode": "1389TEE"
}
5 changes: 3 additions & 2 deletions avnet_gw_send_message/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ DX_TIMER_HANDLER_END
/// </summary>
static void InitPeripheralsAndHandlers(void)
{
dx_avnetSetDebugLevel(AVT_DEBUG_LEVEL_INFO); // Comment out to supress IoTConnect debug
dx_avnetConnect(&dx_config, NETWORK_INTERFACE);
dx_timerSetStart(timers, NELEMS(timers));
dx_deviceTwinSubscribe(device_twin_bindings, NELEMS(device_twin_bindings));
Expand Down Expand Up @@ -181,13 +182,13 @@ void sendChildDeviceTelemetry(const char* id, const char* key, float value){

// Create serialized telemetry as JSON
bool serialization_result =
dx_avnetJsonSerialize(msgBuffer, sizeof(msgBuffer), dx_avnetFindChild(id), 1,
dx_jsonSerialize(msgBuffer, sizeof(msgBuffer), 1,
DX_JSON_DOUBLE, key, value);

if (serialization_result) {

Log_Debug("%s\n", msgBuffer);
dx_azurePublish(msgBuffer, strlen(msgBuffer), NULL, 0, NULL);
dx_avnetPublish(msgBuffer, strlen(msgBuffer), NULL, 0, NULL, dx_avnetFindChild(id));

} else {
Log_Debug("JSON Serialization failed: Buffer too small\n");
Expand Down
1 change: 0 additions & 1 deletion avnet_lightranger5/AzureSphereDevX
Submodule AzureSphereDevX deleted from 32fb21
16 changes: 9 additions & 7 deletions avnet_rsl10_2devices/app_manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"SchemaVersion": 1,
"Name": "AvnetRSL10Example",
"Name": "avnet_end_to_end",
"ComponentId": "b217fd65-ac8d-4d7c-b62c-0d07b5df6357",
"EntryPoint": "/bin/app",
"CmdArgs": [ "--ScopeID", "" ],
"CmdArgs": [ "--ScopeID", "0ne001DB429" ],
"Capabilities": {
"Gpio": [
"$SAMPLE_RGBLED_RED",
"$SAMPLE_RGBLED_GREEN",
"$SAMPLE_RGBLED_BLUE"],
"Uart": ["$SAMPLE_PMOD_UART"],
"AllowedConnections": ["global.azure-devices-provisioning.net",
"ENTER.IOT.HUB.HOSTNAME.net"],
"DeviceAuthentication": "00000000-0000-0000-0000-000000000000",
"NetworkConfig": true
"NetworkConfig": true,
"AllowedConnections": [
"global.azure-devices-provisioning.net",
"poc-iotc-sphere-iothub-eu.azure-devices.net"
],
"DeviceAuthentication": "8d34f65c-532e-4dcf-a1d6-3e811c1e5c68"
},
"ApplicationType": "Default"
}
}
1 change: 1 addition & 0 deletions avnet_rsl10_2devices/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ static void InitPeripheralsAndHandlers(void)
#endif // USE_WEB_PROXY

#ifdef USE_IOT_CONNECT
dx_avnetSetDebugLevel(AVT_DEBUG_LEVEL_INFO); // Comment out to supress IoTConnect Debug
dx_avnetConnect(&dx_config, NETWORK_INTERFACE);
#else
dx_azureConnect(&dx_config, NETWORK_INTERFACE, IOT_PLUG_AND_PLAY_MODEL_ID);
Expand Down
Loading