Skip to content

Commit ea55e7b

Browse files
Update the corMQTT Submodule Pointer (#64)
* Include core_mqtt_config_defaults.h in subscrption_manager.h for logging * Add versioning control in demo_config.h * Define macro for not using custom config for mqtt-agent * Set the writev transport interface as it was added in the later versions of coreMQTT * [TEMP] Update the coreMQTT-Agent submodule pointer which has the updated coreMQTT submodule pointer * [TEMP] Update coreMQTT-Agent submodule pointer to the one with coverity updates * Add a compiler flag to define the __int64_t_defined macro to solve the bug in the latest ARM GCC toolchain * Fix Formating Issues * Add spell check files * Fix Spellings * Fix Spellings * Remove the AppVersion numbers form source files and add in demo_config.h * Update coreMQTT-Agent Submodule pointer to the upstream mainline
1 parent 0a5b37a commit ea55e7b

File tree

12 files changed

+135
-93
lines changed

12 files changed

+135
-93
lines changed

source/lexicon.txt renamed to .github/.cSpellWords.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,8 @@ xtaskcreate
253253
xtaskgettickcount
254254
xtasknotify
255255
xtasktonotify
256+
optim
257+
drbg
258+
ecdh
259+
mqttexample
260+
otaexample

build/Cortex-M3_MPS2_QEMU_GCC/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ MAKE = make
2020
#mbedTLS is built to an archive to speed up the application build.
2121
MBED_TLS_LIB = $(OUTPUT_DIR)/mbedTLS/mbedTLS.a
2222

23+
# -D__int64_t_defined=1 hack is needed to address the following
24+
# bug - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953844.
2325
CFLAGS += $(INCLUDE_DIRS) -nostartfiles -ffreestanding -mthumb -mcpu=cortex-m3 \
2426
-Wall -Wextra -g3 -O0 -ffunction-sections -fdata-sections \
27+
-D__int64_t_defined=1 \
2528
-DMBEDTLS_CONFIG_FILE='<mbedtls_config.h>' -MMD -MP -MF"$(@:%.o=%.d)" -MT $@
2629

2730
#must be the first include paths to ensure the correct FreeRTOSConfig.h is used.

lib/FreeRTOS/coreMQTT-Agent

Submodule coreMQTT-Agent updated 166 files

source/configuration-files/core_mqtt_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,9 @@
7171
*/
7272
#define MQTT_AGENT_NETWORK_BUFFER_SIZE ( 5000 )
7373

74+
/**
75+
* @brief No custom config is used for the coreMQTT-Agent
76+
*/
77+
#define MQTT_AGENT_DO_NOT_USE_CUSTOM_CONFIG
78+
7479
#endif /* ifndef CORE_MQTT_CONFIG_H */

source/configuration-files/demo_config.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@
338338
* @brief The MQTT metrics string expected by AWS IoT.
339339
*/
340340
#define AWS_IOT_METRICS_STRING \
341-
"?SDK=" democonfigOS_NAME "&Version=" democonfigOS_VERSION \
342-
"&Platform=" democonfigHARDWARE_PLATFORM_NAME "&MQTTLib=" democonfigMQTT_LIB
341+
"?SDK=" democonfigOS_NAME "&Version=" democonfigOS_VERSION \
342+
"&Platform=" democonfigHARDWARE_PLATFORM_NAME "&MQTTLib=" democonfigMQTT_LIB
343343

344344
/**
345345
* @brief The length of the MQTT metrics string expected by AWS IoT.
@@ -367,5 +367,14 @@
367367
*/
368368
#define democonfigBROKER_ENDPOINT_LENGTH ( ( uint16_t ) ( sizeof( democonfigMQTT_BROKER_ENDPOINT ) - 1 ) )
369369

370+
/**
371+
* @brief The version for the firmware which is running. OTA agent uses this
372+
* version number to perform anti-rollback validation. The firmware version for the
373+
* download image should be higher than the current version, otherwise the new image is
374+
* rejected in self test phase.
375+
*/
376+
#define APP_VERSION_MAJOR 0
377+
#define APP_VERSION_MINOR 9
378+
#define APP_VERSION_BUILD 2
370379

371380
#endif /* DEMO_CONFIG_H */

source/cspell.config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
3+
version: '0.2'
4+
# Allows things like stringLength
5+
allowCompoundWords: true
6+
7+
# Read files not to spell check from the git ignore
8+
useGitignore: true
9+
10+
# Language settings for C
11+
languageSettings:
12+
- caseSensitive: false
13+
enabled: true
14+
languageId: c
15+
locale: "*"
16+
17+
# Add a dictionary, and the path to the word list
18+
dictionaryDefinitions:
19+
- name: core-mqtt-agent-demos-words
20+
path: '.github/.cSpellWords.txt'
21+
addWords: true
22+
23+
dictionaries:
24+
- core-mqtt-agent-demos-words
25+
26+
# Paths and files to ignore
27+
ignorePaths:
28+
- 'directories.txt'

source/defender-tools/report_builder.c

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -52,68 +52,68 @@
5252

5353
/* Formats used to generate the JSON report. */
5454
#define reportbuilderJSON_PORT_OBJECT_FORMAT \
55-
"{" \
56-
"\"%s\": %u" \
57-
"},"
55+
"{" \
56+
"\"%s\": %u" \
57+
"},"
5858

5959
#define reportbuilderJSON_CONNECTION_OBJECT_FORMAT \
60-
"{" \
61-
"\"%s\": %hu," \
62-
"\"%s\": \"%lu.%lu.%lu.%lu:%hu\"" \
63-
"},"
60+
"{" \
61+
"\"%s\": %hu," \
62+
"\"%s\": \"%lu.%lu.%lu.%lu:%hu\"" \
63+
"},"
6464

6565
#define reportbuilderJSON_REPORT_FORMAT_PART1 \
66-
"{" \
67-
"\"%s\": {" \
68-
"\"%s\": %lu," \
69-
"\"%s\": \"%lu.%lu\"" \
70-
"}," \
71-
"\"%s\": {" \
72-
"\"%s\": {" \
73-
"\"%s\": "
66+
"{" \
67+
"\"%s\": {" \
68+
"\"%s\": %lu," \
69+
"\"%s\": \"%lu.%lu\"" \
70+
"}," \
71+
"\"%s\": {" \
72+
"\"%s\": {" \
73+
"\"%s\": "
7474

7575
#define reportbuilderJSON_REPORT_FORMAT_PART2 \
76-
"," \
77-
"\"%s\": %lu" \
78-
"}," \
79-
"\"%s\": {" \
80-
"\"%s\": "
76+
"," \
77+
"\"%s\": %lu" \
78+
"}," \
79+
"\"%s\": {" \
80+
"\"%s\": "
8181

8282
#define reportbuilderJSON_REPORT_FORMAT_PART3 \
83-
"," \
84-
"\"%s\": %lu" \
85-
"}," \
86-
"\"%s\": {" \
87-
"\"%s\": %lu," \
88-
"\"%s\": %lu," \
89-
"\"%s\": %lu," \
90-
"\"%s\": %lu" \
91-
"}," \
92-
"\"%s\": {" \
93-
"\"%s\": {" \
94-
"\"%s\": "
83+
"," \
84+
"\"%s\": %lu" \
85+
"}," \
86+
"\"%s\": {" \
87+
"\"%s\": %lu," \
88+
"\"%s\": %lu," \
89+
"\"%s\": %lu," \
90+
"\"%s\": %lu" \
91+
"}," \
92+
"\"%s\": {" \
93+
"\"%s\": {" \
94+
"\"%s\": "
9595

9696
#define reportbuilderJSON_REPORT_FORMAT_PART4 \
97-
"," \
98-
"\"%s\": %lu" \
99-
"}" \
100-
"}" \
101-
"}," \
102-
"\"%s\": {" \
103-
"\"stack_high_water_mark\": [" \
104-
"{" \
105-
"\"%s\": %lu" \
106-
"}" \
107-
"]," \
108-
"\"task_numbers\": [" \
109-
"{" \
110-
"\"%s\": "
97+
"," \
98+
"\"%s\": %lu" \
99+
"}" \
100+
"}" \
101+
"}," \
102+
"\"%s\": {" \
103+
"\"stack_high_water_mark\": [" \
104+
"{" \
105+
"\"%s\": %lu" \
106+
"}" \
107+
"]," \
108+
"\"task_numbers\": [" \
109+
"{" \
110+
"\"%s\": "
111111

112112
#define reportbuilderJSON_REPORT_FORMAT_PART5 \
113-
"}" \
114-
"]" \
115-
"}" \
116-
"}"
113+
"}" \
114+
"]" \
115+
"}" \
116+
"}"
117117

118118
/*-----------------------------------------------------------*/
119119

source/demo-tasks/ota_over_mqtt_demo.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,6 @@
179179
*/
180180
#define otaexampleAGENT_TASK_STACK_SIZE ( 4096 )
181181

182-
/**
183-
* @brief The version for the firmware which is running. OTA agent uses this
184-
* version number to perform anti-rollback validation. The firmware version for the
185-
* download image should be higher than the current version, otherwise the new image is
186-
* rejected in self test phase.
187-
*/
188-
#define APP_VERSION_MAJOR 0
189-
#define APP_VERSION_MINOR 9
190-
#define APP_VERSION_BUILD 2
191-
192182
/**
193183
* @brief Defines the structure to use as the command callback context in this
194184
* demo.

source/demo-tasks/shadow_device_task.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* following operations:
3535
* 1. Assemble strings for the MQTT topics of device shadow, by using macros defined by the Device Shadow library.
3636
* 2. Subscribe to those MQTT topics using the MQTT Agent.
37-
* 3. Register callbacks for incoming shadow topic publishes with the subsciption_manager.
37+
* 3. Register callbacks for incoming shadow topic publishes with the subscription_manager.
3838
* 3. Publish to report the current state of powerOn.
3939
* 5. Check if powerOn has been changed and send an update if so.
4040
* 6. If a publish to update reported state was sent, wait until either prvIncomingPublishUpdateAcceptedCallback
@@ -95,14 +95,14 @@
9595
* is used for a client token.
9696
*/
9797
#define shadowexampleSHADOW_REPORTED_JSON \
98-
"{" \
99-
"\"state\":{" \
100-
"\"reported\":{" \
101-
"\"powerOn\":%1u" \
102-
"}" \
103-
"}," \
104-
"\"clientToken\":\"%06lu\"" \
105-
"}"
98+
"{" \
99+
"\"state\":{" \
100+
"\"reported\":{" \
101+
"\"powerOn\":%1u" \
102+
"}" \
103+
"}," \
104+
"\"clientToken\":\"%06lu\"" \
105+
"}"
106106

107107
/**
108108
* @brief The expected size of #SHADOW_REPORTED_JSON.
@@ -441,7 +441,7 @@ static void prvIncomingPublishUpdateDeltaCallback( void * pxSubscriptionContext,
441441

442442
if( result != JSONSuccess )
443443
{
444-
LogError( ( "Invalid JSON document recieved!" ) );
444+
LogError( ( "Invalid JSON document received!" ) );
445445
}
446446
else
447447
{
@@ -470,13 +470,13 @@ static void prvIncomingPublishUpdateDeltaCallback( void * pxSubscriptionContext,
470470
* that we've received before. Your application may use a
471471
* different approach.
472472
*/
473-
LogWarn( ( "Recieved unexpected delta update with version %u. Current version is %u",
473+
LogWarn( ( "Received unexpected delta update with version %u. Current version is %u",
474474
( unsigned int ) ulVersion,
475475
( unsigned int ) ulCurrentVersion ) );
476476
}
477477
else
478478
{
479-
LogInfo( ( "Recieved delta update with version %.*s.",
479+
LogInfo( ( "Received delta update with version %.*s.",
480480
ulOutValueLength,
481481
pcOutValue ) );
482482

@@ -559,7 +559,7 @@ static void prvIncomingPublishUpdateAcceptedCallback( void * pxSubscriptionConte
559559

560560
if( result != JSONSuccess )
561561
{
562-
LogError( ( "Invalid JSON document recieved!" ) );
562+
LogError( ( "Invalid JSON document received!" ) );
563563
}
564564
else
565565
{
@@ -582,7 +582,7 @@ static void prvIncomingPublishUpdateAcceptedCallback( void * pxSubscriptionConte
582582
ulReceivedToken = ( uint32_t ) strtoul( pcOutValue, NULL, 10 );
583583

584584
/* If we are waiting for a response, ulClientToken will be the token for the response
585-
* we are waiting for, else it will be 0. ulRecievedToken may not match if the response is
585+
* we are waiting for, else it will be 0. ulReceivedToken may not match if the response is
586586
* not for us or if it is is a response that arrived after we timed out
587587
* waiting for it.
588588
*/
@@ -654,7 +654,7 @@ static void prvIncomingPublishUpdateRejectedCallback( void * pxSubscriptionConte
654654

655655
if( result != JSONSuccess )
656656
{
657-
LogError( ( "Invalid JSON document recieved!" ) );
657+
LogError( ( "Invalid JSON document received!" ) );
658658
}
659659
else
660660
{
@@ -677,7 +677,7 @@ static void prvIncomingPublishUpdateRejectedCallback( void * pxSubscriptionConte
677677
ulReceivedToken = ( uint32_t ) strtoul( pcOutValue, NULL, 10 );
678678

679679
/* If we are waiting for a response, ulClientToken will be the token for the response
680-
* we are waiting for, else it will be 0. ulRecievedToken may not match if the response is
680+
* we are waiting for, else it will be 0. ulReceivedToken may not match if the response is
681681
* not for us or if it is is a response that arrived after we timed out
682682
* waiting for it.
683683
*/

source/demo-tasks/shadow_update_task.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* following operations:
3333
* 1. Assemble strings for the MQTT topics of device shadow, by using macros defined by the Device Shadow library.
3434
* 2. Subscribe to those MQTT topics using the MQTT Agent.
35-
* 3. Register callbacks for incoming shadow topic publishes with the subsciption_manager.
35+
* 3. Register callbacks for incoming shadow topic publishes with the subscription_manager.
3636
* 4. Wait until it is time to publish a requested change.
3737
* 5. Publish a desired state of powerOn. That will cause a delta message to be sent to device.
3838
* 6. Wait until either prvIncomingPublishUpdateAcceptedCallback or prvIncomingPublishUpdateRejectedCallback handle
@@ -90,14 +90,14 @@
9090
* is used for a client token.
9191
*/
9292
#define shadowexampleSHADOW_DESIRED_JSON \
93-
"{" \
94-
"\"state\":{" \
95-
"\"desired\":{" \
96-
"\"powerOn\":%1u" \
97-
"}" \
98-
"}," \
99-
"\"clientToken\":\"%06lu\"" \
100-
"}"
93+
"{" \
94+
"\"state\":{" \
95+
"\"desired\":{" \
96+
"\"powerOn\":%1u" \
97+
"}" \
98+
"}," \
99+
"\"clientToken\":\"%06lu\"" \
100+
"}"
101101

102102
/**
103103
* @brief The expected size of #SHADOW_DESIRED_JSON.
@@ -394,7 +394,7 @@ static void prvIncomingPublishUpdateAcceptedCallback( void * pxSubscriptionConte
394394

395395
if( result != JSONSuccess )
396396
{
397-
LogError( ( "Invalid JSON document recieved!" ) );
397+
LogError( ( "Invalid JSON document received!" ) );
398398
}
399399
else
400400
{
@@ -417,7 +417,7 @@ static void prvIncomingPublishUpdateAcceptedCallback( void * pxSubscriptionConte
417417
ulReceivedToken = ( uint32_t ) strtoul( pcOutValue, NULL, 10 );
418418

419419
/* If we are waiting for a response, ulClientToken will be the token for the response
420-
* we are waiting for, else it will be 0. ulRecievedToken may not match if the response is
420+
* we are waiting for, else it will be 0. ulReceivedToken may not match if the response is
421421
* not for us or if it is is a response that arrived after we timed out
422422
* waiting for it.
423423
*/
@@ -470,7 +470,7 @@ static void prvIncomingPublishUpdateRejectedCallback( void * pxSubscriptionConte
470470

471471
if( result != JSONSuccess )
472472
{
473-
LogError( ( "Invalid JSON document recieved!" ) );
473+
LogError( ( "Invalid JSON document received!" ) );
474474
}
475475
else
476476
{
@@ -493,7 +493,7 @@ static void prvIncomingPublishUpdateRejectedCallback( void * pxSubscriptionConte
493493
ulReceivedToken = ( uint32_t ) strtoul( pcOutValue, NULL, 10 );
494494

495495
/* If we are waiting for a response, ulClientToken will be the token for the response
496-
* we are waiting for, else it will be 0. ulRecievedToken may not match if the response is
496+
* we are waiting for, else it will be 0. ulReceivedToken may not match if the response is
497497
* not for us or if it is is a response that arrived after we timed out
498498
* waiting for it.
499499
*/

0 commit comments

Comments
 (0)