Commit Graph

61 Commits

Author SHA1 Message Date
Aleksander Morgado
d0c18b4277 bearer-novatel-lte: fix reference counting of the 'data' port 2013-02-20 10:09:42 +01:00
Aleksander Morgado
b6402a4e21 bearer,3gpp: dial operation specifies which data port to use
Instead of deciding in advance which data port to use, we let the dialling
operation gather it. For the generic dialling logic, ATD-based, always an
'AT' port will be used as data port, even if we grabbed a 'net' port. Those
plugins that can work with 'net' ports will grab the specific 'net' port
themselves.
2013-02-18 15:41:26 +01:00
Aleksander Morgado
15d34d56fd bearer: new helper 'MMBearerConnectResult' type
Instead of returning 3 variables in connect_finish(), return a single reference
counted struct. This simplifies how the result is built and passed within a
GSimpleAsyncResult to each _finish() method.

This also simplifies the dialling step in the 3GPP connection sequence, as we
can use the same new type.
2013-02-18 15:41:26 +01:00
Aleksander Morgado
30639606d3 broadband-modem: new step during 'enabling_started' to initialize the modem
We previously had the modem initialization command merged with some other port
setup commands in the 'modem_init' step of the 'Modem' interface. Instead of
doing this, we now split the logic into two separate steps:

A first 'enabling_modem_init' modem initialization step is to be run just after
the ports have been opened, but only during the first enabling operation, and
only if the modem was not hotplugged. A hotplugged modem is assumed to be
properly initialized already, so no need to ATZ-it. Also, we will now wait 500ms
by default after the modem initialization command has been sent, to let it
settle down.

The second 'modem_init' step will be run during the 'Modem' interface
initialization, and it currently only holds specific setup of the primary and
secondary serial ports. We'll be modifying this logic a bit in the next commits,
so no big deal to have that step name unchanged.
2013-02-18 13:47:34 +01:00
Dan Williams
90ecbe325a broadband-modem-novatel: read HDR revision for access technology
Specialize what the superclass gave us, if we can.
2013-02-06 11:57:00 -06:00
Dan Williams
8253d6f9de broadband-modem-novatel: use ERI subsystem information to better determine roaming
We use the Icon ID here because a value of 1 *always* means not roaming,
while the other values don't appear to be consistent.  For example,
an ERI value of "0" is supposed to mean roaming according to the
standards, but the Novatel devices appear to use 0 to mean home.
Since we're not sure, don't depend on the ERI value itself, just
depend on the Icon ID, where we know for sure that 1 means "home".
2013-02-06 11:57:00 -06:00
Ben Chan
86fcfe3121 novatel-lte: use +CFUN=4 for power down 2013-01-30 23:12:10 +01:00
Ben Chan
87a556dbb1 novatel-lte: retry $NWQMISTATUS check upon error during disconnect
$NWQMISTATUS sometimes returns 'ERROR'. This patch modifies the Novatel
LTE plugin to retry $NWQMISTATUS (up to 5 times) to determine if the
disconnect operation succeeds. It also changes the plugin to assume that
the disconnect operation succeeds if $NWQMISTATUS fails to report the
current connection status.
2013-01-30 23:11:59 +01:00
Ben Chan
9474654f67 novatel-lte: skip soft reset if modem is newly plugged in
Soft resetting a Novatel LTE modem can a significant amount of time
(3-4 seconds). If the modem is newly plugged in, skip the unnecessary
soft reset when enabling the modem.
2013-01-18 11:27:58 +01:00
Dan Williams
f7d55a688a broadband-modem-novatel: fix signal strength processing for older devices
mm_get_int_from_str() does not allow anything in the string after the
number, eg "-91  asdfasdf" returns an error.  So we have to chop off
anything after the number we're interested in.
2013-01-14 13:50:26 -06:00
Ben Chan
e939221975 iface-modem, novatel-lte: disable network scan in LTE mode 2013-01-04 12:10:51 +01:00
Aleksander Morgado
7da2a65b43 plugins: fix generic GObject related macros 2012-12-27 08:48:11 +01:00
Ben Chan
5a16f2aff1 novatel-lte: use $NWMDN to read own number when +CNUM fails
+CNUM may return ERROR when the modem fails to read the own numbers from
the SIM card or when the SIM card hasn't been activated. Use $NWMDN to
read the MDN as a fallback, which distinguishes these two cases.
2012-11-05 16:10:19 +01:00
Ben Chan
15f7a370d2 novatel-lte: increase the wait after SIM unlock to 3 seconds
After repeated stress tests on a few Novatel E362 modems and SIM cards,
it is revealed that a 3-second wait after SIM unlock is necessary for
reliably reading ICCID and IMSI through the SIM interface.
2012-11-02 08:19:47 +01:00
Ben Chan
10a0ed12c4 novatel-lte: retry $NWQMISTATUS upon an unknown error during connecting
The $NWQMISTATUS command sometimes replies an ERROR shortly after
calling the $NWQMICONNECT command, but then replies the proper QMI
status if we retry it. This behavior is observed on an E362 modem with
4.08 firmware.

    (ttyUSB0): --> 'AT$NWQMICONNECT=,,,,,,"",,,"",""<CR>'
    (ttyUSB0): <-- '<CR><LF>OK<CR><LF>'
    (ttyUSB0): --> 'AT$NWQMISTATUS<CR>'
    (ttyUSB0): <-- '<CR><LF>ERROR<CR><LF>'
    Got failure code 100: Unknown error
    QMI connection status failed: Unknown error
2012-10-22 10:46:57 +02:00
Ben Chan
8362171973 novatel-lte: handle $NWQMISTATUS responses for firmware 4.08
In firmware 4.08, the $NWQMISTATUS command returns different values for
QMI state to indicate the current connection state. This patch modifies
the code to handle $NWQMISTATUS responses in firmware 1.41 and 4.08.
2012-10-22 10:46:57 +02: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
a66f971a7c libmm-common: added common utils from core
Moved the utils to play with binary to hex strings into libmm-common.
2012-09-14 07:05:26 +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
Ben Chan
36c7136510 novatel-lte: implement modem reset 2012-09-11 08:47:07 +02:00
Ben Chan
1252572607 novatel-lte: set default SMS storage to 'SM'
Novatel E362 LTE modem only supports 'SM' and 'SR', but not 'ME'.
2012-09-08 10:19:01 +02:00
Aleksander Morgado
f53e53ba37 novatel: fix checking ERI for roaming/home decision
This is a port to git master of the following commit:

commit c21e29c50b5661308fb3b223c05f6942c06dc15d
Author: Dan Williams <dcbw@redhat.com>
Date:   Fri Aug 24 13:31:04 2012 -0500

    novatel: fix checking ERI for roaming/home decision

    More fallout from b22b2d99db
    which changed the return type of the qcdm_result_get_*() functions.
2012-08-31 10:04:37 +02:00
Ben Chan
b060bcfc74 novatel-lte: use 'AT+CRSM=176,28423,0,0,9' instead of 'AT+CIMI' to read IMSI
Based on empirical results, 'AT+CRSM=176,28423,0,0,9' is found more reliable
than 'AT+CIMI' for reading IMSI.
2012-08-30 09:29:39 +02:00
Ben Chan
a2aad7d293 novatel-lte: add a 2-second wait after SIM unlock 2012-08-30 09:18:00 +02:00
Aleksander Morgado
a1d6667df9 novatel: don't claim the Novatel E362, should be handled by `novatel-lte' 2012-08-26 23:01:50 +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
a595912d2d novatel: fix creation of the `MMBroadbandModemNovatel' object 2012-08-24 13:09:17 +02:00
Aleksander Morgado
5764d39689 modem-helpers: ERI parser is generic enough, not just for !SPERI 2012-08-23 18:56:22 +02:00
Aleksander Morgado
e38828c318 broadband-bearer: allow implementations to override the port used for connection 2012-08-23 18:56:22 +02:00
Aleksander Morgado
678972b63a novatel: add detailed CDMA registration state checks 2012-08-20 16:27:05 +02:00
Aleksander Morgado
773ff03f91 novatel: custom signal quality loading for non-3GPP modems 2012-08-20 16:27:05 +02:00
Aleksander Morgado
953f787bf3 novatel: allowed modes and access tech loading only in non-CDMA modems 2012-08-20 16:27:05 +02:00
Aleksander Morgado
c9337cc8b9 novatel: configure SM storage as default always 2012-08-20 16:27:04 +02:00
Aleksander Morgado
348a80374a novatel: implement custom messaging unsolicited messages enabling 2012-08-20 16:27:04 +02:00
Aleksander Morgado
1931a69e50 novatel: implement current access technology loading 2012-08-20 16:27:04 +02:00
Aleksander Morgado
e150c4cf92 novatel: implement allowed mode loading/setting
Settings are given with the 'AT$NWRAT' arguments as follows:
  1,1: 2G allowed
  2,1: 3G allowed
  0,2: 2G and 3G allowed, none preferred
  1,2: 2G and 3G allowed, 2G preferred
  2,2: 2G and 3G allowed, 3G preferred
2012-08-20 16:26:55 +02:00
Aleksander Morgado
b8e5dbcaf4 novatel: flip secondary ports to AT mode during port setup 2012-08-20 16:26:55 +02:00
Aleksander Morgado
058fd0256d novatel: new `MMBroadbandModemNovatel' 2012-08-20 16:26:55 +02:00
Aleksander Morgado
56a7e40e37 novatel: start porting the Novatel plugin 2012-08-20 16:26:55 +02:00
Aleksander Morgado
eb71b9464d novatel-lte: reorganize code
Just to make it more aligned with how other plugins are structured.
2012-08-20 16:26:55 +02:00
Aleksander Morgado
b399a17163 novatel-lte: renamed the plugin to "Novatel LTE"
This plugin only handles the E362 right now.
2012-08-20 16:26:55 +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
97baa44b04 novatel: report error if not properly disconnected
When we request to disconnect, and the disconnection status check fails, return
a proper error.
2012-05-06 17:12:36 +02:00
Aleksander Morgado
b2d376696c novatel: minor coding style fixes 2012-05-06 17:12:36 +02:00
Aleksander Morgado
caeeae2721 bearer: simplify handling of the bearer configuration
The base MMBearer object will receive the MMBearerProperties configuration,
which contains every generic and plugin-specific set up. Not every configuration
parameter will be used by every implementation (e.g. not every bearer needs
user/password).

The Bearer object will expose every configuration parameter received in its
`Properties' property in the interface, even if it's not really used.
2012-05-06 17:12:36 +02:00
Nathan Williams
1c1a6a16ec novatel: Poll for whether the connection still exists.
Novatel E362 firmware doesn't notify us by unsolicited message if the
connection goes away, so set up a polling loop to check.

While here, inline a method that's only used in one place so that the
containing function is single-exit and single-cleanup.

Change-Id: If72f7c6ef06de3fb22530d42f62a8dddc6fecfda
2012-05-02 21:05:06 +02:00