aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-31 10:45:54 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-31 15:18:35 +0100
commit9e24226364f9c635160cdb0ca8a404781091ba7b (patch)
treef8aaeddf6c096a231158b3315736b41d459b2c1d
parentaccd1a5841bafc81aa87db46eb35a8255ced4e22 (diff)
port-probe: MMPortProbeAtCommand always has constant command strings
-rw-r--r--plugins/altair/mm-plugin-altair-lte.c6
-rw-r--r--plugins/nokia/mm-plugin-nokia-icera.c6
-rw-r--r--plugins/nokia/mm-plugin-nokia.c6
-rw-r--r--plugins/pantech/mm-plugin-pantech.c6
-rw-r--r--plugins/zte/mm-plugin-zte.c6
-rw-r--r--src/mm-port-probe-at.h3
-rw-r--r--src/mm-port-probe.c26
7 files changed, 29 insertions, 30 deletions
diff --git a/plugins/altair/mm-plugin-altair-lte.c b/plugins/altair/mm-plugin-altair-lte.c
index f83ce33c..7f6a7c0b 100644
--- a/plugins/altair/mm-plugin-altair-lte.c
+++ b/plugins/altair/mm-plugin-altair-lte.c
@@ -41,9 +41,9 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
take longer to respond after a reset.
*/
static const MMPortProbeAtCommand custom_at_probe[] = {
- { (gchar *) "AT", 7, mm_port_probe_response_processor_is_at },
- { (gchar *) "AT", 7, mm_port_probe_response_processor_is_at },
- { (gchar *) "AT", 7, mm_port_probe_response_processor_is_at },
+ { "AT", 7, mm_port_probe_response_processor_is_at },
+ { "AT", 7, mm_port_probe_response_processor_is_at },
+ { "AT", 7, mm_port_probe_response_processor_is_at },
{ NULL }
};
diff --git a/plugins/nokia/mm-plugin-nokia-icera.c b/plugins/nokia/mm-plugin-nokia-icera.c
index 8a4ed0eb..e2d587a4 100644
--- a/plugins/nokia/mm-plugin-nokia-icera.c
+++ b/plugins/nokia/mm-plugin-nokia-icera.c
@@ -33,9 +33,9 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
/* Custom commands for AT probing */
static const MMPortProbeAtCommand custom_at_probe[] = {
- { (gchar *) "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
- { (gchar *) "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
- { (gchar *) "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
+ { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
+ { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
+ { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
{ NULL }
};
diff --git a/plugins/nokia/mm-plugin-nokia.c b/plugins/nokia/mm-plugin-nokia.c
index a4e05ab8..cb3374ce 100644
--- a/plugins/nokia/mm-plugin-nokia.c
+++ b/plugins/nokia/mm-plugin-nokia.c
@@ -34,9 +34,9 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
/* Custom commands for AT probing */
static const MMPortProbeAtCommand custom_at_probe[] = {
- { (gchar *) "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
- { (gchar *) "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
- { (gchar *) "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
+ { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
+ { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
+ { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
{ NULL }
};
diff --git a/plugins/pantech/mm-plugin-pantech.c b/plugins/pantech/mm-plugin-pantech.c
index 312cb324..66eb6453 100644
--- a/plugins/pantech/mm-plugin-pantech.c
+++ b/plugins/pantech/mm-plugin-pantech.c
@@ -66,9 +66,9 @@ port_probe_response_processor_is_pantech_at (const gchar *command,
}
static const MMPortProbeAtCommand custom_at_probe[] = {
- { (gchar *) "ATE0", 3, port_probe_response_processor_is_pantech_at },
- { (gchar *) "ATE0", 3, port_probe_response_processor_is_pantech_at },
- { (gchar *) "ATE0", 3, port_probe_response_processor_is_pantech_at },
+ { "ATE0", 3, port_probe_response_processor_is_pantech_at },
+ { "ATE0", 3, port_probe_response_processor_is_pantech_at },
+ { "ATE0", 3, port_probe_response_processor_is_pantech_at },
{ NULL }
};
diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c
index fcac8ee3..7b0849f1 100644
--- a/plugins/zte/mm-plugin-zte.c
+++ b/plugins/zte/mm-plugin-zte.c
@@ -51,9 +51,9 @@ MM_PLUGIN_DEFINE_MINOR_VERSION
* We use this command also for checking AT support in the port.
*/
static const MMPortProbeAtCommand custom_at_probe[] = {
- { (gchar *) "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
- { (gchar *) "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
- { (gchar *) "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
+ { "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
+ { "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
+ { "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
{ NULL }
};
diff --git a/src/mm-port-probe-at.h b/src/mm-port-probe-at.h
index 359a6f5d..851bf0fb 100644
--- a/src/mm-port-probe-at.h
+++ b/src/mm-port-probe-at.h
@@ -52,7 +52,7 @@ typedef gboolean (* MMPortProbeAtResponseProcessor) (const gchar *command,
/* Struct to configure port probing commands */
typedef struct {
/* The AT command */
- gchar *command;
+ const gchar *command;
/* Timeout of the command, in seconds */
guint timeout;
/* The response processor */
@@ -76,5 +76,4 @@ gboolean mm_port_probe_response_processor_is_at (const gchar *command,
GVariant **result,
GError **result_error);
-
#endif /* MM_PORT_PROBE_AT_H */
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index f7708f31..1700111f 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -1104,35 +1104,35 @@ serial_probe_at (MMPortProbe *self)
}
static const MMPortProbeAtCommand at_probing[] = {
- { (gchar *)"AT", 3, mm_port_probe_response_processor_is_at },
- { (gchar *)"AT", 3, mm_port_probe_response_processor_is_at },
- { (gchar *)"AT", 3, mm_port_probe_response_processor_is_at },
+ { "AT", 3, mm_port_probe_response_processor_is_at },
+ { "AT", 3, mm_port_probe_response_processor_is_at },
+ { "AT", 3, mm_port_probe_response_processor_is_at },
{ NULL }
};
static const MMPortProbeAtCommand vendor_probing[] = {
- { (gchar *)"+CGMI", 3, mm_port_probe_response_processor_string },
- { (gchar *)"+GMI", 3, mm_port_probe_response_processor_string },
- { (gchar *)"I", 3, mm_port_probe_response_processor_string },
+ { "+CGMI", 3, mm_port_probe_response_processor_string },
+ { "+GMI", 3, mm_port_probe_response_processor_string },
+ { "I", 3, mm_port_probe_response_processor_string },
{ NULL }
};
static const MMPortProbeAtCommand product_probing[] = {
- { (gchar *)"+CGMM", 3, mm_port_probe_response_processor_string },
- { (gchar *)"+GMM", 3, mm_port_probe_response_processor_string },
- { (gchar *)"I", 3, mm_port_probe_response_processor_string },
+ { "+CGMM", 3, mm_port_probe_response_processor_string },
+ { "+GMM", 3, mm_port_probe_response_processor_string },
+ { "I", 3, mm_port_probe_response_processor_string },
{ NULL }
};
static const MMPortProbeAtCommand icera_probing[] = {
- { (gchar *)"%IPSYS?", 3, mm_port_probe_response_processor_string },
- { (gchar *)"%IPSYS?", 3, mm_port_probe_response_processor_string },
- { (gchar *)"%IPSYS?", 3, mm_port_probe_response_processor_string },
+ { "%IPSYS?", 3, mm_port_probe_response_processor_string },
+ { "%IPSYS?", 3, mm_port_probe_response_processor_string },
+ { "%IPSYS?", 3, mm_port_probe_response_processor_string },
{ NULL }
};
static const MMPortProbeAtCommand xmm_probing[] = {
- { (gchar *)"+XACT=?", 3, mm_port_probe_response_processor_string },
+ { "+XACT=?", 3, mm_port_probe_response_processor_string },
{ NULL }
};