@@ -516,6 +516,7 @@ static void state_connected_ready_run(void *o)
516516{
517517 int err ;
518518 const struct cloud_state * state_object = (const struct cloud_state * )o ;
519+ bool confirmable = IS_ENABLED (CONFIG_APP_CLOUD_CONFIRMABLE_MESSAGES );
519520
520521 if (state_object -> chan == & NETWORK_CHAN ) {
521522 struct network_msg msg = MSG_TO_NETWORK_MSG (state_object -> msg_buf );
@@ -532,7 +533,8 @@ static void state_connected_ready_run(void *o)
532533 case NETWORK_QUALITY_SAMPLE_RESPONSE :
533534 err = nrf_cloud_coap_sensor_send (CUSTOM_JSON_APPID_VAL_CONEVAL ,
534535 msg .conn_eval_params .energy_estimate ,
535- NRF_CLOUD_NO_TIMESTAMP , true);
536+ NRF_CLOUD_NO_TIMESTAMP ,
537+ confirmable );
536538 if (err ) {
537539 LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
538540 SEND_FATAL_ERROR ();
@@ -541,7 +543,8 @@ static void state_connected_ready_run(void *o)
541543
542544 err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_RSRP ,
543545 msg .conn_eval_params .rsrp ,
544- NRF_CLOUD_NO_TIMESTAMP , true);
546+ NRF_CLOUD_NO_TIMESTAMP ,
547+ confirmable );
545548 if (err ) {
546549 LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
547550 SEND_FATAL_ERROR ();
@@ -562,7 +565,8 @@ static void state_connected_ready_run(void *o)
562565 if (msg .type == BATTERY_PERCENTAGE_SAMPLE_RESPONSE ) {
563566 err = nrf_cloud_coap_sensor_send (CUSTOM_JSON_APPID_VAL_BATTERY ,
564567 msg .percentage ,
565- NRF_CLOUD_NO_TIMESTAMP , true);
568+ NRF_CLOUD_NO_TIMESTAMP ,
569+ confirmable );
566570 if (err ) {
567571 LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
568572 SEND_FATAL_ERROR ();
@@ -580,23 +584,26 @@ static void state_connected_ready_run(void *o)
580584 if (msg .type == ENVIRONMENTAL_SENSOR_SAMPLE_RESPONSE ) {
581585 err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_TEMP ,
582586 msg .temperature ,
583- NRF_CLOUD_NO_TIMESTAMP , true);
587+ NRF_CLOUD_NO_TIMESTAMP ,
588+ confirmable );
584589 if (err ) {
585590 LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
586591 SEND_FATAL_ERROR ();
587592 }
588593
589594 err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_AIR_PRESS ,
590595 msg .pressure ,
591- NRF_CLOUD_NO_TIMESTAMP , true);
596+ NRF_CLOUD_NO_TIMESTAMP ,
597+ confirmable );
592598 if (err ) {
593599 LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
594600 SEND_FATAL_ERROR ();
595601 }
596602
597603 err = nrf_cloud_coap_sensor_send (NRF_CLOUD_JSON_APPID_VAL_HUMID ,
598604 msg .humidity ,
599- NRF_CLOUD_NO_TIMESTAMP , true);
605+ NRF_CLOUD_NO_TIMESTAMP ,
606+ confirmable );
600607 if (err ) {
601608 LOG_ERR ("nrf_cloud_coap_sensor_send, error: %d" , err );
602609 SEND_FATAL_ERROR ();
@@ -610,7 +617,7 @@ static void state_connected_ready_run(void *o)
610617 if (state_object -> chan == & PAYLOAD_CHAN ) {
611618 const struct cloud_payload * payload = MSG_TO_PAYLOAD (state_object -> msg_buf );
612619
613- err = nrf_cloud_coap_json_message_send (payload -> buffer , false, false );
620+ err = nrf_cloud_coap_json_message_send (payload -> buffer , false, confirmable );
614621 if (err ) {
615622 LOG_ERR ("nrf_cloud_coap_json_message_send, error: %d" , err );
616623 SEND_FATAL_ERROR ();
0 commit comments