Re: [PATCH] telit: fix AT+SERVICE 3GPP2 access technology reporting

2017-04-05 Thread Daniele Palmas
Hi Dan,

2017-04-03 21:52 GMT+02:00 Dan Williams :
> Looks like a C error from the AT#PSNT codepath; all the docs
> I can find indicate that AT+SERVICE returns only an integer and
> no commas:

Confirmed, when this command is supported as far as I know there is
only one integer.

Regards,
Daniele

>
>  (ttyUSB2): --> 'AT+SERVICE?'
>  (ttyUSB2): <-- '+SERVICE: 3OK'
>  Couldn't refresh access technologies: 'Failed to parse +SERVICE 
> response: '+SERVICE: 3''
> ---
>  plugins/telit/mm-broadband-modem-telit.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/plugins/telit/mm-broadband-modem-telit.c 
> b/plugins/telit/mm-broadband-modem-telit.c
> index 6ef340f..7d453c8 100644
> --- a/plugins/telit/mm-broadband-modem-telit.c
> +++ b/plugins/telit/mm-broadband-modem-telit.c
> @@ -828,7 +828,7 @@ response_processor_service_ignore_at_errors (MMBaseModem 
> *self,
>   GVariant **result,
>   GError **result_error)
>  {
> -const gchar *service, *mode;
> +const gchar *service;
>
>  if (error) {
>  /* Ignore AT errors (ie, ERROR or CMx ERROR) */
> @@ -838,9 +838,8 @@ response_processor_service_ignore_at_errors (MMBaseModem 
> *self,
>  }
>
>  service = mm_strip_tag (response, "+SERVICE:");
> -mode = strchr (service, ',');
> -if (mode) {
> -switch (atoi (++mode)) {
> +if (service) {
> +switch (atoi (service)) {
>  case 1:
>  *result = g_variant_new_uint32 
> (MM_MODEM_ACCESS_TECHNOLOGY_1XRTT);
>  return TRUE;
> --
> 2.9.3
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


[PATCH] telit: fix AT+SERVICE 3GPP2 access technology reporting

2017-04-03 Thread Dan Williams
Looks like a C error from the AT#PSNT codepath; all the docs
I can find indicate that AT+SERVICE returns only an integer and
no commas:

 (ttyUSB2): --> 'AT+SERVICE?'
 (ttyUSB2): <-- '+SERVICE: 3OK'
 Couldn't refresh access technologies: 'Failed to parse +SERVICE 
response: '+SERVICE: 3''
---
 plugins/telit/mm-broadband-modem-telit.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/plugins/telit/mm-broadband-modem-telit.c 
b/plugins/telit/mm-broadband-modem-telit.c
index 6ef340f..7d453c8 100644
--- a/plugins/telit/mm-broadband-modem-telit.c
+++ b/plugins/telit/mm-broadband-modem-telit.c
@@ -828,7 +828,7 @@ response_processor_service_ignore_at_errors (MMBaseModem 
*self,
  GVariant **result,
  GError **result_error)
 {
-const gchar *service, *mode;
+const gchar *service;
 
 if (error) {
 /* Ignore AT errors (ie, ERROR or CMx ERROR) */
@@ -838,9 +838,8 @@ response_processor_service_ignore_at_errors (MMBaseModem 
*self,
 }
 
 service = mm_strip_tag (response, "+SERVICE:");
-mode = strchr (service, ',');
-if (mode) {
-switch (atoi (++mode)) {
+if (service) {
+switch (atoi (service)) {
 case 1:
 *result = g_variant_new_uint32 (MM_MODEM_ACCESS_TECHNOLOGY_1XRTT);
 return TRUE;
-- 
2.9.3
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel