Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Golioth Zephyr SDK to v0.16.0 #111

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions boards/aludel_elixir_ns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ CONFIG_GOLIOTH_SAMPLE_NRF91_LTE_MONITOR=y
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED=n
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=n

# MbedTLS configuration to support p-384 curve. These options
# enable using the MbedTLS built-in support for operations not
# supported by the default nRF Oberon crypto backend
CONFIG_NORDIC_SECURITY_BACKEND=n
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y

# Add Network Info Support
CONFIG_MODEM_INFO=y

Expand Down
6 changes: 6 additions & 0 deletions boards/aludel_mini_nrf9160_ns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ CONFIG_GOLIOTH_SAMPLE_NRF91_LTE_MONITOR=y
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED=n
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED=n

# MbedTLS configuration to support p-384 curve. These options
# enable using the MbedTLS built-in support for operations not
# supported by the default nRF Oberon crypto backend
CONFIG_NORDIC_SECURITY_BACKEND=n
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y

# Battery Support
CONFIG_ALUDEL_BATTERY_MONITOR=y

Expand Down
4 changes: 2 additions & 2 deletions prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ CONFIG_GOLIOTH_STREAM=y
CONFIG_GOLIOTH_SAMPLE_COMMON=y

# Configure Golioth SDK dependencies
CONFIG_EVENTFD_MAX=14
CONFIG_ZVFS_EVENTFD_MAX=14
CONFIG_ZVFS_OPEN_MAX=23
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1536
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=10240
CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=2048
CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048
CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
CONFIG_POSIX_MAX_FDS=23

# Application
CONFIG_MAIN_STACK_SIZE=2048
Expand Down
8 changes: 4 additions & 4 deletions src/app_sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ static struct golioth_client *client;
/* Add Sensor structs here */

/* Callback for LightDB Stream */
static void async_error_handler(struct golioth_client *client,
const struct golioth_response *response, const char *path,
static void async_error_handler(struct golioth_client *client, enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code, const char *path,
void *arg)
{
if (response->status != GOLIOTH_OK) {
LOG_ERR("Async task failed: %d", response->status);
if (status != GOLIOTH_OK) {
LOG_ERR("Async task failed: %d", status);
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(app_settings, LOG_LEVEL_DBG);

static int32_t _loop_delay_s = 60;
#define LOOP_DELAY_S_MAX 43200
#define LOOP_DELAY_S_MIN 0
#define LOOP_DELAY_S_MIN 1

int32_t get_loop_delay_s(void)
{
Expand Down
25 changes: 11 additions & 14 deletions src/app_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ uint32_t _example_int1 = 1;
static struct golioth_client *client;

static void async_handler(struct golioth_client *client,
const struct golioth_response *response,
const char *path,
void *arg)
enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code,
const char *path,
void *arg)
{
if (response->status != GOLIOTH_OK) {
LOG_WRN("Failed to set state: %d", response->status);
if (status != GOLIOTH_OK) {
LOG_WRN("Failed to set state: %d", status);
return;
}

Expand Down Expand Up @@ -81,20 +82,16 @@ int app_state_update_actual(void)
return err;
}

static void app_state_desired_handler(struct golioth_client *client,
const struct golioth_response *response,
const char *path,
const uint8_t *payload,
size_t payload_size,
static void app_state_desired_handler(struct golioth_client *client, enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code,
const char *path, const uint8_t *payload, size_t payload_size,
void *arg)
{
int err = 0;
int ret;

if (response->status != GOLIOTH_OK) {
LOG_ERR("Failed to receive '%s' endpoint: %d",
APP_STATE_DESIRED_ENDP,
response->status);
if (status != GOLIOTH_OK) {
LOG_ERR("Failed to receive '%s' endpoint: %d", APP_STATE_DESIRED_ENDP, status);
return;
}

Expand Down
8 changes: 4 additions & 4 deletions src/battery_monitor/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ void log_battery_data(void)
LOG_INF("Battery measurement: voltage=%s, level=%s", get_batt_v_str(), get_batt_lvl_str());
}

static void async_error_handler(struct golioth_client *client,
const struct golioth_response *response, const char *path,
static void async_error_handler(struct golioth_client *client, enum golioth_status status,
const struct golioth_coap_rsp_code *coap_rsp_code, const char *path,
void *arg)
{
if (response->status != GOLIOTH_OK) {
LOG_ERR("Failed to stream battery data: %d", response->status);
if (status != GOLIOTH_OK) {
LOG_ERR("Failed to stream battery data: %d", status);
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ manifest:
projects:
- name: golioth
path: modules/lib/golioth-firmware-sdk
revision: v0.15.0
revision: v0.16.0
url: https://github.com/golioth/golioth-firmware-sdk.git
west-commands: scripts/west-commands.yml
submodules: true
Expand Down