Commit Graph

1711 Commits

Author SHA1 Message Date
Aleksander Morgado
c9a56605ca huawei,call: check for ^CVOICE support and enable audio streaming
USB sticks only support voice if ^CVOICE returns 0.  And to enable audio
streaming on the "Application" port (whatever is returned by AT^DDSETEX=?)
we need to send AT^DDSETEX=<port> after starting the call.  After that
the serial port will send and accept signed 16-bit 8000hz PCM audio, or
whatever format is returned by ^CVOICE?.

This patch is a rework of the original implementation by:
Dan Williams <dcbw@redhat.com>
2018-10-16 17:09:21 +00:00
Aleksander Morgado
16162a5033 ublox: implement detailed call state transitions with +UCALLSTAT
Among other things, we now support:
  * Dialing to Ringing Out transition.
  * Ringing Out to Active transition.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
887376fe44 mm-iface-mode: provide direction and number when creating calls
Calls created from property bundles are always outgoing, while calls
created as input events from URCs during runtime are always incoming.

This change makes it mandatory to provide at least direction of the
call when the object is created, leaving the number as an optional
property that may or may not be known in advance (e.g. it would be
optional only for incoming calls).
2018-10-16 17:09:21 +00:00
Aleksander Morgado
fc0feee654 huawei,call: handle in-call URCs in the call object itself
Instead of handling the URCs in the modem object and using the
MMIfaceModem as a bridge to report the status read from the URC to a
call obtained from the MMCallList... just handle the URCs in the call
object itself.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
f71e120fb7 huawei: ignore voice origination info URCs
These are not used for anything, so just simplify code.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
ae917d03fd huawei: if URCs fully ignored always, don't treat them as voice-specific 2018-10-16 17:09:21 +00:00
Aleksander Morgado
65ae18118e huawei,call: remove custom start() method
Totally equivalent to the default one in the MMBaseCall object.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
0478e88b4f base-call: listen for connection error URCs in-call
In order to detect state changes while we're in-call, we have to
monitor the standard connection errors we're used to, but have them
processed as URCs instead of as responses to ATD requests.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
0090124ec0 base-call: ACTIVE after start() if detailed transitions unavailable
The most detailed call state transition flow for a new outgoing call
would be:

  UNKNOWN -> DIALING -> RINGING -> ACTIVE

But, if the modem doesn't support reporting intermediate states
(e.g. DIALING or RINGING) then a successful start() should imply
getting into ACTIVE state right away.

For now, only the Huawei plugin implements the detailed transition
support, so make them configurable via call object properties.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
fa67a4f9bb sierra-legacy: implement connection status monitoring with !SCACT?
Devices like the Netgear AC313U require explicit context monitoring,
otherwise the device may end up disconnected internally and MM would
still think that the connection is ongoing.
2018-10-09 14:34:59 +00:00
Aleksander Morgado
77387cf604 xmm: increase AT command timeout when updating bands/modes
Looks like sometimes it may take a bit more than 3s.
2018-09-13 15:17:54 +02:00
Aleksander Morgado
2f14012399 xmm: minor alignment fixes 2018-09-13 09:30:02 +02:00
Aleksander Morgado
823aa46a14 xmm: ensure outputs in load_values_finish() are always set if success 2018-09-13 09:26:19 +02:00
Paul Bartell
6b30f552a9 xmm: implement signal interface with +XCESQ polling 2018-09-13 07:17:51 +00:00
Paul Bartell
73045e931b xmm: add +XCESQ parser 2018-09-13 07:17:51 +00:00
Aleksander Morgado
6e5ea39cba dell: implement Unmanaged GPS support for the DW5821e
The DW5821E module is managed in MBIM mode by default, and exposes a
NMEA capable tty in USB interface #4.

Enabling/disabling the NMEA output via the TTY is done with AT
commands, so this implementation requires also a valid AT port in the
system.

Given that the AT commands used to enable/disable this feature are
based on modifying non-volatile memory through AT^NV, this
implementation is very specific to the DW5821E. If we're able to do
the same on other Dell modules in the future, we'll just rename the
new object to a more generic one.
2018-09-12 18:48:41 +00:00
Aleksander Morgado
02f9b5b085 dell: port type hints for the Dell DW5821e
Include port type hints to make probing quicker, and ignore the
secondary AT port as it may not be fully functional.
2018-09-12 18:48:41 +00:00
Aleksander Morgado
eb01914bd0 ublox: implement custom ICCID loading
Use AT+CCID to query the SIM ICCID, and fallback to parent's +CRSM
based method otherwise.
2018-09-12 17:17:36 +00:00
Aleksander Morgado
a19be8952f cinterion: report selected RTS/CTS flow control to modem 2018-09-12 17:15:46 +00:00
Aleksander Morgado
5f3c415722 iridium: report selected RTS/CTS flow control to modem 2018-09-12 17:15:46 +00:00
Ben Chan
7c5cfa13a1 xmm: include string.h for strlen()
This patch fixes the following compiler warning:

xmm/mm-modem-helpers-xmm.c:388:38: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
    g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &inner_error);
                                     ^
2018-08-21 23:11:29 +02:00
Aleksander Morgado
59e79c996b cinterion: new 'MMSharedCinterion' interface
Implement a new interface to keep the code shared between the QMI and
non-QMI modem implementations.

While doing that, also fix the parent interface pointer handling, so
that it isn't a static pointer applicable to all modems, and make it a
per-modem specific pointer. Without this fix, ModemManager would crash
if e.g. running with both a QMI and non-QMI Cinterion modem at the
same time.

The new shared Cinterion logic will be in charge of managing all GPS
sources not already managed by the parent interface. E.g. if the
parent implementation already supports QMI-based GPS location (using
the LOC service for example) prefer that to the custom AT-based
logic.
2018-08-21 17:06:55 +00:00
Aleksander Morgado
6e9bf39ecf xmm: implement power management operations 2018-08-21 17:02:39 +00:00
Aleksander Morgado
36e09ef441 fibocom: include udev rules tests 2018-08-21 17:02:39 +00:00
Aleksander Morgado
475e182819 fibocom: support XMM-based devices 2018-08-21 17:02:39 +00:00
Aleksander Morgado
f2c508f8b9 xmm: new 'MMBroadbandModemMbimXmm' modem object 2018-08-21 17:02:39 +00:00
Aleksander Morgado
656102633c xmm: new 'MMBroadbandModemXmm' modem object 2018-08-21 17:02:39 +00:00
Aleksander Morgado
917b23bbc7 xmm: new 'MMSharedXmm' modem interface
With support for managing bands and modes.
2018-08-21 17:02:39 +00:00
Aleksander Morgado
6262e844f5 xmm: new helper to get 'any' allowed mode combination 2018-08-21 17:02:39 +00:00
Aleksander Morgado
d6b1c321ef xmm: new common XACT=X builder for Intel XMM based devices 2018-08-21 17:02:39 +00:00
Aleksander Morgado
023ba97d9c xmm: new common XACT? parser for Intel XMM based devices 2018-08-21 17:02:39 +00:00
Aleksander Morgado
142f1d0360 xmm: new common XACT=? parser for Intel XMM based devices 2018-08-21 17:02:39 +00:00
Aleksander Morgado
1b002a3584 fibocom: ignore intel trace port in the L850-GL 2018-08-21 17:02:39 +00:00
Aleksander Morgado
af8adcc756 fibocom: new plugin with support for MBIM devices 2018-08-21 17:02:39 +00:00
Aleksander Morgado
3bc9a2dbe2 broadband-modem,ussd: explain encoding/decoding logic 2018-08-21 16:50:15 +00:00
Aleksander Morgado
548b7f8847 base-modem: load AT port type hints when adding port
We keep the pflags input in mm_base_modem_grab_port() so that plugins
can use other methods to gather port type hints (e.g. querying with AT
commands as in Huawei/Telit or looking at sysfs properties as in HSO).

For standard udev tag port type hints, it will be the base modem
looking them up.

Note that there is no longer any need to ignore non-flagged ports for
those modems that require primary/secondary flags. They will be
implicitly ignored when mm_base_modem_organize_ports() decides which
ports to use, as the flagged ones are preferred over the non-flagged
ones.
2018-08-10 04:19:13 +00:00
Aleksander Morgado
6b0424cfac plugins: consolidate ID_MM_PORT_TYPE_AT_* flag names
We define 3 common udev tag ids to be used by all plugins:

 * ID_MM_PORT_TYPE_AT_PRIMARY: the primary modem port. It will be used
   for AT control and also as PPP if there is no other port flagged
   explicitly to do PPP.

 * ID_MM_PORT_TYPE_AT_SECONDARY: the secondary modem port. It will be
   used when/if the primary port gets connected to do PPP.

 * ID_MM_PORT_TYPE_PPP: the port to be used to do PPP only. This tag
   makes sense only when the primary port shouldn't be used for PPP,
   i.e. when there is a port dedicated to do PPP and one port
   dedicated for control.
2018-08-10 04:19:13 +00:00
Aleksander Morgado
86f840d97b port-probe: explicitly report GPS port type if port flagged
And remove all custom logic from all plugins that were doing just that.
2018-08-10 04:19:13 +00:00
Aleksander Morgado
85adbdbdd1 plugins: consolidate ID_MM_PORT_TYPE_GPS flag name
Use the same flag name across all plugins with support for
NMEA-capable TTYs.
2018-08-10 04:19:13 +00:00
Aleksander Morgado
24e31dc2b8 dell: don't ignore TTYs in QMI/MBIM modems
When we detect that the modem is QMI-capable or MBIM-capable, we still
want to be able to use TTYs, for features unsupported by the main
protocols.

So, don't flag all the TTYs as non-AT non-QCDM, let them probe as
usual instead.
2018-08-08 18:38:55 +00:00
Aleksander Morgado
b8c7773a74 cinterion: fix band related unit tests
The sort_band() method used in the tester was totally wrong, it was
comparing the addresses of the variables instead of the MMModemBand
values.

Use the common mm_common_bands_garray_sort() instead, which works as
expected.
2018-07-31 00:23:25 +02:00
Reinhard Speyerer
ebe9fcd574 mm-modem-helpers-cinterion: update band table for PLS8-J
The default AT^SCFG="Radio/Band" value for Cinterion PLS8-J devices is
"16819472". Add UMTS band 19 and LTE band 19 entries based on the
information given in the PLS8 datasheet.
2018-07-30 21:22:07 +02:00
mstanger
7913fe4faf mm-modem-helpers-cinterion: update freq/band table
This info comes from PLS8-X/E/J/V/US, HC25 & PHS8 references, the
last two can be found publicly via Google search.

Swapped bit-mask locations for G850 & PCS bands as they may have
changed with FW or where accidently put in the wrong place.

Updated many 3G & 4G bit-mask fields.
2018-07-27 17:47:23 +02:00
Aleksander Morgado
d134402efc ublox: always send user/pass strings, even if no authentication requested
The TOBY-L2 allowed to skup the user/pass string fields when no
authentication was requested, but according to the AT command
reference, all the remaining u-blox modules do require these two
fields given always (e.g. just as empty strings).

As per this sequence in a TOBY-L4:

 (ttyACM2): --> 'AT+UAUTHREQ=?<CR>'
 (ttyACM2): <-- '<CR><LF>+UAUTHREQ: (1-4),(0-2),,<CR><LF><CR><LF>OK<CR><LF>'
 (ttyACM2): --> 'AT+UAUTHREQ=1,0<CR>'
 (ttyACM2): <-- '<CR><LF>+CME ERROR: 4<CR><LF>'

It should have been: AT+UAUTHREQ=1,0,"",""
2018-07-10 19:45:05 +00:00
Aleksander Morgado
c07382a486 udev: add tags also on bind action
When a new USB device is hotplugged, e.g. a USB<->RS232 converter that
exposes a single ttyUSB0, these udev events happen:

  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device)
  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 (usb/usb-interface)
  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 (usb-serial)
  add  /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
  bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 (usb-serial)
  bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 (usb/usb-interface)
  bind /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device)

Our udev rules in MM only added tags in the 'add' events, and it looks
like the only ones 'persistent' after this sequence are those of the
last event happening on the specific path.

This meant that all TTY subsystem rules (e.g. ID_MM_CANDIDATE) would
be stored for later check (e.g. if ModemManager is started after these
rules have been applied), which was ok. "udevadm info -p ..." would
show these tags correctly always.

But this also meant that the 'bind' udev event happening for the USB
device didn't get any of our device-specific tags, and so we would be
missing them (e.g. ID_MM_DEVICE_MANUAL_SCAN_ONLY) if MM is started
after the last event has happened. "udevadm info -p ..." would
not show these tags.

Modify all our rules to also run at the 'bind' events.

See, for context:
  https://github.com/systemd/systemd/issues/8221
2018-06-02 16:54:37 +02:00
Aleksander Morgado
4bc7d6862d u-blox: wait 20s before probing TOBY-L200 ports
https://bugs.freedesktop.org/show_bug.cgi?id=106623
2018-06-02 16:51:07 +02:00
Aleksander Morgado
3e469e7b80 u-blox: don't run quick AT procedure if READY_DELAY not configured
The quick AT probe procedure is only meaningful to avoid waiting the
+READY URC delay. If there is no such delay configured, we shouldn't
run the quick AT probe (as a failure in the AT probe may also
trigger a +READY URC delay).

Just read the udev tag value early and complete the task if the delay
is not configured.
2018-05-08 09:51:19 +02:00
Matthew Starr
1a56b97061 ublox: use ID_MM_UBLOX_PORT_READY_DELAY udev flag as init delay
Added reading the ID_MM_UBLOX_PORT_READY_DELAY udev flag value and using
it as an init delay when a value is set.

The 20 second delay for the TOBY-L4 +READ URC has been reimplemented
using the new ID_MM_UBLOX_PORT_READY_DELAY udev value.
2018-05-08 09:43:15 +02:00
Matthew Starr
4895577597 u-blox: ignore non-AT ttyACM interfaces
For the TOBY-R2, LISA-R2, and LARA-R2, the only valid AT ports are
ttyACM0, ttyACM1, and ttyACM2.  All other ttyACM ports cause MM to
wait 20-30 seconds probing the port on startup.

Ignoring the non-AT ttyACM ports allows MM to not wait 20-30 seconds
probing and therefore startup much faster with these modems.
2018-04-30 18:29:39 +02:00
Lubomir Rintel
b39dd2ec05 all: drop unused variables
Keeps build with GCC 8 happy.

mm-base-call.c:758:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-call.c:822:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-base-sms.c:908:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
mm-sms-list.c:331:25: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
mm-iface-modem-messaging.c:1210:21: warning: variable 'storage_ctx' set but not used [-Wunused-but-set-variable]
huawei/mm-plugin-huawei.c:183:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:161:24: warning: variable 'response' set but not used [-Wunused-but-set-variable]
ublox/mm-plugin-ublox.c:159:24: warning: variable 'ctx' set but not used [-Wunused-but-set-variable]
icera/mm-modem-helpers-icera.c:218:25: warning: variable 'first_free' set but not used [-Wunused-but-set-variable]
novatel/mm-common-novatel.c:50:18: warning: variable 'response' set but not used [-Wunused-but-set-variable]
2018-04-24 18:11:15 +02:00