Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 7, 2023
1 parent f939ac5 commit 1dd48a3
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 37 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ if (CONFIG_BOARD_QEMU_X86 OR CONFIG_BOARD_NATIVE_POSIX)
# Make folder containing certificates global so that it can be located by the configured
# cloud library.
zephyr_include_directories(src/cloud-certs)

target_compile_options(app PRIVATE
-DCONFIG_LTE_NEIGHBOR_CELLS_MAX=10)
endif()
4 changes: 4 additions & 0 deletions prj_qemu_x86.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ CONFIG_CJSON_LIB=y
CONFIG_NRF_CLOUD_MQTT=y
CONFIG_NRF_CLOUD_FOTA=n

# Set custom cloud client ID
CONFIG_CLOUD_CLIENT_ID_USE_CUSTOM=y
CONFIG_CLOUD_CLIENT_ID="test"

# Disable unsupported application modules
CONFIG_LOCATION_MODULE=n
CONFIG_SENSOR_MODULE=n
Expand Down
4 changes: 4 additions & 0 deletions sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tests:
integration_platforms:
- nrf9160dk_nrf9160_ns
- thingy91_nrf9160_ns
- native_posix
tags: ci_build
applications.asset_tracker_v2.nrf_cloud-pgps:
build_only: true
Expand All @@ -34,6 +35,7 @@ tests:
integration_platforms:
- nrf9160dk_nrf9160_ns
- thingy91_nrf9160_ns
- native_posix
extra_configs:
- CONFIG_AWS_IOT_BROKER_HOST_NAME="example-hostname.aws.com"
extra_args: OVERLAY_CONFIG="overlay-aws.conf"
Expand Down Expand Up @@ -68,6 +70,7 @@ tests:
integration_platforms:
- nrf9160dk_nrf9160_ns
- thingy91_nrf9160_ns
- native_posix
extra_configs:
- CONFIG_AZURE_IOT_HUB_DPS_HOSTNAME="global.azure-devices-provisioning.net"
- CONFIG_AZURE_IOT_HUB_DPS_ID_SCOPE="IDSCOPE"
Expand All @@ -80,6 +83,7 @@ tests:
integration_platforms:
- nrf9160dk_nrf9160_ns
- thingy91_nrf9160_ns
- native_posix
extra_args: OVERLAY_CONFIG=overlay-debug.conf
tags: ci_build
applications.asset_tracker_v2.debug-memfault:
Expand Down
2 changes: 1 addition & 1 deletion src/cloud/cloud_codec/cloud_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ struct cloud_data_neighbor_cells {
/** Contains current cell and number of neighbor cells. */
struct lte_lc_cells_info cell_data;
/** Contains neighborhood cells. */
struct lte_lc_ncell neighbor_cells[17];
struct lte_lc_ncell neighbor_cells[CONFIG_LTE_NEIGHBOR_CELLS_MAX];
/** Neighbor cells data timestamp. UNIX milliseconds. */
int64_t ts;
/** Flag signifying that the data entry is to be encoded. */
Expand Down
70 changes: 36 additions & 34 deletions src/cloud/cloud_codec/nrf_cloud/json_protocol_names_nrf_cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,39 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#define DATA_GNSS_LONGITUDE "lng"
#define DATA_GNSS_LATITUDE "lat"
#define DATA_GNSS_ALTITUDE "alt"
#define DATA_GNSS_SPEED "spd"
#define DATA_GNSS_HEADING "hdg"
#define DATA_GNSS_ACCURACY "acc"

#define DATA_MODEM_DYNAMIC "networkInfo"
#define DATA_MODEM_STATIC "deviceInfo"
#define DATA_CONFIG "config"
#define DATA_VERSION "version"
#define DATA_IMPACT "impact"

#define DATA_GROUP "messageType"
#define DATA_ID "appId"
#define DATA_TYPE "data"
#define DATA_TIMESTAMP "ts"

#define MESSAGE_TYPE_DATA "DATA"

#define APP_ID_BUTTON "BUTTON"
#define APP_ID_VOLTAGE "VOLTAGE"
#define APP_ID_DEVICE "DEVICE"
#define APP_ID_GNSS "GNSS"
#define APP_ID_HUMIDITY "HUMID"
#define APP_ID_AIR_PRESS "AIR_PRESS"
#define APP_ID_AIR_QUAL "AIR_QUAL"
#define APP_ID_TEMPERATURE "TEMP"
#define APP_ID_RSRP "RSRP"
#define APP_ID_CELL_POS "CELL_POS"
#define APP_ID_IMPACT "IMPACT"
#include <net/nrf_cloud_defs.h>

#define DATA_GNSS_LONGITUDE NRF_CLOUD_JSON_GNSS_PVT_KEY_LON
#define DATA_GNSS_LATITUDE NRF_CLOUD_JSON_GNSS_PVT_KEY_LAT
#define DATA_GNSS_ALTITUDE NRF_CLOUD_JSON_GNSS_PVT_KEY_ALTITUDE
#define DATA_GNSS_SPEED NRF_CLOUD_JSON_GNSS_PVT_KEY_SPEED
#define DATA_GNSS_HEADING NRF_CLOUD_JSON_GNSS_PVT_KEY_HEADING
#define DATA_GNSS_ACCURACY NRF_CLOUD_JSON_GNSS_PVT_KEY_ACCURACY

#define DATA_MODEM_DYNAMIC NRF_CLOUD_DEVICE_JSON_KEY_NET_INF
#define DATA_MODEM_STATIC NRF_CLOUD_DEVICE_JSON_KEY_DEV_INF
#define DATA_CONFIG NRF_CLOUD_JSON_KEY_CFG
#define DATA_VERSION "version"
#define DATA_IMPACT "impact"

#define DATA_GROUP NRF_CLOUD_JSON_MSG_TYPE_KEY
#define DATA_ID NRF_CLOUD_JSON_APPID_KEY
#define DATA_TYPE NRF_CLOUD_JSON_DATA_KEY
#define DATA_TIMESTAMP NRF_CLOUD_MSG_TIMESTAMP_KEY

#define MESSAGE_TYPE_DATA NRF_CLOUD_JSON_MSG_TYPE_VAL_DATA

#define APP_ID_BUTTON NRF_CLOUD_JSON_APPID_VAL_BTN
#define APP_ID_VOLTAGE "VOLTAGE"
#define APP_ID_DEVICE NRF_CLOUD_JSON_APPID_VAL_DEVICE
#define APP_ID_GNSS NRF_CLOUD_JSON_APPID_VAL_GNSS
#define APP_ID_HUMIDITY NRF_CLOUD_JSON_APPID_VAL_HUMID
#define APP_ID_AIR_PRESS NRF_CLOUD_JSON_APPID_VAL_AIR_PRESS
#define APP_ID_AIR_QUAL NRF_CLOUD_JSON_APPID_VAL_AIR_QUAL
#define APP_ID_TEMPERATURE NRF_CLOUD_JSON_APPID_VAL_TEMP
#define APP_ID_RSRP NRF_CLOUD_JSON_APPID_VAL_RSRP
#define APP_ID_CELL_POS NRF_CLOUD_JSON_APPID_VAL_LOCATION
#define APP_ID_IMPACT "IMPACT"

#define MODEM_CURRENT_BAND "currentBand"
#define MODEM_NETWORK_MODE "networkMode"
Expand All @@ -57,6 +59,6 @@
#define CONFIG_NO_DATA_LIST_NEIGHBOR_CELL "ncell"
#define CONFIG_NO_DATA_LIST_WIFI "wifi"

#define OBJECT_CONFIG "config"
#define OBJECT_REPORTED "reported"
#define OBJECT_STATE "state"
#define OBJECT_CONFIG NRF_CLOUD_JSON_KEY_CFG
#define OBJECT_REPORTED NRF_CLOUD_JSON_KEY_REP
#define OBJECT_STATE NRF_CLOUD_JSON_KEY_STATE
18 changes: 17 additions & 1 deletion src/events/app_module_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,29 @@ static char *get_evt_type_str(enum app_module_event_type type)
static void log_event(const struct app_event_header *aeh)
{
const struct app_module_event *event = cast_app_module_event(aeh);
char data_types[50] = "\0";
char data_types[60] = "\0";

if (event->type == APP_EVT_ERROR) {
APP_EVENT_MANAGER_LOG(aeh, "%s - Error code %d",
get_evt_type_str(event->type), event->data.err);
} else if (event->type == APP_EVT_DATA_GET) {
for (int i = 0; i < event->count; i++) {
/* data_types should contain space for the stringified type and a null
* character.
*/
size_t max_append_len = sizeof(data_types) - strlen(data_types) - 1;

if (i < event->count - 1) {
/* For every type except the last one, we also need space
* for a comma and a space character.
*/
max_append_len -= 2;
}

if (strlen(type2str(event->data_list[i])) > max_append_len) {
return;
}

strcat(data_types, type2str(event->data_list[i]));

if (i == event->count - 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/events/location_module_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct location_module_neighbor_cells {
/** Information about the current cell. */
struct lte_lc_cells_info cell_data;
/** Information about the neighbor cells. */
struct lte_lc_ncell neighbor_cells[17];
struct lte_lc_ncell neighbor_cells[CONFIG_LTE_NEIGHBOR_CELLS_MAX];
/** Uptime when the event was sent. */
int64_t timestamp;
};
Expand Down

0 comments on commit 1dd48a3

Please sign in to comment.