From a1727baa9c57466517e76b635e7c27bf177acda2 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 18 Jun 2019 17:11:03 +0300 Subject: [MTR-MTQ] Quectel support for sms-utils - Added new "manufacturer" field to the "global_core" structure - Added the "atcmd_plus_gmi_read()" function to fetch manufacturer identification - Added a call to the "atcmd_plus_gmi_read()" in "sms_atcmd_init()" - Added "is_telit_model()" and "is_quectel_model()" functions to pick a proper manufacturer-specific command in "atcmd_plus_iccid_read()" and, possibly, other commands in the future - Tabs VS spaces. This project uses tabs --- src/global.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/global.h') diff --git a/src/global.h b/src/global.h index fc8df6f..764cc06 100644 --- a/src/global.h +++ b/src/global.h @@ -29,8 +29,9 @@ struct global_core { char *msg_store_send; char *msg_store_new; char *pb_store; - char *model; - char *iccid; /* Needed for LNA3/Verizon */ + char *model; + char *iccid; /* Needed for LNA3/Verizon */ + char *manufacturer; /* Needed to pick proper manufacturer-specific commands */ char *editor; char *edit_file; -- cgit v1.2.3 From 026a3d974673fe2d87793c93496c2bb829ccf1d6 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 18 Jun 2019 17:22:51 +0300 Subject: [MTR-MTQ] Quectel support for sms-utils Switched from dynamically-allocated to statically-allocated variables for data fetched from the modem. --- src/global.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/global.h') diff --git a/src/global.h b/src/global.h index 764cc06..a6073dd 100644 --- a/src/global.h +++ b/src/global.h @@ -12,6 +12,13 @@ #define GLOBAL_EXTERN extern #endif +#define ICCID_LEN 23 +#define ICCID_SIZE (ICCID_LEN + 1) +#define MODEL_LEN 1023 +#define MODEL_SIZE (MODEL_LEN + 1) +#define MANUFACTURER_LEN 1023 +#define MANUFACTURER_SIZE (MANUFACTURER_LEN + 1) + struct global_user { char *name; char *email; @@ -29,9 +36,9 @@ struct global_core { char *msg_store_send; char *msg_store_new; char *pb_store; - char *model; - char *iccid; /* Needed for LNA3/Verizon */ - char *manufacturer; /* Needed to pick proper manufacturer-specific commands */ + char model[MODEL_SIZE]; + char iccid[ICCID_SIZE]; /* Needed for LNA3/Verizon */ + char manufacturer[MANUFACTURER_SIZE]; /* Needed to pick proper manufacturer-specific commands */ char *editor; char *edit_file; -- cgit v1.2.3