Skip to content

Commit

Permalink
net: lib: nrf_cloud: add missing AIR_QUAL handler to shadow encoder
Browse files Browse the repository at this point in the history
Prior to this commit, nrf_cloud_encode_service_info_ui erroneously
ignores the air_quality member of nrf_cloud_svc_info_ui. This commit
adds the missing handler, so that AIR_QUALITY is correctly enabled when
updating shadow.

IRIS-6724

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
  • Loading branch information
glarsennordic authored and nordicjm committed Aug 11, 2023
1 parent 0f55e16 commit 072f7fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,14 @@ Libraries for networking
* Updated:

* Moved JSON manipulation from :file:`nrf_cloud_fota.c` to :file:`nrf_cloud_codec_internal.c`.
* Fixed a build issue that occurred when MQTT and P-GPS are enabled and A-GPS is disabled.
* :c:func:`nrf_cloud_obj_location_request_create` to use the new function :c:func:`nrf_cloud_obj_location_request_payload_add`.
* Fixed a bug that prevented an MQTT FOTA job from being started.

* Fixed:

* A build issue that occurred when MQTT and P-GPS are enabled and A-GPS is disabled.
* A bug preventing ``AIR_QUAL`` from being enabled in shadow UI service info.

* Removed:

* Unused internal codec function ``nrf_cloud_format_single_cell_pos_req_json()``.
Expand Down
4 changes: 2 additions & 2 deletions include/net/nrf_cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,10 @@ struct nrf_cloud_svc_info_ui {
uint8_t log:1;
/** Dictionary (binary) Logs */
uint8_t dictionary_log:1;

/* Items without UI support on nRF Cloud */
/** Air Quality */
uint8_t air_quality:1;

/* Items without UI support on nRF Cloud */
/** Light sensor */
uint8_t light_sensor:1;
/** Button */
Expand Down
5 changes: 5 additions & 0 deletions subsys/net/lib/nrf_cloud/src/nrf_cloud_codec_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,11 @@ static int nrf_cloud_encode_service_info_ui(const struct nrf_cloud_svc_info_ui *
cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_AIR_PRESS]));
++item_cnt;
}
if (ui->air_quality) {
cJSON_AddItemToArray(array,
cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_AIR_QUAL]));
++item_cnt;
}
if (ui->gnss) {
cJSON_AddItemToArray(array,
cJSON_CreateString(sensor_type_str[NRF_CLOUD_SENSOR_GNSS]));
Expand Down

0 comments on commit 072f7fb

Please sign in to comment.