modemmanager: added new proto options
authorValtteri Holopainen <redacted>
Thu, 13 Aug 2020 09:52:41 +0000 (12:52 +0300)
committerValtteri Holopainen <redacted>
Thu, 13 Aug 2020 09:56:31 +0000 (12:56 +0300)
Added signal refresh rate option
modemmanager: update readme.md
Added description for added proto options.

Added compile option to compile --with-at-command-via-dbus for allowing
AT commands to modem without --debug flag

 Changes to be committed:
modified:   net/modemmanager/Config.in
modified:   net/modemmanager/Makefile
modified:   net/modemmanager/files/modemmanager.init
modified:   net/modemmanager/files/modemmanager.proto
modified:   README.md

Signed-off-by: Valtteri Holopainen <redacted>
net/modemmanager/Config.in
net/modemmanager/Makefile
net/modemmanager/README.md
net/modemmanager/files/modemmanager.proto

index 28e65a319fbceca13a08d776dc580a6260423253..283a9e10a2970d791394cafa43f1d799e7f48698 100644 (file)
@@ -12,4 +12,10 @@ depends on PACKAGE_modemmanager
                default y
                help
                  Compile ModemManager with QMI support
+
+        config MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS
+                bool "Allow AT commands via DBus"
+                default n
+                help
+                  Compile ModemManager allowing AT commands without debug flag
 endmenu
index 9f1d33317170091f296e3fa6c42bf476e67923f9..1394869535130b31f32d65cc51cd1aa172b26de1 100644 (file)
@@ -59,6 +59,10 @@ CONFIGURE_ARGS += \
        --disable-rpath \
        --disable-gtk-doc
 
+ifeq ($(CONFIG_MODEMMANAGER_WITH_AT_COMMAND_VIA_DBUS),y)
+  CONFIGURE_ARGS += --with-at-command-via-dbus
+endif
+
 ifdef CONFIG_MODEMMANAGER_WITH_MBIM
   CONFIGURE_ARGS += --with-mbim
 else
index ea86568c9b4ea67387069349a8bd866c862db12c..c9d880ea4eb73a593d0144109651a32a0cfd7d13 100644 (file)
@@ -23,6 +23,7 @@ Once installed, you can configure the 2G/3G/4G modem connections directly in
         option pincode     '7423'
         option iptype      'ipv4'
         option lowpower    '1'
+        option signalrate  '30'
 
 Only 'device' and 'proto' are mandatory options, the remaining ones are all
 optional.
@@ -34,3 +35,6 @@ allowing all protocols.
 
 The 'iptype' option supports any of these values: 'ipv4', 'ipv6' or 'ipv4v6'.
 It will default to 'ipv4' if not given.
+
+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 07147b1f366fceed95b306ec9d6fb71a6ed363fa..d24910b984f1498bafc5348b51757c0152ab4eee 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_int     signalrate
        proto_config_add_boolean lowpower
        proto_config_add_defaults
 }
@@ -354,11 +355,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
+       local device apn allowedauth username password pincode iptype metric signalrate
 
        local address prefix gateway mtu dns1 dns2
 
-       json_get_vars device apn allowedauth username password pincode iptype metric
+       json_get_vars device apn allowedauth username password pincode iptype metric signalrate
 
        # validate sysfs path given in config
        [ -n "${device}" ] || {
@@ -403,6 +404,14 @@ proto_modemmanager_setup() {
                return 1
        }
 
+       # check if Signal refresh rate is set
+       if [ -n "${signalrate}" ] && [ "${signalrate}" -eq "${signalrate}" ] 2>/dev/null; then
+               echo "setting signal refresh rate to ${signalrate} seconds"
+               mmcli --modem="${device}" --signal-setup="${signalrate}"
+       else
+               echo "signal refresh rate is not set"
+       fi
+
        # log additional useful information
        modemstatus=$(mmcli --modem="${device}" --output-keyvalue)
        operatorname=$(modemmanager_get_field "${modemstatus}" "modem.3gpp.operator-name")
git clone https://git.99rst.org/PROJECT