comgt-ncm: add support for quectel modem EC200T-EU
authorJan-Niklas Burfeind <git@aiyionpri.me>
Wed, 7 Dec 2022 18:12:13 +0000 (19:12 +0100)
committerDavid Bauer <mail@david-bauer.net>
Thu, 8 Dec 2022 23:19:36 +0000 (00:19 +0100)
context_type is an integer mapping of pdptype:
1: IPV4
2: IPV6
3: IPV4V6

Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
(cherry picked from commit 13f82ce264ed2d02c66cb2cae8f013c8f64a979f)

package/network/utils/comgt/files/ncm.json
package/network/utils/comgt/files/ncm.sh

index b6ad71752910d1072de0252362e2040a97fd2db4..7d9a38fe36df1d7970183a2f4bb8c0a5f3d0ad6d 100644 (file)
                "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1",
                "disconnect": "AT+CGACT=0,${profile}"
        },
+       "quectel": {
+               "initialize": [
+                       "AT+CFUN=1"
+               ],
+               "configure": [
+                       "at+qicsgp=${profile},${context_type},\\\"${apn}\\\",\\\"${username}\\\",\\\"${password}\\\",0"
+               ],
+               "modes": {
+                       "lte": "AT+QCFG=\\\"nwscanmode\\\",3",
+                       "umts": "AT+QCFG=\\\"nwscanmode\\\",2",
+                       "gsm": "AT+QCFG=\\\"nwscanmode\\\",1",
+                       "auto": "AT+QCFG=\\\"nwscanmode\\\",0"
+               },
+               "connect": "AT+qnetdevctl=1,${profile},1",
+               "disconnect": "AT+qnetdevctl=0,${profile},0"
+       },
        "\"zte": {
                "initialize": [
                        "AT+CFUN=1"
index a2c913ea1d6f216be4ca010b0692eeadb23f29de..2f366974876d86267a420b17a7a916d8bbabf1b7 100644 (file)
@@ -31,6 +31,8 @@ proto_ncm_setup() {
        local device ifname  apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS
        json_get_vars device ifname apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS
 
+       local context_type
+
        [ "$metric" = "" ] && metric="0"
 
        [ -n "$profile" ] || profile=1
@@ -38,6 +40,10 @@ proto_ncm_setup() {
        pdptype=$(echo "$pdptype" | awk '{print toupper($0)}')
        [ "$pdptype" = "IP" -o "$pdptype" = "IPV6" -o "$pdptype" = "IPV4V6" ] || pdptype="IP"
 
+       [ "$pdptype" = "IPV4V6" ] && context_type=3
+       [ -z "$context_type" -a "$pdptype" = "IPV6" ] && context_type=2
+       [ -n "$context_type" ] || context_type=1
+
        [ -n "$ctl_device" ] && device=$ctl_device
 
        [ -n "$device" ] || {