Skip to content

Adding pnp set telemetry call to samples. #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ void setup()
ArduinoBearSSL.onGetTime(get_time); // Required for server trusted root validation.

azure_pnp_init();
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);

/*
* The configuration structure used by Azure IoT must remain unchanged (including data buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// After that, the sample automatically generates a new password and re-connects.
#define IOT_CONFIG_MQTT_PASSWORD_LIFETIME_IN_MINUTES 60

// Publish 1 message every 10 seconds.
#define TELEMETRY_FREQUENCY_IN_SECONDS 10

// Time Zone Offset
#define IOT_CONFIG_TIME_ZONE -8
#define IOT_CONFIG_TIME_ZONE_DAYLIGHT_SAVINGS_DIFF 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ void setup()
ArduinoBearSSL.onGetTime(get_time); // Required for server trusted root validation.

azure_pnp_init();
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);

/*
* The configuration structure used by Azure IoT must remain unchanged (including data buffer)
* throughout the lifetime of the sample. This variable must also not lose context so other
Expand Down
3 changes: 3 additions & 0 deletions examples/Azure_IoT_Central_Arduino_Portenta_H7/iot_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// After that, the sample automatically generates a new password and re-connects.
#define IOT_CONFIG_MQTT_PASSWORD_LIFETIME_IN_MINUTES 60

// Publish 1 message every 10 seconds.
#define TELEMETRY_FREQUENCY_IN_SECONDS 10

// Time Zone Offset
#define IOT_CONFIG_TIME_ZONE -8
#define IOT_CONFIG_TIME_ZONE_DAYLIGHT_SAVINGS_DIFF 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ void setup()
sync_device_clock_with_ntp_server();

azure_pnp_init();
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);

configure_azure_iot();
azure_iot_start(&azure_iot);
Expand Down
4 changes: 2 additions & 2 deletions examples/Azure_IoT_Central_ESP32/iot_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
// please update the suffix with the format '(ard;<platform>)' as an url-encoded string.
#define AZURE_SDK_CLIENT_USER_AGENT "c%2F" AZ_SDK_VERSION_STRING "(ard%3Besp32)"

// Publish 1 message every 2 seconds.
#define TELEMETRY_FREQUENCY_IN_SECONDS 2
// Publish 1 message every 10 seconds.
#define TELEMETRY_FREQUENCY_IN_SECONDS 10

// For how long the MQTT password (SAS token) is valid, in minutes.
// After that, the sample automatically generates a new password and re-connects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ void setup()
sync_device_clock_with_ntp_server();

azure_pnp_init();
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);

/*
* The configuration structure used by Azure IoT must remain unchanged (including data buffer)
Expand Down
4 changes: 2 additions & 2 deletions examples/Azure_IoT_Central_ESP32_AzureIoTKit/iot_configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
// please update the suffix with the format '(ard;<platform>)' as an url-encoded string.
#define AZURE_SDK_CLIENT_USER_AGENT "c%2F" AZ_SDK_VERSION_STRING "(ard%3Besp32)"

// Publish 1 message every 2 seconds.
#define TELEMETRY_FREQUENCY_IN_SECONDS 2
// Publish 1 message every 10 seconds.
#define TELEMETRY_FREQUENCY_IN_SECONDS 10

// For how long the MQTT password (SAS token) is valid, in minutes.
// After that, the sample automatically generates a new password and re-connects.
Expand Down