Skip to content

Commit 250bb36

Browse files
authored
Reconnect logic (#302)
* expand nx_context for DPS * reconnect logic initial stm impl * update gcc arm and cmake * update to latest GCC * updated stm wifi reconnect logic * fix clang format * remove old code, update pipeline * update stm pipeline, remove old code * Create seperate hub and dps entry points to allow linker optimisation if DPS is not used. * update SAME54 * fix updating period timer doesnt accidently start the timer if its in stopped state. * update nxp1060 * update nxp 1050 * fix stm compile errors * update RX65N * fix 1060 pipeline * fix same54 pipeline and rx65n compile error * mxchip conversion * fix for mxchip wifi reconnect * update MXCHIP wifi connection logic * add disconnect printf * update RX65N Cloud kit * add updated MXCHIP interface * remove unused header * EFR32 initial migration, DPS connect is broken * resync time on reconnect * stm network compile fix * fix tabs in code. * fix MXCHIP devops pipeline * add disconnection detection to rx cloud kit * add more precision for debug output for SNTP * cleaned up connection serial output * restart SNTP count each connect * update reconnection diagram * surface component to command callback * add component options to sending properties * add component parameters to publish bool property * adding EFR32MG component change * update sntp loop to not fail out with a DNS lookup error. * disconnect rx networking on retry * update rx65n cloud kit bsp * refactor reporting properties * reorder property reporting at startup
1 parent 876e310 commit 250bb36

File tree

122 files changed

+8611
-8095
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+8611
-8095
lines changed

.clang-format

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ AlignConsecutiveMacros: true
66
AlignConsecutiveAssignments: true
77
IndentCaseLabels: true
88
PointerAlignment: Left
9+
BraceWrapping:
10+
AfterCaseLabel: true

.github/workflows/ATSAME54-XPRO.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: arm-none-eabi-gcc
2727
uses: ryanwinter/arm-none-eabi-gcc@master
2828
with:
29-
release: '10-2021.07'
29+
release: '10-2021.10'
3030

3131
- name: Install Ninja
3232
uses: seanmiddleditch/gha-setup-ninja@v3

.github/workflows/AZ3166.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: arm-none-eabi-gcc
2727
uses: ryanwinter/arm-none-eabi-gcc@master
2828
with:
29-
release: '10-2021.07'
29+
release: '10-2021.10'
3030

3131
- name: Install Ninja
3232
uses: seanmiddleditch/gha-setup-ninja@v3

.github/workflows/EFR32MG12.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: arm-none-eabi-gcc
2727
uses: ryanwinter/arm-none-eabi-gcc@master
2828
with:
29-
release: '10-2021.07'
29+
release: '10-2021.10'
3030

3131
- name: Install Ninja
3232
uses: seanmiddleditch/gha-setup-ninja@v3

.github/workflows/MIMXRT1050-EVKB.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: arm-none-eabi-gcc
2727
uses: ryanwinter/arm-none-eabi-gcc@master
2828
with:
29-
release: '10-2021.07'
29+
release: '10-2021.10'
3030

3131
- name: Install Ninja
3232
uses: seanmiddleditch/gha-setup-ninja@v3

.github/workflows/MIMXRT1060-EVK.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: arm-none-eabi-gcc
2727
uses: ryanwinter/arm-none-eabi-gcc@master
2828
with:
29-
release: '10-2021.07'
29+
release: '10-2021.10'
3030

3131
- name: Install Ninja
3232
uses: seanmiddleditch/gha-setup-ninja@v3

.github/workflows/STM32L4_L4+.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: arm-none-eabi-gcc
2727
uses: ryanwinter/arm-none-eabi-gcc@master
2828
with:
29-
release: '10-2021.07'
29+
release: '10-2021.10'
3030

3131
- name: Install Ninja
3232
uses: seanmiddleditch/gha-setup-ninja@v3

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ build/
22
Debug/
33
Release/
44
VisualGDB/
5-
.vs/
65
settings/
6+
77
.azure_config.h
8+
azure_config.h
89
mcu.mak
910
MXChip/AZ3166/lib/wiced_sdk/binary_build/43xxx_Wi-Fi
1011
.cortex-debug*

MXChip/AZ3166/app/main.c

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#include "cmsis_utils.h"
1010
#include "screen.h"
1111
#include "sntp_client.h"
12+
#include "wwd_networking.h"
1213

1314
#include "legacy/mqtt.h"
1415
#include "nx_client.h"
15-
#include "wwd_networking.h"
1616

1717
#include "azure_config.h"
1818

@@ -22,47 +22,25 @@
2222
TX_THREAD azure_thread;
2323
ULONG azure_thread_stack[AZURE_THREAD_STACK_SIZE / sizeof(ULONG)];
2424

25-
void azure_thread_entry(ULONG parameter);
26-
void tx_application_define(void* first_unused_memory);
27-
28-
void azure_thread_entry(ULONG parameter)
25+
static void azure_thread_entry(ULONG parameter)
2926
{
3027
UINT status;
3128

3229
printf("Starting Azure thread\r\n\r\n");
3330

34-
if (platform_init(WIFI_SSID, WIFI_PASSWORD, WIFI_MODE) != NX_SUCCESS)
35-
{
36-
printf("Failed to initialize platform.\r\n");
37-
return;
38-
}
39-
screen_print("WiFi ready", L0);
40-
41-
// Start the SNTP client
42-
status = sntp_start();
43-
if (status != NX_SUCCESS)
44-
{
45-
printf("Failed to start the SNTP client (0x%02x)\r\n", status);
46-
return;
47-
}
48-
49-
// Wait for an SNTP sync
50-
status = sntp_sync_wait();
51-
if (status != NX_SUCCESS)
31+
// Initialize the network
32+
if ((status = wwd_network_init(WIFI_SSID, WIFI_PASSWORD, WIFI_MODE)))
5233
{
53-
printf("Failed to start sync SNTP time (0x%02x)\r\n", status);
54-
return;
34+
printf("ERROR: Failed to initialize the network (0x%08x)\r\n", status);
5535
}
56-
screen_print("SNTP inited", L0);
5736

5837
#ifdef ENABLE_LEGACY_MQTT
59-
if ((status = azure_iot_mqtt_entry(&nx_ip, &nx_pool[0], &nx_dns_client, sntp_time_get)))
38+
else if ((status = azure_iot_mqtt_entry(&nx_ip, &nx_pool[0], &nx_dns_client, sntp_time_get)))
6039
#else
61-
if ((status = azure_iot_nx_client_entry(&nx_ip, &nx_pool[0], &nx_dns_client, sntp_time)))
40+
else if ((status = azure_iot_nx_client_entry(&nx_ip, &nx_pool[0], &nx_dns_client, sntp_time)))
6241
#endif
6342
{
64-
printf("Failed to run Azure IoT (0x%04x)\r\n", status);
65-
return;
43+
printf("ERROR: Failed to run Azure IoT (0x%08x)\r\n", status);
6644
}
6745
}
6846

@@ -84,13 +62,13 @@ void tx_application_define(void* first_unused_memory)
8462

8563
if (status != TX_SUCCESS)
8664
{
87-
printf("Azure IoT application failed, please restart\r\n");
65+
printf("ERROR: Azure IoT thread creation failed\r\n");
8866
}
8967
}
9068

9169
int main(void)
9270
{
93-
// Initialise the board
71+
// Initialize the board
9472
board_init();
9573

9674
// Enter the ThreadX kernel

0 commit comments

Comments
 (0)