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 Jan 28, 2023
1 parent feaf086 commit 0b2740c
Show file tree
Hide file tree
Showing 14 changed files with 725 additions and 716 deletions.
6 changes: 4 additions & 2 deletions src/cloud/aws_iot_integration.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ int cloud_wrap_state_send(char *buf, size_t len, bool ack, uint32_t id)
return 0;
}

int cloud_wrap_data_send(char *buf, size_t len, bool ack, uint32_t id, char *path_list[])
int cloud_wrap_data_send(char *buf, size_t len, bool ack, uint32_t id,
const struct lwm2m_obj_path path_list[])
{
ARG_UNUSED(path_list);

Expand Down Expand Up @@ -461,7 +462,8 @@ int cloud_wrap_batch_send(char *buf, size_t len, bool ack, uint32_t id)
return 0;
}

int cloud_wrap_ui_send(char *buf, size_t len, bool ack, uint32_t id, char *path_list[])
int cloud_wrap_ui_send(char *buf, size_t len, bool ack, uint32_t id,
const struct lwm2m_obj_path path_list[])
{
ARG_UNUSED(path_list);

Expand Down
6 changes: 4 additions & 2 deletions src/cloud/azure_iot_hub_integration.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ int cloud_wrap_state_send(char *buf, size_t len, bool ack, uint32_t id)
return 0;
}

int cloud_wrap_data_send(char *buf, size_t len, bool ack, uint32_t id, char *path_list[])
int cloud_wrap_data_send(char *buf, size_t len, bool ack, uint32_t id,
const struct lwm2m_obj_path path_list[])
{
ARG_UNUSED(path_list);

Expand Down Expand Up @@ -460,7 +461,8 @@ int cloud_wrap_batch_send(char *buf, size_t len, bool ack, uint32_t id)
return 0;
}

int cloud_wrap_ui_send(char *buf, size_t len, bool ack, uint32_t id, char *path_list[])
int cloud_wrap_ui_send(char *buf, size_t len, bool ack, uint32_t id,
const struct lwm2m_obj_path path_list[])
{
ARG_UNUSED(path_list);

Expand Down
9 changes: 7 additions & 2 deletions src/cloud/cloud_codec/cloud_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
#include <net/wifi_location_common.h>
#include <nrf_modem_gnss.h>

#if defined(CONFIG_LWM2M)
#include <zephyr/net/lwm2m.h>
#else
#include "lwm2m/lwm2m_dummy.h"
#endif

/**@file
*
* @defgroup cloud_codec Cloud codec.
Expand Down Expand Up @@ -189,8 +195,7 @@ struct cloud_codec_data {
/** Length of encoded output. */
size_t len;
/** LwM2M object paths. */
char paths[CONFIG_CLOUD_CODEC_LWM2M_PATH_LIST_ENTRIES_MAX]
[CONFIG_CLOUD_CODEC_LWM2M_PATH_ENTRY_SIZE_MAX];
struct lwm2m_obj_path paths[CONFIG_CLOUD_CODEC_LWM2M_PATH_LIST_ENTRIES_MAX];
/** Number of valid paths in the paths variable. */
uint8_t valid_object_paths;
};
Expand Down
44 changes: 22 additions & 22 deletions src/cloud/cloud_codec/lwm2m/lwm2m_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ int cloud_codec_encode_data(struct cloud_codec_data *output,
err = lwm2m_codec_helpers_set_gnss_data(gnss_buf);
if (err == 0) {

static const char * const path_list[] = {
LWM2M_PATH(LWM2M_OBJECT_LOCATION_ID)
static const struct lwm2m_obj_path path_list[] = {
LWM2M_OBJ(LWM2M_OBJECT_LOCATION_ID)
};

err = lwm2m_codec_helpers_object_path_list_add(output,
Expand All @@ -182,9 +182,9 @@ int cloud_codec_encode_data(struct cloud_codec_data *output,
err = lwm2m_codec_helpers_set_modem_dynamic_data(modem_dyn_buf);
if (err == 0) {

static const char * const path_list[] = {
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, CURRENT_TIME_RID),
LWM2M_PATH(LWM2M_OBJECT_CONNECTIVITY_MONITORING_ID)
static const struct lwm2m_obj_path path_list[] = {
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, CURRENT_TIME_RID),
LWM2M_OBJ(LWM2M_OBJECT_CONNECTIVITY_MONITORING_ID)
};

err = lwm2m_codec_helpers_object_path_list_add(output,
Expand All @@ -206,12 +206,12 @@ int cloud_codec_encode_data(struct cloud_codec_data *output,
err = lwm2m_codec_helpers_set_modem_static_data(modem_stat_buf);
if (err == 0) {

static const char * const path_list[] = {
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, MANUFACTURER_RID),
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, MODEL_NUMBER_RID),
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, SOFTWARE_VERSION_RID),
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, FIRMWARE_VERSION_RID),
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, DEVICE_SERIAL_NUMBER_ID)
static const struct lwm2m_obj_path path_list[] = {
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, MANUFACTURER_RID),
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, MODEL_NUMBER_RID),
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, SOFTWARE_VERSION_RID),
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, FIRMWARE_VERSION_RID),
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, DEVICE_SERIAL_NUMBER_ID)
};

err = lwm2m_codec_helpers_object_path_list_add(output,
Expand All @@ -233,8 +233,8 @@ int cloud_codec_encode_data(struct cloud_codec_data *output,
err = lwm2m_codec_helpers_set_battery_data(bat_buf);
if (err == 0) {

static const char * const path_list[] = {
LWM2M_PATH(LWM2M_OBJECT_DEVICE_ID, 0, POWER_SOURCE_VOLTAGE_RID)
static const struct lwm2m_obj_path path_list[] = {
LWM2M_OBJ(LWM2M_OBJECT_DEVICE_ID, 0, POWER_SOURCE_VOLTAGE_RID)
};

err = lwm2m_codec_helpers_object_path_list_add(output,
Expand All @@ -257,13 +257,13 @@ int cloud_codec_encode_data(struct cloud_codec_data *output,
err = lwm2m_codec_helpers_set_sensor_data(sensor_buf);
if (err == 0) {

static const char * const path_list[] = {
LWM2M_PATH(IPSO_OBJECT_TEMP_SENSOR_ID, 0, TIMESTAMP_RID),
LWM2M_PATH(IPSO_OBJECT_HUMIDITY_SENSOR_ID, 0, TIMESTAMP_RID),
LWM2M_PATH(IPSO_OBJECT_PRESSURE_ID, 0, TIMESTAMP_RID),
LWM2M_PATH(IPSO_OBJECT_TEMP_SENSOR_ID, 0, SENSOR_VALUE_RID),
LWM2M_PATH(IPSO_OBJECT_HUMIDITY_SENSOR_ID, 0, SENSOR_VALUE_RID),
LWM2M_PATH(IPSO_OBJECT_PRESSURE_ID, 0, SENSOR_VALUE_RID)
static const struct lwm2m_obj_path path_list[] = {
LWM2M_OBJ(IPSO_OBJECT_TEMP_SENSOR_ID, 0, TIMESTAMP_RID),
LWM2M_OBJ(IPSO_OBJECT_HUMIDITY_SENSOR_ID, 0, TIMESTAMP_RID),
LWM2M_OBJ(IPSO_OBJECT_PRESSURE_ID, 0, TIMESTAMP_RID),
LWM2M_OBJ(IPSO_OBJECT_TEMP_SENSOR_ID, 0, SENSOR_VALUE_RID),
LWM2M_OBJ(IPSO_OBJECT_HUMIDITY_SENSOR_ID, 0, SENSOR_VALUE_RID),
LWM2M_OBJ(IPSO_OBJECT_PRESSURE_ID, 0, SENSOR_VALUE_RID)
};

err = lwm2m_codec_helpers_object_path_list_add(output,
Expand Down Expand Up @@ -300,8 +300,8 @@ int cloud_codec_encode_ui_data(struct cloud_codec_data *output,
return err;
}

static const char * const path_list[] = {
LWM2M_PATH(IPSO_OBJECT_PUSH_BUTTON_ID),
static const struct lwm2m_obj_path path_list[] = {
LWM2M_OBJ(IPSO_OBJECT_PUSH_BUTTON_ID),
};

err = lwm2m_codec_helpers_object_path_list_add(output, path_list, ARRAY_SIZE(path_list));
Expand Down
Loading

0 comments on commit 0b2740c

Please sign in to comment.