On 06/17/2015 04:58 PM, Dan Williams wrote:
That would seem to indicate that we need a ModemManager plugin for the XT to selectively ignore COPS. Given that the modem probably only has one operator and probably always searches automatically for it (unlike some modems which the COPS=0 is designed to handle) it should probably be ignored.

I agree, COPS=0 should just be ignored / not sent. The Thuraya XT always searches for its network, and there's only one provider.

I'll bet it doesn't list anything, or it may not list any result for "IPV4" 
contexts.

Actually no, it does look relatively sane, it just likes to add lots of spaces in its response...

ModemManager[13689]: <debug> [1434497907.217754] [mm-port-serial.c:1294] _close_internal(): (ttyACM0) device open count is 2 (close) ModemManager[13689]: <debug> [1434497907.217776] [mm-port-serial-at.c:440] debug_log(): (ttyACM0): --> 'AT+CGDCONT=?<CR>' ModemManager[13689]: <debug> [1434497907.252516] [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR><LF>+CGDCONT: ( 1 ) , "IP" ,,, (0-2),(0-3)<CR><LF>' ModemManager[13689]: <debug> [1434497907.253963] [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR><LF>+CGDCONT: , "PPP" ,,, (0-2),(0-3)<CR><LF>' ModemManager[13689]: <debug> [1434497907.254980] [mm-port-serial-at.c:440] debug_log(): (ttyACM0): <-- '<CR><LF>OK<CR><LF>'

I added a few \\s* at the right places in the CGDCONT regexes. It works now! Ping latencies around 3 to 5 seconds :)

Thanks,
Thomas

diff -urN ModemManager-1.4.6/src/mm-iface-modem-3gpp.c ModemManager-1.4.6-x/src/mm-iface-modem-3gpp.c
--- ModemManager-1.4.6/src/mm-iface-modem-3gpp.c	2015-03-23 11:10:27.000000000 +0100
+++ ModemManager-1.4.6-x/src/mm-iface-modem-3gpp.c	2015-06-17 01:08:02.249519695 +0200
@@ -383,8 +383,8 @@
     else {
         /* If the modem is already registered and the last time it was asked
          * automatic registration, we're done */
-        if (current_operator_code &&
-            !registration_state_context->manual_registration) {
+        if (1 || (current_operator_code &&
+                     !registration_state_context->manual_registration)) {
             mm_dbg ("Already registered in network '%s',"
                     " automatic registration not launched...",
                     current_operator_code);
diff -urN ModemManager-1.4.6/src/mm-modem-helpers.c ModemManager-1.4.6-x/src/mm-modem-helpers.c
--- ModemManager-1.4.6/src/mm-modem-helpers.c	2015-02-07 20:28:58.000000000 +0100
+++ ModemManager-1.4.6-x/src/mm-modem-helpers.c	2015-06-17 00:24:38.233365251 +0200
@@ -331,6 +331,8 @@
 
 /* +CREG: <stat>,<lac>,<ci>           (GSM 07.07 CREG=2 unsolicited) */
 #define CREG3 "\\+(CREG|CGREG|CEREG):\\s*0*([0-9]),\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)"
+#define CREG11 "\\+(CREG|CGREG|CEREG):\\s*0*([0-9]),\\s*(\"[^\"\\s]*\")\\s*,\\s*(\"[^\"\\s]*\")"
+
 
 /* +CREG: <n>,<stat>,<lac>,<ci>       (GSM 07.07 solicited and some CREG=2 unsolicited) */
 #define CREG4 "\\+(CREG|CGREG|CEREG):\\s*([0-9]),\\s*([0-9])\\s*,\\s*([^,]*)\\s*,\\s*([^,\\s]*)"
@@ -350,6 +352,7 @@
 /* +CREG: <stat>,<lac>,<ci>,<AcT>,<RAC> (ETSI 27.007 v9.20 CREG=2 unsolicited with RAC) */
 #define CREG10 "\\+(CREG|CGREG):\\s*0*([0-9])\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*0*([0-9])\\s*,\\s*([^,\\s]*)"
 
+
 /* +CEREG: <stat>,<lac>,<rac>,<ci>,<AcT>     (ETSI 27.007 v8.6 CREG=2 unsolicited with RAC) */
 #define CEREG1 "\\+(CEREG):\\s*0*([0-9])\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*([^,\\s]*)\\s*,\\s*0*([0-9])"
 
@@ -386,6 +389,14 @@
     g_assert (regex);
     g_ptr_array_add (array, regex);
 
+    /* #11 */
+    if (solicited)
+        regex = g_regex_new (CREG11 "$", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
+    else
+        regex = g_regex_new ("\\r\\n" CREG11 "\\r\\n", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
+    g_assert (regex);
+    g_ptr_array_add (array, regex);
+
     /* #4 */
     if (solicited)
         regex = g_regex_new (CREG4 "$", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL);
@@ -775,7 +775,7 @@
         return NULL;
     }
 
-    r = g_regex_new ("\\+CGDCONT:\\s*\\((\\d+)-?(\\d+)?\\),\\(?\"(\\S+)\"",
+    r = g_regex_new ("\\+CGDCONT:\\s*\\(\\s*(\\d+)\\s*-?\\s*(\\d+)?\\s*\\)\\s*,\\s*\\(?\"(\\S+)\"",
                      G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW,
                      0, &inner_error);
     g_assert (r != NULL);
@@ -863,7 +863,7 @@
         return NULL;
 
     list = NULL;
-    r = g_regex_new ("\\+CGDCONT:\\s*(\\d+)\\s*,([^,\\)]*),([^,\\)]*),([^,\\)]*)",
+    r = g_regex_new ("\\+CGDCONT:\\s*(\\d+)\\s*,([^, \\)]*)\\s*,([^, \\)]*)\\s*,([^, \\)]*)",
                      G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW,
                      0, &inner_error);
     if (r) {
_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to