modemmanager: support setting plmn 16300/head
authorMladen Milinkovic <maxrd2@smoothware.net>
Sat, 7 Aug 2021 09:28:57 +0000 (11:28 +0200)
committerMladen Milinkovic <maxrd2@smoothware.net>
Fri, 21 Jul 2023 14:39:01 +0000 (16:39 +0200)
Signed-off-by: Mladen Milinkovic <maxrd2@smoothware.net>
net/modemmanager/Makefile
net/modemmanager/README.md
net/modemmanager/files/modemmanager.proto

index 3c021b44dd0b2409c6fe87da6617ac9bb6f5b2c3..aa141ad736d588f680f3dc2f0e3cd6c46fdfcebe 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=modemmanager
 PKG_SOURCE_VERSION:=1.20.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
index c9d880ea4eb73a593d0144109651a32a0cfd7d13..e79b100c92e24be1d65ceed3989ec2ac61c75c0d 100644 (file)
@@ -22,6 +22,7 @@ Once installed, you can configure the 2G/3G/4G modem connections directly in
         option password    'vodafone'
         option pincode     '7423'
         option iptype      'ipv4'
+        option plmn        '214001'
         option lowpower    '1'
         option signalrate  '30'
 
@@ -36,5 +37,7 @@ allowing all protocols.
 The 'iptype' option supports any of these values: 'ipv4', 'ipv6' or 'ipv4v6'.
 It will default to 'ipv4' if not given.
 
+The 'plmn' option allows to set the network operator MCCMNC.
+
 The 'signalrate' option set's the signal refresh rate (in seconds) for the device.
 You can call signal info with command: mmcli -m 0 --signal-get
index 2a61f5178871eab56fe057af885491c32551a4d1..239148798030dbc1c1e4eec2754bc559720aff8f 100755 (executable)
@@ -343,6 +343,7 @@ proto_modemmanager_init_config() {
        proto_config_add_string  password
        proto_config_add_string  pincode
        proto_config_add_string  iptype
+       proto_config_add_string  plmn
        proto_config_add_int     signalrate
        proto_config_add_boolean lowpower
        proto_config_add_defaults
@@ -355,11 +356,11 @@ proto_modemmanager_setup() {
        local bearermethod_ipv4 bearermethod_ipv6 auth cliauth
        local operatorname operatorid registration accesstech signalquality
 
-       local device apn allowedauth username password pincode iptype metric signalrate
+       local device apn allowedauth username password pincode iptype plmn metric signalrate
 
        local address prefix gateway mtu dns1 dns2
 
-       json_get_vars device apn allowedauth username password pincode iptype metric signalrate
+       json_get_vars device apn allowedauth username password pincode iptype plmn metric signalrate
 
        # validate sysfs path given in config
        [ -n "${device}" ] || {
@@ -392,7 +393,7 @@ proto_modemmanager_setup() {
        echo "starting connection with apn '${apn}'..."
        proto_notify_error "${interface}" MM_CONNECT_IN_PROGRESS
 
-       connectargs="apn=${apn}${iptype:+,ip-type=${iptype}}${cliauth:+,allowed-auth=${cliauth}}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}"
+       connectargs="apn=${apn}${iptype:+,ip-type=${iptype}}${plmn:+,operator-id=${plmn}}${cliauth:+,allowed-auth=${cliauth}}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}"
        mmcli --modem="${device}" --timeout 120 --simple-connect="${connectargs}" || {
                proto_notify_error "${interface}" MM_CONNECT_FAILED
                proto_block_restart "${interface}"