Skip to content

Commit 2209252

Browse files
committed
modules: cloud: Optimize event handling and clean up configuration
- Streamlined some output events from the cloud module. - Remove unused configuration option from Kconfig.cloud. Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
1 parent c811153 commit 2209252

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

app/src/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static void idle_run(void *o)
400400
if (state_object->chan == &CLOUD_CHAN) {
401401
struct cloud_msg msg = MSG_TO_CLOUD_MSG(state_object->msg_buf);
402402

403-
if (msg.type == CLOUD_CONNECTED_READY_TO_SEND) {
403+
if (msg.type == CLOUD_CONNECTED) {
404404
state_object->connected = true;
405405
smf_set_state(SMF_CTX(state_object), &states[STATE_TRIGGERING]);
406406
return;
@@ -454,8 +454,7 @@ static void triggering_run(void *o)
454454
if (state_object->chan == &CLOUD_CHAN) {
455455
struct cloud_msg msg = MSG_TO_CLOUD_MSG(state_object->msg_buf);
456456

457-
if ((msg.type == CLOUD_CONNECTED_PAUSED) ||
458-
(msg.type == CLOUD_DISCONNECTED)) {
457+
if (msg.type == CLOUD_DISCONNECTED) {
459458
state_object->connected = false;
460459
smf_set_state(SMF_CTX(state_object), &states[STATE_IDLE]);
461460
return;

app/src/modules/cloud/Kconfig.cloud

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ config APP_CLOUD_MESSAGE_QUEUE_SIZE
8787
help
8888
ZBus subscriber message queue size.
8989

90-
config APP_CLOUD_POLL_INTERVAL_SECONDS
91-
int "Poll interval in seconds"
92-
default 10
93-
help
94-
Interval in seconds between polling nRF Cloud CoAP.
95-
9690
config APP_CLOUD_WATCHDOG_TIMEOUT_SECONDS
9791
int "Watchdog timeout"
9892
default 180

app/src/modules/cloud/cloud_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static void state_connected_ready_entry(void *o)
527527
{
528528
int err;
529529
struct cloud_msg cloud_msg = {
530-
.type = CLOUD_CONNECTED_READY_TO_SEND,
530+
.type = CLOUD_CONNECTED,
531531
};
532532

533533
ARG_UNUSED(o);
@@ -703,7 +703,7 @@ static void state_connected_paused_entry(void *o)
703703
{
704704
int err;
705705
struct cloud_msg cloud_msg = {
706-
.type = CLOUD_CONNECTED_PAUSED,
706+
.type = CLOUD_DISCONNECTED,
707707
};
708708

709709
ARG_UNUSED(o);

app/src/modules/cloud/cloud_module.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ struct cloud_shadow_response {
3333

3434
enum cloud_msg_type {
3535
CLOUD_DISCONNECTED = 0x1,
36-
CLOUD_CONNECTED_READY_TO_SEND,
37-
CLOUD_CONNECTED_PAUSED,
36+
CLOUD_CONNECTED,
3837
CLOUD_CONNECTION_ATTEMPT_COUNT_REACHED,
3938
CLOUD_PAYLOAD_JSON,
4039
CLOUD_POLL_SHADOW,

0 commit comments

Comments
 (0)