Skip to content

Commit c7d1f1b

Browse files
authored
Merge pull request #27 from golioth/merge/template_v2.7.1
Merge/template v2.7.1
2 parents 492a57c + 80c0dc8 commit c7d1f1b

File tree

6 files changed

+40
-34
lines changed

6 files changed

+40
-34
lines changed

prj.conf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ CONFIG_ZVFS_OPEN_MAX=23
2121
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1536
2222
CONFIG_MBEDTLS_ENABLE_HEAP=y
2323
CONFIG_MBEDTLS_HEAP_SIZE=10240
24-
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048
25-
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048
2624
CONFIG_NETWORKING=y
2725
CONFIG_NET_IPV4=y
26+
CONFIG_COAP_EXTENDED_OPTIONS_LEN=y
27+
CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=39
2828

2929
# Application
3030
CONFIG_MAIN_STACK_SIZE=2048
31-
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
3231
CONFIG_NET_LOG=y
3332
CONFIG_SHELL=y
3433
CONFIG_REBOOT=y
@@ -49,8 +48,6 @@ CONFIG_GOLIOTH_SAMPLE_SETTINGS=y
4948
CONFIG_GOLIOTH_SAMPLE_SETTINGS_AUTOLOAD=y
5049
CONFIG_GOLIOTH_SAMPLE_SETTINGS_SHELL=y
5150

52-
# Misc.
53-
CONFIG_NETWORK_INFO=y
5451
# Longer response length needed for network info
5552
CONFIG_GOLIOTH_RPC_MAX_RESPONSE_LEN=512
5653
CONFIG_I2C=y

socs/nrf9151_ns.conf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Copyright (c) 2024 Golioth, Inc.
2-
# SPDX-License-Identifier: Apache-2.0
3-
41
# General config
52
CONFIG_HEAP_MEM_POOL_SIZE=4096
63
CONFIG_NEWLIB_LIBC=y
@@ -25,8 +22,8 @@ CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n
2522
CONFIG_NET_CONNECTION_MANAGER=y
2623
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024
2724

28-
# Add Logs for LTE Link Handler
29-
CONFIG_GOLIOTH_SAMPLE_NRF91_LTE_MONITOR=y
25+
# Increased sysworkq size, due to LTE connectivity
26+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
3027

3128
# Disable options y-selected by NCS for no good reason
3229
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED=n
@@ -38,8 +35,13 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=n
3835
CONFIG_NORDIC_SECURITY_BACKEND=n
3936
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y
4037

41-
# Add Network Info Support
42-
CONFIG_MODEM_INFO=y
38+
# Configure Golioth SDK dependencies (for NCS)
39+
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048
40+
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048
4341

4442
# Generate MCUboot compatible images
4543
CONFIG_BOOTLOADER_MCUBOOT=y
44+
45+
# Add Network Info Support
46+
CONFIG_NETWORK_INFO=y
47+
CONFIG_MODEM_INFO=y

socs/nrf9160_ns.conf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Copyright (c) 2024 Golioth, Inc.
2-
# SPDX-License-Identifier: Apache-2.0
3-
41
# General config
52
CONFIG_HEAP_MEM_POOL_SIZE=4096
63
CONFIG_NEWLIB_LIBC=y
@@ -25,8 +22,8 @@ CONFIG_NRF_MODEM_LIB_NET_IF_AUTO_CONNECT=n
2522
CONFIG_NET_CONNECTION_MANAGER=y
2623
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024
2724

28-
# Add Logs for LTE Link Handler
29-
CONFIG_GOLIOTH_SAMPLE_NRF91_LTE_MONITOR=y
25+
# Increased sysworkq size, due to LTE connectivity
26+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
3027

3128
# Disable options y-selected by NCS for no good reason
3229
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED=n
@@ -38,8 +35,13 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=n
3835
CONFIG_NORDIC_SECURITY_BACKEND=n
3936
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y
4037

41-
# Add Network Info Support
42-
CONFIG_MODEM_INFO=y
38+
# Configure Golioth SDK dependencies (for NCS)
39+
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048
40+
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048
4341

4442
# Generate MCUboot compatible images
4543
CONFIG_BOOTLOADER_MCUBOOT=y
44+
45+
# Add Network Info Support
46+
CONFIG_NETWORK_INFO=y
47+
CONFIG_MODEM_INFO=y

src/app_rpc.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ LOG_MODULE_REGISTER(app_rpc, LOG_LEVEL_DBG);
1212
#include <zephyr/logging/log_ctrl.h>
1313
#include <zephyr/sys/reboot.h>
1414

15+
#ifdef CONFIG_NETWORK_INFO
1516
#include <network_info.h>
17+
#endif
18+
1619
#include "app_buzzer.h"
1720
#include "app_rpc.h"
1821

@@ -36,9 +39,9 @@ static enum golioth_rpc_status on_get_network_info(zcbor_state_t *request_params
3639
zcbor_state_t *response_detail_map,
3740
void *callback_arg)
3841
{
39-
network_info_add_to_map(response_detail_map);
40-
41-
return GOLIOTH_RPC_OK;
42+
COND_CODE_1(CONFIG_NETWORK_INFO,
43+
(network_info_add_to_map(response_detail_map); return GOLIOTH_RPC_OK;),
44+
(return GOLIOTH_RPC_UNIMPLEMENTED););
4245
}
4346

4447
static enum golioth_rpc_status on_set_log_level(zcbor_state_t *request_params_array,
@@ -138,8 +141,7 @@ static enum golioth_rpc_status on_play_song(zcbor_state_t *request_params_array,
138141
}
139142

140143
static enum golioth_rpc_status on_reboot(zcbor_state_t *request_params_array,
141-
zcbor_state_t *response_detail_map,
142-
void *callback_arg)
144+
zcbor_state_t *response_detail_map, void *callback_arg)
143145
{
144146
/* Use work queue so this RPC can return confirmation to Golioth */
145147
k_work_submit(&reboot_work);

src/main.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LOG_MODULE_REGISTER(thingy91_golioth, LOG_LEVEL_DBG);
2020
#include <samples/common/sample_credentials.h>
2121
#include <zephyr/kernel.h>
2222

23-
#if defined(CONFIG_SOC_SERIES_NRF91X)
23+
#ifdef CONFIG_SOC_SERIES_NRF91X
2424
#include <modem/lte_lc.h>
2525
#endif
2626

@@ -32,7 +32,7 @@ LOG_MODULE_REGISTER(thingy91_golioth, LOG_LEVEL_DBG);
3232

3333
/* Current firmware version; update in VERSION */
3434
static const char *_current_version =
35-
STRINGIFY(APP_VERSION_MAJOR) "." STRINGIFY(APP_VERSION_MINOR) "." STRINGIFY(APP_PATCHLEVEL);
35+
STRINGIFY(APP_VERSION_MAJOR) "." STRINGIFY(APP_VERSION_MINOR) "." STRINGIFY(APP_PATCHLEVEL);
3636

3737
static struct golioth_client *client;
3838
K_SEM_DEFINE(connected, 0, 1);
@@ -47,8 +47,7 @@ void wake_system_thread(void)
4747
k_wakeup(_system_thread);
4848
}
4949

50-
static void on_client_event(struct golioth_client *client,
51-
enum golioth_client_event event,
50+
static void on_client_event(struct golioth_client *client, enum golioth_client_event event,
5251
void *arg)
5352
{
5453
bool is_connected = (event == GOLIOTH_CLIENT_EVENT_CONNECTED);
@@ -74,7 +73,6 @@ static void start_golioth_client(void)
7473
/* Initialize DFU components */
7574
golioth_fw_update_init(client, _current_version);
7675

77-
7876
/*** Call Golioth APIs for other services in dedicated app files ***/
7977

8078
/* Observe State service data */
@@ -90,7 +88,7 @@ static void start_golioth_client(void)
9088
app_rpc_register(client);
9189
}
9290

93-
#if defined(CONFIG_SOC_SERIES_NRF91X)
91+
#ifdef CONFIG_SOC_SERIES_NRF91X
9492

9593
static void lte_handler(const struct lte_lc_evt *const evt)
9694
{
@@ -110,7 +108,7 @@ static void lte_handler(const struct lte_lc_evt *const evt)
110108
}
111109
}
112110

113-
#endif /* CONFIG_SOC_NRF9160 */
111+
#endif /* CONFIG_SOC_SERIES_NRF91X */
114112

115113
#ifdef CONFIG_MODEM_INFO
116114
static void log_modem_firmware_version(void)
@@ -153,7 +151,7 @@ int main(void)
153151
/* Get system thread id so loop delay change event can wake main */
154152
_system_thread = k_current_get();
155153

156-
#if defined(CONFIG_SOC_SERIES_NRF91X)
154+
#ifdef CONFIG_SOC_SERIES_NRF91X
157155
/* Start LTE asynchronously if the nRF9160 is used.
158156
* Golioth Client will start automatically when LTE connects
159157
*/
@@ -175,7 +173,7 @@ int main(void)
175173

176174
/* Block until connected to Golioth */
177175
k_sem_take(&connected, K_FOREVER);
178-
#endif /* CONFIG_SOC_NRF9160 */
176+
#endif /* CONFIG_SOC_SERIES_NRF91X */
179177

180178
err = app_buzzer_init();
181179
if (err) {

west.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ manifest:
1010
projects:
1111
- name: golioth
1212
path: modules/lib/golioth-firmware-sdk
13-
revision: v0.17.0
13+
revision: v0.18.0
1414
url: https://github.com/golioth/golioth-firmware-sdk.git
1515
west-commands: scripts/west-commands.yml
1616
submodules: true
@@ -47,5 +47,10 @@ manifest:
4747
revision: v1.2.0
4848
url: https://github.com/golioth/zephyr-network-info
4949

50+
- name: golioth-battery-monitor
51+
path: deps/modules/lib/battery-monitor
52+
revision: v1.0.0
53+
url: https://github.com/golioth/battery-monitor
54+
5055
self:
5156
path: app

0 commit comments

Comments
 (0)