Skip to content

Commit 7363492

Browse files
committed
Anjay-zephyr 3.5.0
Features - (commercial feature only) Added support for enabling/disabling bootstrapping from a SIM card in runtime - Added support for T-Mobile DevEdge IoT Developer Kit Improvements - Disabled nRF GNSS priority mode before disconnecting - Added proper support for realtime clock on devices that use the POSIX clock API for that - Reversed dependency between ``ANJAY_ZEPHYR_GPS`` and ``ANJAY_ZEPHYR_GPS_{platform}`` Kconfig options for easier configuration; NOTE: this is a breaking change that may require updating your project configuration files - Reduced number of logs produced when NTP server can't be reached - Changed the default value of `ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_PERMITTED` Kconfig option to `n` - Unified persistence saving and loading order - Added a separate workqueue to perform library-related works Bugfixes - Fixed reboot-related bug that occurred when stopping Anjay while processing the A-GPS request - Fixed invalid memory access when logging errors related to A-GPS requests - Retained location services result codes between objects creation/deletion - (commercial feature only) Fixed compatibility of the Core Persistence feature with the Zephyr TLS socket backend - (commercial feature only) Made sure that Core Persistence data is removed after each attempted use, to prevent old data from being used
1 parent 9472cf9 commit 7363492

33 files changed

+1776
-110
lines changed

CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,38 @@
11
# Changelog
22

3+
## 3.5.0 (September 7th, 2023)
4+
5+
### Features
6+
- (commercial feature only) Added support for enabling/disabling bootstrapping from a SIM card in runtime
7+
- Added support for T-Mobile DevEdge IoT Developer Kit
8+
9+
### Improvements
10+
- Disabled nRF GNSS priority mode before disconnecting
11+
- Added proper support for realtime clock on devices that use the POSIX clock API for that
12+
- Reversed dependency between ``ANJAY_ZEPHYR_GPS`` and ``ANJAY_ZEPHYR_GPS_{platform}`` Kconfig options for easier configuration; NOTE: this is a breaking change that may require updating your project configuration files
13+
- Reduced number of logs produced when NTP server can't be reached
14+
- Changed the default value of `ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_PERMITTED` Kconfig option to `n`
15+
- Unified persistence saving and loading order
16+
- Added a separate workqueue to perform library-related works
17+
18+
### Bugfixes
19+
- Fixed reboot-related bug that occurred when stopping Anjay while processing the A-GPS request
20+
- Fixed invalid memory access when logging errors related to A-GPS requests
21+
- Retained location services result codes between objects creation/deletion
22+
- (commercial feature only) Fixed compatibility of the Core Persistence feature with the Zephyr TLS socket backend
23+
- (commercial feature only) Made sure that Core Persistence data is removed after each attempted use, to prevent old data from being used
24+
325
## 3.4.1 (June 23rd, 2023)
426

527
### Features
628
- (commercial feature only) Added support for bootstrapping from SIM card on
729
nRF9160-based devices
8-
- Added support for nRF700x Wi-FI IC
30+
- Added support for nRF700x Wi-Fi IC
931
- Added Light Control object for LED handling
1032
- Added persistence of attribute storage
1133
- Added support for FOTA of application and modem firmware for nRF9160 using
1234
experimental Advanced Firmware Update object (/33629)
13-
- (commercial feature only) Added support for Core Peristence
35+
- (commercial feature only) Added support for Core Persistence
1436

1537
### Improvements
1638
- Updated Anjay to version 3.4.1

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ if(CONFIG_ANJAY)
6868
src/gps_impl/gps_nrf.c)
6969
endif()
7070

71+
if(CONFIG_ANJAY_ZEPHYR_GPS_CXD5605)
72+
list(APPEND CLIENT_SOURCES
73+
src/gps_impl/gps_cxd5605.c)
74+
endif()
75+
7176
if(CONFIG_ANJAY_ZEPHYR_NRF_LC_INFO)
7277
list(APPEND CLIENT_SOURCES
7378
src/nrf_lc_info.c
@@ -111,6 +116,10 @@ if(CONFIG_ANJAY)
111116
elseif(CONFIG_NET_L2_OPENTHREAD)
112117
list(APPEND CLIENT_SOURCES
113118
src/network/network_openthread.c)
119+
elseif(CONFIG_MODEM_MURATA_1SC OR CONFIG_WIFI_RS9116W)
120+
list(APPEND CLIENT_SOURCES
121+
src/network/network_devedge.c
122+
src/network/network_devedge.h)
114123
elseif(CONFIG_WIFI_ESP32)
115124
list(APPEND CLIENT_SOURCES
116125
src/network/network_esp32.c)

Kconfig.anjay_zephyr

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ config ANJAY_ZEPHYR_MODEL_NUMBER
2424

2525
config ANJAY_ZEPHYR_VERSION
2626
string "Client Version"
27-
default "3.4.1"
27+
default "3.5.0"
2828

2929
config ANJAY_ZEPHYR_AUTOGENERATE_ENDPOINT_NAME
3030
bool "Autogenerate endpoint name"
@@ -104,7 +104,7 @@ menu "Client default options"
104104

105105
config ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_PERMITTED
106106
bool "Default allow temporary activation of the GPS priority mode"
107-
default y
107+
default n
108108
depends on ANJAY_ZEPHYR_GPS_NRF
109109
help
110110
This is a default value, it will be used if there are no saved settings from a previously
@@ -180,10 +180,28 @@ config ANJAY_ZEPHYR_SHELL
180180
select SHELL
181181

182182
config ANJAY_ZEPHYR_GPS
183-
def_bool ANJAY_ZEPHYR_GPS_NRF
183+
bool "Enable GPS"
184+
default n
185+
depends on BOARD_THINGY91_NRF9160_NS || BOARD_NRF9160DK_NRF9160_NS || BOARD_TMO_DEV_EDGE
186+
select AT_CMD if BOARD_THINGY91_NRF9160_NS || BOARD_NRF9160DK_NRF9160_NS
187+
help
188+
Enable GPS implementation.
189+
190+
On nRF9160-based platforms, please note that the system is not able to acquire
191+
the cold GPS fix if the chip is interrupted by any LTE activity. The application
192+
might temporarily enable GPS priority mode, which shuts down LTE completely and
193+
attempts to acquire the fix. This behavior is controlled by
194+
ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_PERMITTED and
195+
ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_COOLDOWN config options.
196+
197+
config ANJAY_ZEPHYR_GPS_NRF
198+
def_bool ANJAY_ZEPHYR_GPS && (BOARD_THINGY91_NRF9160_NS || BOARD_NRF9160DK_NRF9160_NS)
199+
200+
config ANJAY_ZEPHYR_GPS_CXD5605
201+
def_bool ANJAY_ZEPHYR_GPS && BOARD_TMO_DEV_EDGE
184202

185203
config ANJAY_ZEPHYR_GPS_ALTITUDE
186-
def_bool ANJAY_ZEPHYR_GPS_NRF
204+
def_bool ANJAY_ZEPHYR_GPS_NRF || ANJAY_ZEPHYR_GPS_CXD5605
187205

188206
config ANJAY_ZEPHYR_GPS_RADIUS
189207
def_bool ANJAY_ZEPHYR_GPS_NRF
@@ -192,7 +210,7 @@ config ANJAY_ZEPHYR_GPS_VELOCITY
192210
def_bool n
193211

194212
config ANJAY_ZEPHYR_GPS_SPEED
195-
def_bool ANJAY_ZEPHYR_GPS_NRF
213+
def_bool ANJAY_ZEPHYR_GPS_NRF || ANJAY_ZEPHYR_GPS_CXD5605
196214

197215
config ANJAY_ZEPHYR_LOCATION_SERVICES
198216
def_bool ANJAY_ZEPHYR_LOCATION_SERVICES_ASSISTANCE || ANJAY_ZEPHYR_LOCATION_SERVICES_GROUND_FIX_LOCATION
@@ -210,20 +228,8 @@ config ANJAY_ZEPHYR_LOCATION_SERVICES_SERVER_SSID
210228
help
211229
SSID of the server to which requests related to location services will be sent.
212230

213-
menuconfig ANJAY_ZEPHYR_GPS_NRF
214-
bool "Enable GPS on nRF9160-based devices"
215-
default n
216-
depends on BOARD_THINGY91_NRF9160_NS || BOARD_NRF9160DK_NRF9160_NS
217-
select AT_CMD
218-
help
219-
Enable GPS on nRF9160-based devices and Location Object implementation.
220-
221-
Please note, that nRF9160 is not able to acquire the cold GPS fix if
222-
the chip is interrupted by any LTE activity. The application might
223-
temporarily enable GPS priority mode, which shuts down LTE completely and
224-
attempts to acquire the fix. This behavior is controlled by
225-
ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_PERMITTED and
226-
ANJAY_ZEPHYR_GPS_NRF_PRIO_MODE_COOLDOWN config options.
231+
menu "GPS on nRF9160-based devices"
232+
visible if ANJAY_ZEPHYR_GPS_NRF
227233

228234
config ANJAY_ZEPHYR_GPS_NRF_EXTERNAL_ANTENNA
229235
bool "Use external GPS antenna"
@@ -248,6 +254,8 @@ menuconfig ANJAY_ZEPHYR_GPS_NRF
248254
Minimum elevation angle for visible satellites. Only used for A-GPS.
249255
-1 indicates that angle is disabled and filtering shouldn't be used.
250256

257+
endmenu
258+
251259
config ANJAY_ZEPHYR_LOCATION_SERVICES_GROUND_FIX_LOCATION
252260
bool "Enable ground fix location requests"
253261
depends on ANJAY_ZEPHYR_NRF_LC_INFO
@@ -276,7 +284,7 @@ config ANJAY_ZEPHYR_NETWORK_KEEPALIVE_RATE
276284
int "Rate of checking whether the network connection is still alive [seconds]"
277285
default 60
278286
range 1 2147483647
279-
depends on WIFI_ESWIFI
287+
depends on WIFI_ESWIFI || WIFI_RS9116W
280288

281289
choice ANJAY_ZEPHYR_OTA
282290
prompt "Enable Firmware Update Over-the-Air"
@@ -374,4 +382,18 @@ config ANJAY_ZEPHYR_NRF_MODEM_PSK_QUERY
374382
depends on NRF_MODEM_LIB && MODEM_KEY_MGMT
375383
default "1"
376384

385+
config ANJAY_ZEPHYR_WORKQUEUE_ENABLE
386+
bool "Enable Anjay Zephyr workqueue and use it for all works defined in this module"
387+
default BOARD_THINGY91_NRF9160_NS || BOARD_NRF9160DK_NRF9160_NS
388+
389+
config ANJAY_ZEPHYR_WORKQUEUE_STACK_SIZE
390+
int "Anjay Zephyr workqueue stack size"
391+
default 2048
392+
depends on ANJAY_ZEPHYR_WORKQUEUE_ENABLE
393+
394+
config ANJAY_ZEPHYR_WORKQUEUE_PRIORITY
395+
int "Anjay Zephyr workqueue priority"
396+
default 0
397+
depends on ANJAY_ZEPHYR_WORKQUEUE_ENABLE
398+
377399
endmenu

compat/time_compat.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include <avsystem/commons/avs_time.h>
1818
#include <zephyr/kernel.h>
1919

20+
#ifdef CONFIG_POSIX_CLOCK
21+
# include <zephyr/posix/time.h>
22+
#endif // CONFIG_POSIX_CLOCK
23+
2024
#ifdef CONFIG_DATE_TIME
2125
# include <date_time.h>
2226
#endif // CONFIG_DATE_TIME
@@ -26,11 +30,20 @@ avs_time_monotonic_t avs_time_monotonic_now(void) {
2630
}
2731

2832
avs_time_real_t avs_time_real_now(void) {
29-
#ifdef CONFIG_DATE_TIME
33+
#if defined(CONFIG_DATE_TIME)
3034
int64_t time_ms;
3135
if (!date_time_now(&time_ms)) {
3236
return avs_time_real_from_scalar(time_ms, AVS_TIME_MS);
3337
}
34-
#endif // CONFIG_DATE_TIME
38+
#elif defined(CONFIG_POSIX_CLOCK)
39+
struct timespec system_value;
40+
avs_time_real_t result;
41+
clock_gettime(CLOCK_REALTIME, &system_value);
42+
result.since_real_epoch.seconds = system_value.tv_sec;
43+
result.since_real_epoch.nanoseconds = (int32_t) system_value.tv_nsec;
44+
return result;
45+
#endif // defined(CONFIG_DATE_TIME) || defined(CONFIG_POSIX_CLOCK)
46+
#if defined(CONFIG_DATE_TIME) || !defined(CONFIG_POSIX_CLOCK)
3547
return avs_time_real_from_scalar(k_uptime_get(), AVS_TIME_MS);
48+
#endif // defined(CONFIG_DATE_TIME) || !defined(CONFIG_POSIX_CLOCK)
3649
}

config/anjay/anjay_config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@
297297
* (<c>anjay_new_from_core_persistence()</c> and
298298
* <c>anjay_delete_with_core_persistence()</c> APIs).
299299
*
300-
* Requires <c>ANJAY_WITH_OBSERVE</c> to be enabled, and
301-
* <c>AVS_COMMONS_WITH_AVS_PERSISTENCE</c> to be enabled in avs_commons
300+
* Requires <c>ANJAY_WITH_OBSERVE</c> to be enabled,
301+
* <c>AVS_COMMONS_WITH_AVS_PERSISTENCE</c> to be enabled in avs_commons, and
302+
* <c>WITH_AVS_COAP_OBSERVE_PERSISTENCE</c> to be enabled in avs_coap
302303
* configuration.
303304
*
304305
* IMPORTANT: Only available as a commercial feature. Ignored in the open

deps/anjay

Submodule anjay updated 139 files

include_public/anjay_zephyr/bearer_list.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
#pragma once
1818

19+
#if (!!defined(CONFIG_MODEM_MURATA_1SC) + !!defined(CONFIG_WIFI_RS9116W)) > 1
20+
# define ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
21+
#endif // (!!defined(CONFIG_MODEM_MURATA_1SC) +
22+
// !!defined(CONFIG_WIFI_RS9116W)) > 1
23+
1924
enum anjay_zephyr_network_bearer_t {
2025
#ifdef CONFIG_WIFI
2126
ANJAY_ZEPHYR_NETWORK_BEARER_WIFI,
@@ -28,3 +33,10 @@ enum anjay_zephyr_network_bearer_t {
2833
#endif // CONFIG_NET_L2_OPENTHREAD
2934
ANJAY_ZEPHYR_NETWORK_BEARER_LIMIT
3035
};
36+
37+
#ifdef ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
38+
struct anjay_zephyr_network_preferred_bearer_list_t {
39+
enum anjay_zephyr_network_bearer_t
40+
bearers[ANJAY_ZEPHYR_NETWORK_BEARER_LIMIT];
41+
};
42+
#endif // ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS

include_public/anjay_zephyr/config.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
# include <zephyr/net/wifi_mgmt.h>
4040
#endif // CONFIG_WIFI
4141

42+
#ifdef ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
43+
# include "bearer_list.h"
44+
#endif // ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
45+
4246
/**
4347
* Returns the default endpoint name.
4448
*
@@ -69,6 +73,16 @@ int anjay_zephyr_config_get_wifi_ssid(char *buf, size_t buf_capacity);
6973
int anjay_zephyr_config_get_wifi_password(char *buf, size_t buf_capacity);
7074
#endif // CONFIG_WIFI
7175

76+
#ifdef ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
77+
/**
78+
* Get preferred network bearer stored in the settings.
79+
*
80+
* @return Preferred network bearer.
81+
*/
82+
struct anjay_zephyr_network_preferred_bearer_list_t
83+
anjay_zephyr_config_get_preferred_bearers(void);
84+
#endif // ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
85+
7286
#ifndef CONFIG_ANJAY_ZEPHYR_FACTORY_PROVISIONING
7387
/**
7488
* Get the LwM2M client endpoint name stored in the settings.

include_public/anjay_zephyr/location_services.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ typedef enum {
5454
* permanent failure. It means that further location services requests will
5555
* not be processed before device reboot.
5656
*/
57-
ANJAY_ZEPHYR_LOCATION_SERVICES_PERMANENT_FAILURE
57+
ANJAY_ZEPHYR_LOCATION_SERVICES_PERMANENT_FAILURE,
58+
/**
59+
* Anjay was stopped during the request.
60+
*/
61+
ANJAY_ZEPHYR_LOCATION_SERVICES_ANJAY_STOPPED
5862
} anjay_zephyr_location_services_request_result_t;
5963

6064
/**

src/anjay_shell.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,29 @@ cmd_anjay_private_key(const struct shell *shell, size_t argc, char **argv) {
103103
}
104104
# endif // CONFIG_ANJAY_ZEPHYR_RUNTIME_CERT_CONFIG
105105

106+
# ifdef ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
107+
static int cmd_anjay_config_set_preferred_bearer(const struct shell *shell,
108+
size_t argc,
109+
char **argv) {
110+
// We allow setting preferred bearer even when Anjay is running
111+
int result = _anjay_zephyr_config_set_option(shell, argc, argv);
112+
113+
if (result) {
114+
return result;
115+
}
116+
117+
struct anjay_zephyr_network_preferred_bearer_list_t bearers =
118+
anjay_zephyr_config_get_preferred_bearers();
119+
120+
if (_anjay_zephyr_network_set_preferred_bearer_list(&bearers)) {
121+
shell_print(shell,
122+
"Could not change the currently used network bearer");
123+
}
124+
125+
return 0;
126+
}
127+
# endif // ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
128+
106129
static int
107130
cmd_anjay_config_default(const struct shell *shell, size_t argc, char **argv) {
108131
ARG_UNUSED(argc);
@@ -279,6 +302,12 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
279302
"Wi-Fi password (empty for no-sec)",
280303
cmd_anjay_config_set),
281304
# endif // CONFIG_WIFI
305+
# ifdef ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
306+
SHELL_CMD(OPTION_KEY_PREFERRED_BEARER,
307+
NULL,
308+
"Preferred network bearer",
309+
cmd_anjay_config_set_preferred_bearer),
310+
# endif // ANJAY_ZEPHYR_DEVEDGE_MULTIPLE_BEARERS
282311
# ifndef CONFIG_ANJAY_ZEPHYR_FACTORY_PROVISIONING
283312
SHELL_CMD(OPTION_KEY_URI, NULL, "Server URI", cmd_anjay_config_set),
284313
SHELL_CMD(OPTION_KEY_LIFETIME,

0 commit comments

Comments
 (0)