Skip to content

Commit 383da27

Browse files
hmhalvorsenlemrey
authored andcommitted
lib: modem_info: Board name to device string
The current compiled board is added to the device string. Changes to some data names. Signed-off-by: Henrik Malvik Halvorsen <[email protected]>
1 parent 49c0e7f commit 383da27

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

lib/modem_info/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,11 @@ config MODEM_INFO_THREAD_PRIO
3737
default 0 if !MULTITHREADING
3838
default 9
3939

40+
config MODEM_INFO_ADD_BOARD
41+
bool "Add board name to JSON string"
42+
default y
43+
help
44+
Add the name of the board to the returned
45+
device JSON string.
46+
4047
endif # MODEM_INFO

lib/modem_info/modem_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ static const char *const modem_data_name[] = {
180180
[MODEM_INFO_OPERATOR] = "OPERATOR",
181181
[MODEM_INFO_CELLID] = "CELLID",
182182
[MODEM_INFO_IP_ADDRESS] = "IP ADDRESS",
183-
[MODEM_INFO_UICC] = "SIM",
183+
[MODEM_INFO_UICC] = "UICC STATE",
184184
[MODEM_INFO_BATTERY] = "BATTERY",
185185
[MODEM_INFO_TEMP] = "TEMP",
186-
[MODEM_INFO_FW_VERSION] = "FW",
186+
[MODEM_INFO_FW_VERSION] = "MODEM FW",
187187
[MODEM_INFO_ICCID] = "ICCID",
188188
};
189189

lib/modem_info/modem_info_json.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ int modem_info_json_string_get(char *buf)
146146
}
147147
}
148148

149+
if (IS_ENABLED(CONFIG_MODEM_INFO_ADD_BOARD)) {
150+
ret += json_add_str(data_obj, "BOARD", CONFIG_BOARD);
151+
}
152+
149153
if (ret != 0) {
150154
cJSON_Delete(data_obj);
151155
return -ENOMEM;

0 commit comments

Comments
 (0)