@@ -83,11 +83,11 @@ ZBUS_CHAN_DEFINE(PAYLOAD_CHAN,
83
83
);
84
84
85
85
ZBUS_CHAN_DEFINE (CLOUD_CHAN ,
86
- enum cloud_msg_type ,
86
+ struct cloud_msg ,
87
87
NULL ,
88
88
NULL ,
89
89
ZBUS_OBSERVERS_EMPTY ,
90
- CLOUD_DISCONNECTED
90
+ ZBUS_MSG_INIT (. type = CLOUD_DISCONNECTED )
91
91
);
92
92
93
93
/* Enumerator to be used in privat cloud channel */
@@ -346,13 +346,15 @@ static void state_running_run(void *o)
346
346
static void state_disconnected_entry (void * o )
347
347
{
348
348
int err ;
349
- enum cloud_msg_type cloud_status = CLOUD_DISCONNECTED ;
349
+ struct cloud_msg cloud_msg = {
350
+ .type = CLOUD_DISCONNECTED ,
351
+ };
350
352
351
353
ARG_UNUSED (o );
352
354
353
355
LOG_DBG ("%s" , __func__ );
354
356
355
- err = zbus_chan_pub (& CLOUD_CHAN , & cloud_status , K_SECONDS (1 ));
357
+ err = zbus_chan_pub (& CLOUD_CHAN , & cloud_msg , K_SECONDS (1 ));
356
358
if (err ) {
357
359
LOG_ERR ("zbus_chan_pub, error: %d" , err );
358
360
SEND_FATAL_ERROR ();
@@ -491,13 +493,15 @@ static void shadow_get(bool delta_only)
491
493
static void state_connected_ready_entry (void * o )
492
494
{
493
495
int err ;
494
- enum cloud_msg_type cloud_status = CLOUD_CONNECTED_READY_TO_SEND ;
496
+ struct cloud_msg cloud_msg = {
497
+ .type = CLOUD_CONNECTED_READY_TO_SEND ,
498
+ };
495
499
496
500
ARG_UNUSED (o );
497
501
498
502
LOG_DBG ("%s" , __func__ );
499
503
500
- err = zbus_chan_pub (& CLOUD_CHAN , & cloud_status , K_SECONDS (1 ));
504
+ err = zbus_chan_pub (& CLOUD_CHAN , & cloud_msg , K_SECONDS (1 ));
501
505
if (err ) {
502
506
LOG_ERR ("zbus_chan_pub, error: %d" , err );
503
507
SEND_FATAL_ERROR ();
@@ -629,13 +633,15 @@ static void state_connected_ready_run(void *o)
629
633
static void state_connected_paused_entry (void * o )
630
634
{
631
635
int err ;
632
- enum cloud_msg_type cloud_status = CLOUD_CONNECTED_PAUSED ;
636
+ struct cloud_msg cloud_msg = {
637
+ .type = CLOUD_CONNECTED_PAUSED ,
638
+ };
633
639
634
640
ARG_UNUSED (o );
635
641
636
642
LOG_DBG ("%s" , __func__ );
637
643
638
- err = zbus_chan_pub (& CLOUD_CHAN , & cloud_status , K_SECONDS (1 ));
644
+ err = zbus_chan_pub (& CLOUD_CHAN , & cloud_msg , K_SECONDS (1 ));
639
645
if (err ) {
640
646
LOG_ERR ("zbus_chan_pub, error: %d" , err );
641
647
SEND_FATAL_ERROR ();
0 commit comments