[PATCH] Support allow-roaming property in openwrt protocol handler

Amol Lad Amol.Lad at 4rf.com
Thu Sep 12 06:25:08 UTC 2019


Hi,

Below patch allows user to configure roaming in /etc/config/network along with other parameters such as apn. This patch is generated from Mobile Broadband OpenWRT git (https://gitlab.freedesktop.org/mobile-broadband/mobile-broadband-openwrt). I've tested it in my EM7455 setup.

Thanks
Amol


>From 179492c83db02011cdd57f41e03ebe9dab204cdf Mon Sep 17 00:00:00 2001
From: "amol.lad" <amol.lad at 4rf.com>
Date: Thu, 12 Sep 2019 11:45:30 +0530
Subject: [PATCH] support allow-roaming property in openwrt protocol handler

---
README                                | 1 +
modemmanager/files/modemmanager.proto | 7 ++++---
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 04feff0..0883a94 100644
--- a/README
+++ b/README
@@ -42,3 +42,4 @@ Install it in the following way:
         option password 'vodafone'
         option pincode  '7423'
         option lowpower '1'
+        option roaming  '0'
diff --git a/modemmanager/files/modemmanager.proto b/modemmanager/files/modemmanager.proto
index 00a4278..71769f1 100755
--- a/modemmanager/files/modemmanager.proto
+++ b/modemmanager/files/modemmanager.proto
@@ -246,6 +246,7 @@ proto_modemmanager_init_config() {
               proto_config_add_string              pincode
               proto_config_add_string              iptype
               proto_config_add_boolean lowpower
+             proto_config_add_boolean roaming
}
 proto_modemmanager_setup() {
@@ -254,8 +255,8 @@ proto_modemmanager_setup() {
               local modempath modemstatus bearercount bearerpath connectargs bearerstatus beareriface method
               local operatorname operatorid registration accesstech signalquality
-              local device apn username password pincode iptype metric
-              json_get_vars device apn username password pincode iptype metric
+             local device apn username password pincode iptype roaming metric
+             json_get_vars device apn username password pincode iptype roaming metric
                # validate sysfs path given in config
               [ -n "${device}" ] || {
@@ -286,7 +287,7 @@ proto_modemmanager_setup() {
                # setup connect args; APN mandatory (even if it may be empty)
               echo "starting connection with apn '${apn}'..."
- connectargs="apn=${apn}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}${iptype:+,ip-type=${iptype}}"
+ connectargs="apn=${apn}${username:+,user=${username}}${password:+,password=${password}}${pincode:+,pin=${pincode}}${iptype:+,ip-type=${iptype}}${roaming:+,allow-roaming=${roaming}}"
               /usr/bin/mmcli --modem="${device}" --timeout 120 --simple-connect="${connectargs}" || {
                               proto_notify_error "${interface}" CONNECT_FAILED
                               proto_block_restart "${interface}"
--
2.17.1

________________________________
The information in this email communication (inclusive of attachments) is confidential to 4RF Limited and the intended recipient(s). If you are not the intended recipient(s), please note that any use, disclosure, distribution or copying of this information or any part thereof is strictly prohibited and that the author accepts no liability for the consequences of any action taken on the basis of the information provided. If you have received this email in error, please notify the sender immediately by return email and then delete all instances of this email from your system. 4RF Limited will not accept responsibility for any consequences associated with the use of this email (including, but not limited to, damages sustained as a result of any viruses and/or any action or lack of action taken in reliance on it).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20190912/ffa81877/attachment-0001.html>


More information about the ModemManager-devel mailing list