@@ -516,6 +516,7 @@ static void state_connected_ready_run(void *o)
516
516
{
517
517
int err ;
518
518
const struct cloud_state * state_object = (const struct cloud_state * )o ;
519
+ bool confirmable = IS_ENABLED (CONFIG_APP_CLOUD_CONFIRMABLE_MESSAGES );
519
520
520
521
if (state_object -> chan == & NETWORK_CHAN ) {
521
522
struct network_msg msg = MSG_TO_NETWORK_MSG (state_object -> msg_buf );
@@ -532,7 +533,8 @@ static void state_connected_ready_run(void *o)
532
533
case NETWORK_QUALITY_SAMPLE_RESPONSE :
533
534
err = nrf_cloud_coap_sensor_send (CUSTOM_JSON_APPID_VAL_CONEVAL ,
534
535
msg .conn_eval_params .energy_estimate ,
535
- NRF_CLOUD_NO_TIMESTAMP , true);
536
+ NRF_CLOUD_NO_TIMESTAMP ,
537
+ confirmable );
536
538
if (err ) {
537
539
LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
538
540
SEND_FATAL_ERROR ();
@@ -541,7 +543,8 @@ static void state_connected_ready_run(void *o)
541
543
542
544
err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_RSRP ,
543
545
msg .conn_eval_params .rsrp ,
544
- NRF_CLOUD_NO_TIMESTAMP , true);
546
+ NRF_CLOUD_NO_TIMESTAMP ,
547
+ confirmable );
545
548
if (err ) {
546
549
LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
547
550
SEND_FATAL_ERROR ();
@@ -562,7 +565,8 @@ static void state_connected_ready_run(void *o)
562
565
if (msg .type == BATTERY_PERCENTAGE_SAMPLE_RESPONSE ) {
563
566
err = nrf_cloud_coap_sensor_send (CUSTOM_JSON_APPID_VAL_BATTERY ,
564
567
msg .percentage ,
565
- NRF_CLOUD_NO_TIMESTAMP , true);
568
+ NRF_CLOUD_NO_TIMESTAMP ,
569
+ confirmable );
566
570
if (err ) {
567
571
LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
568
572
SEND_FATAL_ERROR ();
@@ -580,23 +584,26 @@ static void state_connected_ready_run(void *o)
580
584
if (msg .type == ENVIRONMENTAL_SENSOR_SAMPLE_RESPONSE ) {
581
585
err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_TEMP ,
582
586
msg .temperature ,
583
- NRF_CLOUD_NO_TIMESTAMP , true);
587
+ NRF_CLOUD_NO_TIMESTAMP ,
588
+ confirmable );
584
589
if (err ) {
585
590
LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
586
591
SEND_FATAL_ERROR ();
587
592
}
588
593
589
594
err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_AIR_PRESS ,
590
595
msg .pressure ,
591
- NRF_CLOUD_NO_TIMESTAMP , true);
596
+ NRF_CLOUD_NO_TIMESTAMP ,
597
+ confirmable );
592
598
if (err ) {
593
599
LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
594
600
SEND_FATAL_ERROR ();
595
601
}
596
602
597
603
err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_HUMID ,
598
604
msg .humidity ,
599
- NRF_CLOUD_NO_TIMESTAMP , true);
605
+ NRF_CLOUD_NO_TIMESTAMP ,
606
+ confirmable );
600
607
if (err ) {
601
608
LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
602
609
SEND_FATAL_ERROR ();
@@ -610,7 +617,7 @@ static void state_connected_ready_run(void *o)
610
617
if (state_object -> chan == & PAYLOAD_CHAN ) {
611
618
const struct cloud_payload * payload = MSG_TO_PAYLOAD (state_object -> msg_buf );
612
619
613
- err = nrf_cloud_coap_json_message_send (payload -> buffer , false, false );
620
+ err = nrf_cloud_coap_json_message_send (payload -> buffer , false, confirmable );
614
621
if (err ) {
615
622
LOG_ERR ("nrf_cloud_coap_json_message_send, error: %d" , err );
616
623
SEND_FATAL_ERROR ();
0 commit comments