Commit Graph

7297 Commits

Author SHA1 Message Date
Ben Chan
9c03ce033c base-call: remove unused 'self' variables 2018-10-20 13:56:13 +02:00
Ben Chan
436f9ef7e6 core: use g_clear_pointer() to avoid explicitly checking and resetting pointers 2018-10-18 13:17:36 +02:00
Ben Chan
7de6b6f2e1 core: remove unnecessary NULL checks for g_match_info_free()
g_match_info_free() already check if the given pointer is NULL and does
nothing on a NULL pointer.
2018-10-18 13:17:36 +02:00
Ben Chan
749b806c30 core: remove unnecessary NULL checks for g_free()
g_free() already check if the given pointer is NULL and does nothing on
a NULL pointer.
2018-10-18 13:17:36 +02:00
Aleksander Morgado
4156fd2718 xmm: implement A-GPS support 2018-10-17 11:18:36 +02:00
Aleksander Morgado
fe05383fe5 libmm-glib,gps-raw: prefer $GNGGA over $GPGGA
The $GNGGA traces provide "combined" values when multiple satellite
constellations are used (e.g. GPS+GLONASS). Prefer these values over
the GPS-only $GPGGA traces if both are received.
2018-10-17 11:17:17 +02:00
Aleksander Morgado
2ffd0adf05 xmm: implement XLCSLSR based GPS management and report 2018-10-17 11:17:11 +02:00
Ben Chan
04ca18c01f modem-helpers-qmi: include string.h for memset()
This patch fixes the following compiler warning:

mm-modem-helpers-qmi.c:568:5: error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned int)' [-Werror,-Wimplicit-function-declaration]
    memset (extended_qmi_lte_bands, 0, extended_qmi_lte_bands_size * sizeof (guint64));
    ^
2018-10-17 11:05:46 +02:00
Ben Chan
b134272532 sim-qmi: avoid unnecessary MM_SIM_QMI() call on MMSimQmi object 2018-10-16 12:07:43 -07:00
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
Dan Williams
e5f65d1b27 port-serial: don't allow opens when a port is connected 2018-10-16 17:09:21 +00:00
Aleksander Morgado
329caff84f base-call: implement generic audio channel setup/cleanup handlers
Modems that require specific commands to setup or cleanup the audio
channel as soon as a call is ongoing can subclass these two new
methods.

The setup() method is considered part of the call start/accept
process, and so if it fails, the whole operation will fail.

The failures in the cleanup() method will be reported in the log, but
otherwise ignored, as this operation may be executed without any
user intervention (e.g. if the remote party hangs up).
2018-10-16 17:09:21 +00:00
Aleksander Morgado
17c511ec69 api,call: new state reason to report audio setup failures 2018-10-16 17:09:21 +00:00
Dan Williams
627303a748 api/libmm-glib/cli: add AudioPort and AudioFormat properties to the Call object 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
89218a0874 iface-modem-voice: remove unused declaration 2018-10-16 17:09:21 +00:00
Aleksander Morgado
2b85d27fc0 iface-modem-voice: simplify reporting new incoming calls
Allow creating a new incoming call object also when we receive +CLIP,
so that we can have the remote caller number as soon as the object is
created.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
b2d859e370 base-call: treat 'ringing-in' as an in-call state
So that we setup in-call events as soon as we get the incoming call
ringing in. This allows us to have plugin-specific implementations
e.g. reporting call termination when the remote caller hangs up.
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
44413308b2 iface-modem-voice: always create plugin-specified call objects
The Voice interface logic must always use the create_call() object
from its own interface to create call objects, as that is the method
that plugins can subclass to provide plugin-specific call objects.

This applies to both incoming and outgoing 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
638c5b49f1 base-call: improve logging 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
bd3b5aca01 base-call: automatically terminate unanswered incoming calls
Try to automatically detect when the caller finishes the attempt to
establish the call.
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
7c10db26c2 base-call: setup/cleanup custom events when transitioning to/from in-call 2018-10-16 17:09:21 +00:00
Aleksander Morgado
cfdd6ffc95 base-call: don't update state twice
The mm_gdbus_call_set_() methods update the properties in the same way
as via g_object_set(), no need to do it twice.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
4409ccffcc base-call: call state updates only in the interface logic
Don't do any call state update on the generic implementation of the
commands, do it in the common interface logic exclusively.

We were doing the state updates in both places.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
9a69e5363a base-call: don't notify a state change if it didn't change 2018-10-16 17:09:21 +00:00
Aleksander Morgado
60d42de68e base-call: no need to delete call info from the device
Call information only lives in the ModemManager logic, there is no
associated date stored within the device itself. Therefore, simplify
everything by assuming there is nothing to remove.

Looks like this logic was implemented because it was originally based
on the SMS management logic, but for SMS we do have to remove
them (the stored PDU parts) from the device.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
9503af95e2 base-call: fix logic when rejecting calls
Make sure the async task is always finished, even when
mm_base_modem_at_command_finish() returns an error which is not
MM_SERIAL_ERROR_RESPONSE_TIMEOUT.
2018-10-16 17:09:21 +00:00
Aleksander Morgado
0ac15f6e22 base-call: fix logic when accepting calls
Don't return FALSE when call is successfully accepted, otherwise the
caller will get very confused:

    ModemManager[19952]: <debug> [1528968478.344338] (ttyACM2): --> 'ATA<CR>'
    ModemManager[19952]: <debug> [1528968478.361986] (ttyACM2): <-- '<CR><LF>OK<CR><LF>'

    (ModemManager:19952): GLib-GIO-CRITICAL **: 11:27:58.387: g_dbus_method_invocation_take_error: assertion 'error != NULL' failed

And also, make sure the async task is always finished, even when
mm_base_modem_at_command_finish() returns an error which is not
MM_SERIAL_ERROR_RESPONSE_TIMEOUT.
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
c7d5902c15 shared-qmi: implement support for the 'extended' LTE band list
This will allow us to configure via mmcli devices that support LTE
bands that would not fit in the standard TLVs (e.g. band 66 below)
or bands which aren't really reported in the standard TLVs (e.g. bands
46 and 48 below).

  $ sudo qmicli -d /dev/cdc-wdm0 -p --dms-get-band-capabilities
  [/dev/cdc-wdm0] Device band capabilities retrieved:
      Bands: 'wcdma-2100, wcdma-pcs-1900, wcdma-1700-us, wcdma-850-us, wcdma-800, wcdma-900, wcdma-1700-japan, wcdma-850-japan'
      LTE bands: '1, 2, 3, 4, 5, 7, 8, 12, 13, 14, 17, 18, 19, 20, 25, 38, 39, 40, 41, 42, 43'
      LTE bands (extended): '1, 2, 3, 4, 5, 7, 8, 12, 13, 14, 17, 18, 19, 20, 25, 26, 28, 29, 30, 32, 38, 39, 40, 41, 42, 43, 46, 48, 66'
2018-10-09 16:04:26 +02:00
Aleksander Morgado
c906da415c broadband-modem-mbim: plug leaks when using the ATDS service 2018-10-09 14:13:15 +02:00
Aleksander Morgado
1ac79ccdfd cli,modem: print PCO as 'n/a' if not available 2018-10-06 14:57:58 +02:00
Aleksander Morgado
24454b2775 cli,bearer: normalize n/a reporting
Use always small letters.
2018-10-06 14:52:18 +02:00
Ben Chan
f7cb84788e base-modem: remove explicit GDestroyNotify cast on g_object_unref
g_object_unref is in form of  `void (*)(gpointer)`, which matches the
GDestroyNotify signature. An explicit GDestroyNotify cast on
g_object_unref is thus not needed.
2018-10-06 14:50:04 +02:00
Thomas Haller
8bde29c9e2 libmm-glib: use helper function to convert enum/flags from string 2018-10-04 09:43:15 +02:00
Thomas Haller
d83f50794d libmm-glib, modem-helpers: unref enum/flags GType classes in enum getters 2018-10-04 09:43:05 +02:00
Ben Chan
a68bbbc1b9 port-serial: port mm_port_serial_flash to use GTask 2018-10-04 09:13:24 +02:00
Ben Chan
f3e1e699cf port-serial: port mm_port_serial_reopen to use GTask 2018-10-04 09:09:51 +02:00
Aleksander Morgado
2a1a0b88fb udev: define all generic tags as symbols
This prevents errors due to nasty typos in the strings.

We define all symbols in a single header file that is NOT considered
part of the API, as there is no need for MM clients to know about
these tags code-wise. These tags are only meaningful when associated
to devices in udev.

Information of each tag is included in the general API documentation.

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/88
2018-09-25 17:55:53 +00:00
Aleksander Morgado
a2705abb24 iface-modem-messaging: if only one storage supported, select it right away
Some plugins or implementations (e.g. notably MBIM) may report a
single storage as supported and no way to update the current default
storage. In this specific case, we will initialize the default storage
to that single one supported right away, regardless of whether
selecting others is implemented or not.
2018-09-25 17:51:38 +00:00
Aleksander Morgado
0ca95254ae libmm-glib,location-3gpp: don't ignore location updates when MNC is 0
E.g. China Mobile (MCC 460, MNC 0).

    $ mmcli -m toby --location-get

    /org/freedesktop/ModemManager1/Modem/0
      -------------------------
      3GPP location   | Mobile country code: '460'
                      | Mobile network code: '0'
                      |  Location area code: '6188'
                      |             Cell ID: '40955'
      -------------------------
      GPS NMEA traces | Not available
      -------------------------
      Raw GPS         | Not available
      -------------------------
      CDMA BS         | Not available
2018-09-25 19:21:00 +02:00
Ulrich Ölmann
4d16eec5fb mmcli,location: fix doubled variable declaration
Remove the redundant declaration of which slipped into the code in commit
091bf4dbd8 ("api: support location assistance data").

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
2018-09-21 15:15:54 +02:00
Aleksander Morgado
8ef6d397c7 cli,signal: add generic fields in its own group
This is just to consolidate the output w.r.t. similar fields in
e.g. the Messaging or Location interfaces.
2018-09-21 15:02:07 +02:00