Commit Graph

7297 Commits

Author SHA1 Message Date
Aleksander Morgado
f30d3d46b9 ci: ignore errors on apt update
Just to avoid e.g. invalid signature errors. The important command is
the actual install of required packages.
2019-10-16 18:33:50 +02:00
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
e3a1364ddc core: allow flagging ports as 'audio'
Instead of flagging them as 'ignored' so that they aren't probed, we
can also flag them as 'audio' now, so that the logic knows which port
to report as used for audio in the Call object.
2019-10-15 13:19:10 +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
1a17996ccb iface-modem-voice: ignore unknown calls reported as terminated
If the full list reporting includes calls in terminated state (e.g. on
modems managed by the Simtech plugin), then ignore those no longer
known to us, because it just means that they have already been
processed.

    <debug> [1571060859.227759] (ttyUSB2): <-- '<CR><LF>+CLCC: 1,0,6,0,0,"639335936",129<CR><LF>'
    <debug> [1571060859.227890] Reported 1 ongoing calls
    <debug> [1571060859.227913] call at index 1: direction outgoing, state terminated, number 639335936
    <debug> [1571060859.227946] call info matched (matched direction/state no, matched index yes, matched terminated no) with call at '/org/freedesktop/ModemManager1/Call/1'
    <debug> [1571060859.227963]   state updated: terminated
    <info>  [1571060859.227978] Call state changed: dialing -> terminated (unknown)
    <debug> [1571060859.228173] (ttyUSB3): <-- '<CR><LF>+CLCC: 1,0,6,0,0,"639335936",129<CR><LF>'
    <debug> [1571060859.228234] Reported 1 ongoing calls
    <debug> [1571060859.228251] call at index 1: direction outgoing, state terminated, number 639335936
    <warn>  [1571060859.228274] unexpected outgoing call to number '639335936' report2ed in call list: state terminated
2019-10-14 15:54:56 +02:00
Aleksander Morgado
089faef88c modem-helpers: support reporting 'terminated' call state in +CLCC 2019-10-14 15:45:18 +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
03223fe786 tests,sms: print PDUs only on verbose test mode
Therefore, avoid needing TEST_SMS_PART_ENABLE_TRACE build symbol.
2019-10-14 15:30:03 +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
cc4e7f6cfd shared-qmi: fix NAS SSP support check during supported caps loading 2019-10-14 12:44:47 +02:00
Aleksander Morgado
c8d715e5f0 api: set enum values not part of the API as private
So that we can avoid gtk-doc complaining about them:

  2019-10-14 10:46:59,583:common.py:ParseEnumDeclaration:427:WARNING:Cannot parse enumeration member:
  ../../../include/ModemManager-enums.h:924: warning: Value description for MMModemLocationSource::MM_MODEM_LOCATION_SOURCE_FIRST is missing in source code comment block.
  ../../../include/ModemManager-enums.h:924: warning: Value description for MMModemLocationSource::MM_MODEM_LOCATION_SOURCE_LAST is missing in source code comment block.
2019-10-14 11:05:50 +02:00
Eric Caruso
33140e1fc3 mm-broadband-modem-mbim: fix incorrect log message
The log message would display a value based on combining the
notification flags with a CID, which doesn't make sense. Test
against the flag for this notification instead.
2019-10-12 04:23:26 +00: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
1277ebb4cc iface-modem: allow plugins to disable access technology polling
Same as with the signal quality polling, we may want to disable
explicitly the access technology polling if we can rely on plugin
specific URCs for this purpose.
2019-10-11 09:24:22 +00:00
Aleksander Morgado
45a238bca3 iface-modem: allow disabling signal quality polling during runtime
E.g. if we have a specific command to enable the signal quality URCs,
we should only disable polling if the command is supported by the
specific modem and the command succeeds. If unsupported or fails, we
shouldn't disable the polling.
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
765f26a40e iface-modem: don't log error if it's in progress
If we're loading signal quality or access technology, skip reporting
any error message if the specific error received is 'in-progress'.

Plugins will use this error when they cannot process the response to
the operation, e.g. if it was already consumed by a URC handler.
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
feb6c8264a broadband-modem: allow disabling +CIND URC setup
Not all modems support correctly +CIND URCs and +CMER settings.
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
55c3f7d3f6 systemd: always start MM after polkit service if enabling policy
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/113
2019-10-11 08:40:37 +00:00
Aleksander Morgado
803c770551 broadband-modem-qmi: fix when >1 PRI images for the same modem image 2019-10-11 08:16:04 +00:00
Aleksander Morgado
227c290778 mmcli,firmware: don't use tabs when printing human-friendly list 2019-10-11 08:16:04 +00:00
Aleksander Morgado
6977b41adb broadband-modem-qmi: prefer ASCII unique IDs
If the manufacturer uses QMI unique IDs in ASCII, use the same format
in our APIs, instead of blindly converting them to a 16-byte HEX
string.

This makes user operations much nicer, e.g. instead of:

    $ sudo mmcli -m 0 --firmware-list
      ----------------
      Firmware | list: 02.20.03.00_GENERIC
               |        current: yes
               |        gobi pri unique id: 3030322E3031375F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.14.03.02_SPRINT
               |        current: no
               |        gobi pri unique id: 3030322E3031325F3030310000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.20.03.22_VERIZON
               |        current: no
               |        gobi pri unique id: 3030322E3032365F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000
               |       02.14.03.00_VODAFONE
               |        current: no
               |        gobi pri unique id: 3030302E3030385F3030300000000000
               |        gobi modem unique id: 3F5F3F00000000000000000000000000

We will have:

    $ sudo mmcli -m 1 --firmware-list
      ----------------
      Firmware | list: 02.20.03.00_GENERIC
               |        current: no
               |        gobi pri unique id: 002.017_000
               |        gobi modem unique id: ?_?
               |       02.14.03.02_SPRINT
               |        current: no
               |        gobi pri unique id: 002.012_001
               |        gobi modem unique id: ?_?
               |       02.20.03.22_VERIZON
               |        current: yes
               |        gobi pri unique id: 002.026_000
               |        gobi modem unique id: ?_?
               |       02.14.03.00_VODAFONE
               |        current: no
               |        gobi pri unique id: 000.008_000
               |        gobi modem unique id: ?_?
2019-10-11 08:16:04 +00:00
Aleksander Morgado
a55543d11e broadband-modem-qmi: fix listing images when 'Get Stored Image Info' is unsupported 2019-10-11 08:16:04 +00:00
Aleksander Morgado
1b29f7524c broadband-modem-qmi: move pri/modem pair list building to separate method 2019-10-11 08:16:04 +00:00
Aleksander Morgado
7986b2737d broadband-modem-qmi: move pri/modem list index lookup to separate method 2019-10-11 08:16:04 +00:00
Aleksander Morgado
5b8da2e1b9 broadband-modem-qmi: add note about index_of_running_image known issue
Since 02.20.xx.xx, the 'index_of_running_image' reported for MODEM
images is wrong.

https://forum.sierrawireless.com/t/mc74xx-wrong-running-image-in-qmi-get-stored-images/8998
2019-10-11 08:16:04 +00:00
Aleksander Morgado
66192288f9 broadband-modem-qmi: fix minor typo in comment 2019-10-11 08:16:04 +00:00
Aleksander Morgado
3f15293a0b daemon: register G_IO_ERROR_CANCELLED as "Cancelled" in DBus
We have deprecated the use of MM_CORE_ERROR_CANCELLED inside the
daemon in favor of using G_IO_ERROR_CANCELLED right away, and so, we
will now register G_IO_ERROR_CANCELLED as the error mapped to the
"Cancelled" error in the ModemManager error domain in DBus.

We therefore avoid sending unknown/unmapped errors via DBus, as in
this case:

    $ sudo ./test.sh
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Cancelled: Connection attempt cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Cancelled: Connection attempt cancelled'
    successfully disconnected all bearers in the modem
    error: couldn't connect the modem: 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code19: Operation was cancelled'
    successfully disconnected all bearers in the modem
2019-10-11 07:27:59 +00:00
Aleksander Morgado
cf0d3f36fd iface-modem: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
651bfd62b4 port-serial: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
fa453a17a5 iface-modem-voice: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
cff3be23c0 broadband-modem: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
7974933de8 broadband-modem-mbim: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
c0e1bde03e base-modem-at: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
def5c76cf9 huawei,bearer: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
6de9c8cb29 base-bearer: avoid using MM_CORE_ERROR_CANCELLED 2019-10-11 07:27:59 +00:00
Aleksander Morgado
15b8156061 iface-modem-simple: fix Simple.Disconnect() when bearer path given
The Simple.Disconnect() method handler was totally broken when a
specific bearer path was given, because the user-provided bearer path
was never being stored in the DisconnectionContext struct...

This is an extremely bad error, but it also gives us an indication
that no one is really using this method to disconnect one single
bearer, mainly because we also have the Bearer.Disconnect() method,
which makes more sense. mmcli didn't even allow passing a bearer path
to --simple-disconnect.
2019-10-09 12:23:33 +02:00