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 committed Apr 28, 2021
1 parent d5c3469 commit 303293a
Show file tree
Hide file tree
Showing 8 changed files with 1,570 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The application supports the following data types:
| Battery | Voltage | APP_DATA_BATTERY |
+---------------+----------------------------+-----------------------------------------------+

The sets of sensor data that are published to the cloud service consist of relative timestamps that originate from the time of sampling.
The sets of sensor data that are published to the cloud service consist of relative `timestamps <Timestamping_>`_ that originate from the time of sampling.

Device modes
============
Expand Down Expand Up @@ -259,8 +259,8 @@ You must check and configure the following :ref:`lib_aws_iot` library options th
Additionally, you can add the following optional configurations to configure the heap or to provide additional information such as APN to the modem for registering with an LTE network:

* :option:`CONFIG_HEAP_MEM_POOL_SIZE` - Configures the size of the heap that is used by the application when encoding and sending data to the cloud. More information can be found in :ref:`memory_allocation`.
* :option:`CONFIG_LTE_PDP_CMD` - Used for manual configuration of the APN. Set the option to ``y`` to enable PDP define using ``AT+CGDCONT``.
* :option:`CONFIG_LTE_PDP_CONTEXT` - Used for manual configuration of the APN. An example is ``0,\"IP\",\"apn.example.com\"``.
* :option:`CONFIG_PDN_DEFAULTS_OVERRIDE` - Used for manual configuration of the APN. Set the option to ``y`` to override the default PDP context configuration.
* :option:`CONFIG_PDN_DEFAULT_APN` - Used for manual configuration of the APN. An example is ``apn.example.com``.

Configuration files
===================
Expand Down
25 changes: 25 additions & 0 deletions tests/json_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.13.1)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(json_common_test)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

target_include_directories(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ../../src/cloud/cloud_codec/)

target_sources(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} mock/date_time_mock.c
${CMAKE_CURRENT_SOURCE_DIR} ../../src/cloud/cloud_codec/json_common.c
${CMAKE_CURRENT_SOURCE_DIR} ../../src/cloud/cloud_codec/json_helpers.c)

target_compile_options(app PRIVATE
-DCONFIG_CLOUD_CODEC_LOG_LEVEL=0
-DCONFIG_ASSET_TRACKER_V2_APP_VERSION_MAX_LEN=20)
17 changes: 17 additions & 0 deletions tests/json_common/mock/date_time_mock.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <zephyr.h>

#include "date_time.h"

/* Mocking function that always converts the input uptime to a known timestamp. */
int date_time_uptime_to_unix_time_ms(int64_t *uptime)
{
*uptime = 1563968747123;

return 0;
}
17 changes: 17 additions & 0 deletions tests/json_common/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# ZTEST
CONFIG_ZTEST=y
CONFIG_ZTEST_STACKSIZE=4096

# cJSON
CONFIG_CJSON_LIB=y

# General
CONFIG_HEAP_MEM_POOL_SIZE=10240
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
14 changes: 14 additions & 0 deletions tests/json_common/prj_native_posix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# ZTEST
CONFIG_ZTEST=y

# cJSON
CONFIG_CJSON_LIB=y

# General
CONFIG_HEAP_MEM_POOL_SIZE=10240
Loading

0 comments on commit 303293a

Please sign in to comment.