Commit Graph

1828 Commits

Author SHA1 Message Date
Aleksander Morgado
5316e9e4e5 simtech: handle 'MISSED_CALL' URCs
https://source.puri.sm/Librem5/ModemManager/issues/6
2019-10-16 18:04:47 +02:00
Aleksander Morgado
eb66e8ae68 simtech: setup USB audio channel when in-call
We'll use +CPCMREG=1/0 to start/stop USB audio function, and we will
also report the specific ttyUSB port to be used for audio in the Call
interface.
2019-10-16 17:50:16 +02:00
Aleksander Morgado
d61cb4a21c simtech: handle '+RXDTMF' URCs reporting DTMF tones 2019-10-15 11:14:40 +02:00
Aleksander Morgado
345922caa1 simtech: handle non-standard '+CRING' URCs
The SIM7600E ends up emitting these URCs with too many <CR>s, and the
generic +CRING handler doesn't catch them, interfering with other
actions, e.g.:

  $ sudo mmcli --call 1 --accept
  error: couldn't accept the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't accept the call: Unhandled response '+CRING: VOICE

  +CRING: VOICE''
2019-10-15 11:14:40 +02:00
Aleksander Morgado
395b22178c simtech: handle 'VOICE CALL' URCs
Just processing and parsing them for now, so that they don't interfere
with other commands:

  $ sudo mmcli --call 1 --accept
  error: couldn't accept the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: Couldn't accept the call: Unhandled response '

  VOICE CALL: BEGIN''
2019-10-15 10:30:00 +02:00
Aleksander Morgado
89c9566ede simtech: implement +CLCC URC based call list management 2019-10-14 15:32:20 +02:00
Aleksander Morgado
b99597b594 tests,helpers: minor alignment fix 2019-10-14 15:30:29 +02:00
Aleksander Morgado
d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00
Aleksander Morgado
3b18d21ba5 tests: avoid g_print() and use g_debug() instead
The debug-level logs won't be printed e.g. during 'make check', but
will be included when running the tester manually.
2019-10-14 15:30:03 +02:00
Aleksander Morgado
6cbeb96aa0 simtech: +CNSMOD value may have multiple digits
We don't expect them in the set of values we support, but they may
happen according to the spec.
2019-10-11 09:24:22 +00:00
Aleksander Morgado
e1d18afe39 simtech: add support for reporting LTE 2019-10-11 09:24:22 +00:00
Aleksander Morgado
61f3c3c8c4 simtech: rework access tech value mapping 2019-10-11 09:24:22 +00:00
Aleksander Morgado
7fcefc7af0 simtech: rework enabling/disabling unsolicited events
We will explicitly query for +AUTOCSQ and +CNSMOD support before
trying to enable them.

If +AUTOCSQ is supported and correctly enabled, we'll request signal
quality polling to be disabled.

If +CNSMOD is supported and correctly enabled, we'll request access
technology polling to be disabled.
2019-10-11 09:24:22 +00:00
Aleksander Morgado
c820e02ff8 simtech: enable +CSQ URC support
The +AUTOCSQ setup enables automatic signal quality reporting via +CSQ
URCs, which unfortunately have the same format as the +CSQ command
responses.

Therefore, we need to subclass load_signal_quality() explicitly in
order to ignore those cases where the response to the +CSQ command is
received empty (already processed as a URC).
2019-10-11 09:24:22 +00:00
Aleksander Morgado
1f6f9eec4d simtech: keep access tech URC regex in private struct 2019-10-11 09:24:22 +00:00
Aleksander Morgado
c98a1a9dc8 simtech: disable CMER/CIND support explicitly
The logic to setup the generic +CIND indications in the SIM7600E seems
to end up breaking connectivity when in TTY+PPP mode. If we issue the
AT+CMER=3,0,0,1 command, this will end up in the modem not replying a
correct CONNECT response to the ATD command.

Let's disable these +CIND indications completely in the simtech
plugin, as there is even no AT command reference saying those are
supported.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/144
2019-10-11 09:24:22 +00:00
Aleksander Morgado
81795f3023 simtech: implement GPS support with AT+CGPS
The new logic is available in a new 'MMSharedSimtech' interface which
is implemented both by the generic AT-based MMBroadbandModemSimtech
modem, and by a new QMI-based new MMBroadbandModemQmiSimtech.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/112
2019-10-11 09:24:22 +00:00
Aleksander Morgado
583d53a7df simtech: port type hints for the SIM7000/SIM7600 family
E.g. the SIM7600E shows up as:

  P:  Vendor=1e0e ProdID=9001 Rev=03.18
  S:  Manufacturer=SimTech, Incorporated
  S:  Product=SimTech, Incorporated
  S:  SerialNumber=0123456789ABCDEF
  C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
  I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
2019-10-11 09:24:22 +00:00
Aleksander Morgado
eeb1f73906 simtech: remove unused ID_MM_SIMTECH_TAGGED tag
The plugin already has a VID filter for 0x1e0e, this tag is useless.
2019-10-11 09:24:22 +00:00
Aleksander Morgado
def5c76cf9 huawei,bearer: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
dcf50efdd5 ublox: fix calling setup_unsolicited_events_finish() 2019-09-23 18:14:23 +02:00
Aleksander Morgado
a1148f878b cinterion: fix calling setup_unsolicited_events_finish() 2019-09-23 18:14:20 +02:00
Aleksander Morgado
be4fa661c1 plugins,telit: refactor #BND command support
And added support for several new things, including:
 * Setting "any" band now attempts to set all supported bands.
 * Added new 2G band value '5' (egsm+dcs+pcs+g850).
 * Setup support for two different 3G band combinations, a default one
   plus an alternate one applicable to the LM940/960 models only. The
   alternate combination is selected via udev tags.

During the refactor, the following Telit-specific helpers were also
removed and exchanged with more generic counterparts.
 * mm_telit_bands_contains() -> mm_common_bands_garray_lookup()
 * mm_telit_get_band_flags_from_string() -> mm_parse_uint_list()
2019-09-17 10:52:42 +02:00
Aleksander Morgado
abede5b9e3 simtech: increase +CNSMOD command timeout
From 5s to 20s, as it seems it could take much more to complete and
get a response, as seen in the logs below.

    <debug> [1568553228.546862] (ttyUSB3): --> 'AT+CNSMOD=1<CR>'
    <debug> [1568553233.799470] (ttyUSB3): --> 'AT+AUTOCSQ=1,1<CR>'
    <debug> [1568553238.798866] (ttyUSB3) setting up 3GPP unsolicited registration messages handlers
    <debug> [1568553238.798932] (ttyUSB2) setting up 3GPP unsolicited registration messages handlers
    <debug> [1568553238.798990] (ttyUSB3) device open count is 1 (close)
    <warn>  [1568553238.799029] (tty/ttyUSB3) at port timed out 2 consecutive times
    <debug> [1568553238.799094] (ttyUSB3) device open count is 2 (open)
    <debug> [1568553238.799148] (ttyUSB3): --> 'AT+CREG=2<CR>'
    <warn>  [1568553241.798727] (tty/ttyUSB3) at port timed out 3 consecutive times
    <debug> [1568553241.798799] (ttyUSB3): --> 'AT+CREG=1<CR>'
    <debug> [1568553244.795389] Enabling unsolicited registration events in primary port failed: 'AT sequence failed'
    <debug> [1568553244.795462] (ttyUSB2) device open count is 2 (open)
    <debug> [1568553244.795507] (ttyUSB3) device open count is 1 (close)
    <warn>  [1568553244.795545] (tty/ttyUSB3) at port timed out 4 consecutive times
    <debug> [1568553244.795588] (ttyUSB2): --> 'AT+CREG=2<CR>'
    <debug> [1568553244.800815] (ttyUSB3): <-- '<CR><LF>OK<CR><LF><CR><LF>OK<CR><LF>'
    <debug> [1568553244.801624] (ttyUSB3): <-- '<CR><LF>OK<CR><LF><CR><LF>OK<CR><LF>'
    <debug> [1568553244.808710] (ttyUSB2): <-- '<CR><LF>OK<CR><LF>'
2019-09-15 16:22:55 +02:00
Aleksander Morgado
2ecb96b6ad telit: add LE922 port type hints
P:  Vendor=1bc7 ProdID=1040 Rev=03.10
  S:  Manufacturer=Android
  S:  Product=Android
  S:  SerialNumber=2d9e48a4
  C:  #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=500mA
  I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
  I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
  I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
2019-09-13 17:30:39 +02:00
Aleksander Morgado
7b3df735cd tplink: new plugin
Includes port type hints for the TP-Link MA260.

  P:  Vendor=2357 ProdID=9000 Rev=00.00
  S:  Manufacturer=TP-LINK, Incorporated
  S:  Product=TP-LINK HSPA+ Modem
  S:  SerialNumber=863745010845895
  C:  #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
  I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
  I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
2019-09-11 13:56:57 +00:00
Aleksander Morgado
1334f689e2 dlink: new plugin
Includes port type hints for the D-Link DWM-222.

  P:  Vendor=2001 ProdID=7e35 Rev=02.28
  S:  Manufacturer=Mobile Connect
  S:  Product=Mobile Connect
  S:  SerialNumber=0123456789ABCDEF
  C:  #Ifs= 6 Cfg#= 1 Atr=80 MxPwr=500mA
  I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
  I:  If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
  I:  If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
  I:  If#=0x5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
2019-09-11 13:56:57 +00:00
Aleksander Morgado
87224e083c tests,helpers: minor indentation fix 2019-09-10 12:24:38 +02:00
Aleksander Morgado
141e69bc00 plugins,tests: setup new helper utilities for tests
For now, including a handy method from the ublox tests that allows
comparing arrays of bands that may not be sorted.
2019-09-09 12:24:43 +02:00
Aleksander Morgado
edac8c37e8 telit: add port type hints for the ME910 using the correct PID 2019-09-09 12:21:11 +02:00
Aleksander Morgado
e6932c9336 Revert "telit: additional port type hints for the ME910"
This reverts commit ef89dd154b.

The PID of the ME910 is 1101, not 1011... :D
2019-09-09 12:21:11 +02:00
Aleksander Morgado
b954f4760a quectel: allow tty-only devices 2019-08-29 17:36:06 +00:00
Aleksander Morgado
b0ec3030a3 sierra: add port type hints for the MC74xx modules
As suggested by Paul Bartell <paul.bartell@gmail.com>
2019-08-26 09:07:38 +02:00
Ben Chan
ee63bf4033 cinterion: fix memory leak in common_test_ctzu_urc() 2019-08-02 20:03:38 -07:00
Sven Schwermer
c61bd846f3 quectel: Add port type hints for the Quectel EG91
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
2019-08-01 16:23:36 +02:00
Ben Chan
bf54159e93 test: untabify 2019-07-31 22:27:45 -07:00
Aleksander Morgado
ef89dd154b telit: additional port type hints for the ME910 2019-07-13 23:21:55 +02:00
Aleksander Morgado
8c8e0e8805 voice,call,cinterion: add Purism as copyright holder
The GSM supplementary services related changes, as well as the rework
done to manage calls per call id, is copyrighted by Purism SPC.
2019-07-12 11:31:04 +02:00
Aleksander Morgado
d833b8644c cinterion: setup/cleanup time unsolicited events
We will parse +CTZU URCs, which end up getting in the way of other
commands if we don't process them.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/135
2019-07-11 23:21:00 +02:00
Aleksander Morgado
fe11a3fa1f cinterion: new +CTZU URC parser 2019-07-11 23:21:00 +02:00
Aleksander Morgado
63ccd36361 huawei: cleanup/setup voice unsolicited events 2019-07-11 23:21:00 +02:00
Aleksander Morgado
24c0c7aa6b huawei: audio channel setup at modem-level
The audio channel setup is shared between all ongoing calls, so it is
a modem-level feature, not specific to a single call.
2019-07-11 23:21:00 +02:00
Aleksander Morgado
12bad162e3 huawei: voice-related URCs are not in-call
The URCs report the specific call index they apply to, so they should
be managed by the modem object and reported to the Voice interface.
2019-07-11 23:21:00 +02:00
Aleksander Morgado
fca8955721 ublox: +UCALLSTAT as device-level URC, not in-call
+UCALLSTAT is used to report the state of specific calls by index, and
therefore this is not an in-call URC.
2019-07-11 23:21:00 +02:00
Aleksander Morgado
f699308958 cinterion: disable call list polling if ^SLCC is supported
Early detect that ^SLCC is supported, and disable the call list
polling in the interface if so.
2019-07-11 23:01:29 +02:00
Aleksander Morgado
faaaf20276 cinterion: when ^SLCC is supported, detailed call state updates are implicit 2019-07-11 23:01:08 +02:00
Aleksander Morgado
47dd9fffac cinterion: support ^SLCC URCs as part of voice management
This command will give us URCs whenever the extended list of current
calls changes, which includes information about the actual state of
each call, even for calls in waiting state.

Therefore, as this is a URC that applies to all calls, it's enabled
and disabled as part of the modem voice interface, instead of doing it
as part of the call object itself (i.e. not treated as an in-call URC).
2019-07-11 23:01:08 +02:00
Aleksander Morgado
e931c0ae9c cinterion: implement reset 2019-07-11 23:00:50 +02:00
Aleksander Morgado
0f8580f36e cinterion: port type hints for the PLS8
The first two ports are AT control ports (application/modem). We rely
on AT^SQPORT to decide which one is which.

The last two ports are unknown and we explicitly ignore them to make
port probing much quicker.
2019-07-11 23:00:50 +02:00
Aleksander Morgado
ed7be29111 broadband-modem,voice: disable unsolicited events 2019-07-11 23:00:50 +02:00