Commit Graph

52 Commits

Author SHA1 Message Date
Aleksander Morgado
ffde429843 core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncs 2015-12-02 17:07:39 +01:00
Aleksander Morgado
09eb87f899 cinterion: allow 'unmanaged' GPS setup 2014-07-02 12:28:56 +02:00
Aleksander Morgado
15a3ebbd35 cinterion: enable GPS location reporting for the PHS8 in QMI-mode
The PHS8 in QMI-mode doesn't support GPS location retrieval via QMI, so we will
fallback to use the AT-based setup and the TTY for reading NMEA traces.
2014-07-01 15:46:57 +02:00
Aleksander Morgado
8f837b830d cinterion: enable GPS location reporting for the PHS8 in AT-mode
This enables support for GPS location reporting when the PHS8 is NOT used in QMI
mode.
2014-06-27 13:18:29 +02:00
Aleksander Morgado
9637c1ed38 cinterion: update default setting for new SMS indications
The setup in Cinterion modems goes as follows:
  AT+CNMI=<mode>[, <mt>[, <bm>[, <ds>[, <bfr>]]]]

For each field, several setups are available, so we could use a default value,
as we were doing until now (+CNMI=2,1,2,2,1).

BUT, not every Cinterion modem allows the same set of settings. For example, the
new PHS8 only allows '0' for the <ds> value:
  AT+CNMI=?
  +CNMI: (0,1,2),(0,1),(0,2),(0),(1)

So, instead of hardcoding the setup, try to find the best suitable one for each
modem. We'll parse the +CNMI=? test response to know which values are supported
during the messaging support check, which is run once during initialization.
2014-06-25 15:39:45 +02:00
Aleksander Morgado
58d2806f4c cinterion: new 'AT+CNMI=?' parser helper 2014-06-25 15:04:09 +02:00
Aleksander Morgado
7c347aa3ec port: store parent sysfs path in each MMPort 2014-06-23 18:12:27 +02:00
Ben Chan
8680e066b5 cinterion: fix memory leaks in tests 2014-06-03 10:52:01 +02:00
Aleksander Morgado
f3ded99af1 cinterion: implement unlock retries loading 2014-03-03 16:33:51 +01:00
Aleksander Morgado
191168e3ef cinterion: after SIM unlock, query SIM status until ready 2014-03-03 14:33:12 +01:00
Aleksander Morgado
17bf3f8578 cinterion: request to force refresh access tech after current bands update 2014-02-28 16:38:05 +01:00
Aleksander Morgado
019d038c17 cinterion: force band preference update to be applied immediately 2014-02-28 16:37:49 +01:00
Aleksander Morgado
f2024b78b2 cinterion: consolidate setting current bands in 2G and 3G devices 2014-02-28 16:37:32 +01:00
Aleksander Morgado
c1e2a3a5bc cinterion: consolidate current bands loading for 2G and 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
0877f68a84 cinterion: consolidate supported bands loading for 2G and 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
87d867c8ae cinterion: add helper to build Cinterion band mask 2014-02-28 16:35:18 +01:00
Aleksander Morgado
e6430acaaa cinterion: add helper to parse AT^SCFG="Radio/Band" response in 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
82067915d1 cinterion: use AT^SCFG=? to parse supported bands in 3G devices 2014-02-28 16:35:18 +01:00
Aleksander Morgado
e6cfa57c60 cinterion: request access tech update after allowed mode change 2014-02-28 16:35:18 +01:00
Aleksander Morgado
82340cd5f7 cinterion: add support for HSUPA+HSDPA reported access tech 2014-02-28 16:35:17 +01:00
Aleksander Morgado
a9a4a2a337 cinterion: allow recovering automatic mode
When automatic mode (i.e. 2G+3G+none preferred) is selected, we need to
explicitly request it by giving the AT+COPS write command with values (i.e. not
just empty fields).
2014-02-28 16:35:17 +01:00
Aleksander Morgado
177f15f295 cinterion: cache operator id if manual selection attempted
We'll need it afterwards for proper mode switching
2014-02-28 16:34:59 +01:00
Aleksander Morgado
914caf0f3b cinterion: unsupported modes are already filtered out
So no need to try to handle error cases or fallbacks to support them.
2014-02-28 16:34:59 +01:00
Aleksander Morgado
ece4f0f014 cinterion: increase AT command timeout when changing modes 2014-02-28 16:34:59 +01:00
Aleksander Morgado
f9b9f25cd1 cinterion: implement power off
Powering off Cinterion modems is done with the AT^SMSO command. Once this
command is sent to the device, ModemManager still needs to wait to get an
unsolicited ^SHUTDOWN message from the modem, which is when the shutdown
is considered complete.

Newer Cinterion devices, though, don't seem to follow this rule and just
reply OK to AT^SMSO (i.e. no ^SHUTDOWN), but instead, they will remove the
tty ports.
2014-02-20 11:15:32 +01:00
Aleksander Morgado
d4dfd661b9 port-serial-at: use GIO Async API like methods 2014-02-13 13:40:21 +01:00
Aleksander Morgado
6f235b9948 ports: rename 'MMAtSerialPort' to 'MMPortSerialAt' 2014-02-13 13:40:01 +01:00
Aleksander Morgado
c9e2b46b21 cinterion: try to gather port type for devices with multiple tty ports
The new PHS8 or PXS8 devices may expose multiple tty ports, but only one is
supposed to be used for PPP. So, query which port that is and flag it before
grabbing it in the modem.
2014-02-13 11:56:09 +01:00
Aleksander Morgado
2a611c3856 cinterion: support QMI-based Cinterion PLXX and PHXX modules
E.g. with a Cinterion PLS8 LTE modem:

  $ sudo mmcli -m 0

  /org/freedesktop/ModemManager1/Modem/0 (device id '0042872f6597b3d772a3d9d3cd6f14f152af8a0b')
    -------------------------
    Hardware |   manufacturer: 'QUALCOMM INCORPORATED'
             |          model: '0'
             |       revision: 'M9615A-CETWMAZM-2.0.19015  1  [Jan 31 2013 00:00:00]'
             |      supported: 'gsm-umts
             |                  lte
             |                  gsm-umts, lte'
             |        current: 'gsm-umts, lte'
             |   equipment id: 'unknown'
    -------------------------
    System   |         device: '/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7'
             |        drivers: 'option1, qmi_wwan'
             |         plugin: 'Cinterion'
             |   primary port: 'cdc-wdm0'
             |          ports: 'ttyUSB2 (at), cdc-wdm0 (qmi), wwp0s29u1u7i4 (net)'
    -------------------------
    Numbers  |           own : 'unknown'
    -------------------------
    Status   |           lock: 'sim-pin'
             | unlock retries: 'sim-pin (3), sim-pin2 (2), sim-puk (10), sim-puk2 (10)'
             |          state: 'locked'
             |    power state: 'on'
             |    access tech: 'unknown'
             | signal quality: '0' (cached)
    -------------------------
    Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
             |        current: 'allowed: 2g, 3g, 4g; preferred: none'
    -------------------------
    Bands    |      supported: 'cdma-bc15-aws, dcs, egsm, u2100, u1800, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, eutran-xx'
             |        current: 'cdma-bc15-aws, dcs, egsm, u2100, u1800, u900, eutran-i, eutran-iii, eutran-vii, eutran-viii, eutran-xx'
    -------------------------
    IP       |      supported: 'ipv4, ipv6, ipv4v6'
    -------------------------
    SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'
2013-09-25 17:46:31 +02:00
Aleksander Morgado
1c67d050cb api,introspection: merge 'AllowedModes' and 'SupportedMode' into 'CurrentModes'
We now have a single 'CurrentModes' property which contains both values in a
tuple with signature "(uu)".

Also, rename 'SetAllowedModes()' to 'SetCurrentModes()', and update the list of
arguments expected to have a single "(uu)" tuple.
2013-06-05 19:15:14 +02:00
Aleksander Morgado
45ceba7692 api,introspection: 'SupportedModes' is now a list of possible combinations
Instead of just a mask of MMModemMode values, we now provide a list of the
allowed and preferred mode combinations supported by the modem. E.g.:

$> sudo mmcli -m 0
  -------------------------
  Modes    |      supported: 'allowed: 2g; preferred: none
           |                  allowed: 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: none
           |                  allowed: 2g, 3g; preferred: 2g
           |                  allowed: 2g, 3g; preferred: 3g
           |                  allowed: 4g; preferred: none
           |                  allowed: 2g, 3g, 4g; preferred: none'
2013-06-05 19:15:14 +02:00
Aleksander Morgado
212d00c529 api,instrospection: rename 'Bands' to 'CurrentBands'
... and 'SetBands()' to 'SetCurrentBands()'.

We'll keep the 'Current' keyword in those properties which also have
'Supported' values.
2013-06-05 19:15:14 +02:00
Aleksander Morgado
eec5d00a97 core,plugins: remove initial power down sequence
We no longer power down the modem during initialization, so remove that
implementation.
2013-01-11 10:05:46 +01:00
Aleksander Morgado
c250fa3797 libmm-glib: remove the `libmm-common.h' header
Both the ModemManager daemon and the mmcli will now include `libmm-glib.h' only.

We also handle two new special `_LIBMM_INSIDE_MM' and `LIBMM_INSIDE_MMCLI'
symbols, which if included before the `libmm-glib.h' library allow us to:

 * Don't include the libmm-glib high level API in the ModemManager daemon, as
   the object names would clash with those in the core.

 * Define some of the methods of helper objects to be included only if compiling
   ModemManager daemon or the mmcli.
2012-10-04 10:17:12 +02:00
Aleksander Morgado
e669e4c868 cinterion: run power-down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
b42b5795e3 iface-modem-messaging: automatically detect the best default storage
Instead of letting the plugins specify a default storage to use, just look at
the supported ones and use the best one.

"MT is preferred over "ME" or "SM", as "MT=ME+SM"
2012-09-14 07:05:23 +02:00
Aleksander Morgado
bddcc2fb07 iface-modem-messaging: instead of mem1,mem2,mem3 use just a new default storage
There is no point in specifying a default 'mem1' memory storage, which is used
for reading/listing/deleting, as those are operations that need a specific
'mem1' set each time.

Also, there is no point in specifying separate default 'mem2' and 'mem3' memory
storages, specially because now we allow Sms.Store() to specify a storage.

So, we will now only have a 'default' memory storage, which is applicable for
both 'mem2' and 'mem3' (storing, sending from storage and deleting).
2012-09-14 07:05:23 +02:00
Aleksander Morgado
ab67c0b7c3 cinterion: update AT command timeout when setting bands to 15s
Seems the reply to the command is received once the change has been done, so it
may take longer than the previous default of 3s.
2012-08-28 17:34:47 +02:00
Aleksander Morgado
6b684fec5f cinterion: fix loading supported bands 2012-08-28 17:15:18 +02:00
Aleksander Morgado
0436b3e457 api,introspection: report list of drivers, not just one
Different ports of the same modem may get handled by different drivers. We
therefore need to provide a list of drivers (new `Modem.Drivers' property with
signature 'as') instead of just one (removed `Modem.Driver' property with
signature 's').

$ sudo mmcli -m 0 | grep drivers
           |        drivers: 'qcserial, qmi_wwan'
2012-08-24 13:34:51 +02:00
Aleksander Morgado
1ca46cc0ec plugins: use default port grabbing on those plugins without special requirements 2012-08-06 20:06:46 +02:00
Aleksander Morgado
e5e46f489e core: merge MMPluginBase' and MMPlugin'
There's no real point in maintaining a separate `MMPlugin' interface, as all the
plugins will inherit from `MMPluginBase', so just merge them and simplify
everything.
2012-08-06 20:06:45 +02:00
Aleksander Morgado
815693661c core: compile all ports before creating the modem object
Before this, we only exported the modem to DBus when all ports were organized,
in order to make sure that we select as primary port the one we really want and
not the first AT port grabbed. Given that to get all the ports organized we also
needed to wait to get all the ports grabbed, we can now also defer the creation
of the modem object until all the ports get grabbed. This allows us to create
different types of objects based on the ports available (e.g. we can now create
QMI-supported modem objects if we see a QMI port around).
2012-08-06 20:06:44 +02:00
Aleksander Morgado
431b6a0fc5 broadband-modem: remove `USE_WS46' property
3GPP modems will all try to use AT+WS46=? by default to gather supported modes.
2012-07-16 08:34:01 +02:00
Aleksander Morgado
c7d39e2c28 cinterion: simplify loop when loading 2G bands 2012-05-06 15:34:12 +02:00
Aleksander Morgado
dac1021e4c cinterion: no need for custom supported modes loading 2012-04-10 18:28:33 +02:00
Aleksander Morgado
cdd339f802 base-modem: implement new modem-wide cancellable, and rework AT commands
Instead of the `_in_port()' variants, we'll provide more generic
`_full()' methods. These should be used either if we want to send commands
to a specific port, or if we want to use a specific user-provided GCancellable.

In addition to this user-provided GCancellable, we keep the internal modem-wide
one.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
cc6d4a97fb base-modem: new port getters and peekers
* mm_base_modem_peek_port_* () will return either a port object (no new
reference), or NULL if none available.

You would usually peek() a port if you're going to use it just in the current
method, as there is no way to that reference to get invalid (we're single
threaded).

 * mm_base_modem_get_port_* () will return either NEW references to valid
port objects, or NULL if none available.

And, you would usually get() a port, whenever you want the port object to be
valid even out of the current method, for example when keeping it in the
context of an async operation.

Also, we need to consider that the primary AT port MAY BE NULL when you
peek() or get() it. This is due to the fact that we may be releasing ports
(due to device disconnection) in the middle of async operations.
2012-03-16 14:53:23 +01:00
Aleksander Morgado
478b9c5f36 cinterion: no need to complete in idle in sleep_ready() 2012-03-16 14:53:21 +01:00
Aleksander Morgado
1701230f51 plugin-base: remove the SORT_LAST property
Plugins that need to get sorted last by the PluginManager can now be determined
just by looking at the post probing filters.
2012-03-16 14:53:18 +01:00