Skip to content

Commit

Permalink
samples: net: azure_iot_hub: fix device id
Browse files Browse the repository at this point in the history
Fix for device id.

Signed-off-by: Giacomo Dematteis <[email protected]>
  • Loading branch information
DematteisGiacomo committed Nov 14, 2023
1 parent 22d04f5 commit 4c3501d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions samples/net/azure_iot_hub/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,20 +507,22 @@ static int dps_run(struct azure_iot_hub_buf *hostname, struct azure_iot_hub_buf
int main(void)
{
int err;
char hostname[128] = CONFIG_AZURE_IOT_HUB_HOSTNAME;
char device_id[128] = CONFIG_AZURE_IOT_HUB_DEVICE_ID;
struct azure_iot_hub_config cfg = {
static char hostname[128] = CONFIG_AZURE_IOT_HUB_HOSTNAME;
static char device_id[128] = CONFIG_AZURE_IOT_HUB_DEVICE_ID;
static struct azure_iot_hub_config cfg = {
.device_id = {
.ptr = device_id,
.size = strlen(device_id),
},
.hostname = {
.ptr = hostname,
.size = strlen(hostname),
},
.use_dps = true,
};

cfg.device_id.size = strlen(device_id);
cfg.hostname.size = strlen(hostname);


LOG_INF("Azure IoT Hub sample started");

/* Setup handler for Zephyr NET Connection Manager events. */
Expand Down

0 comments on commit 4c3501d

Please sign in to comment.