There are cases where the gprs status might updated to for instance
"unknown" while LTE is the bearer.
In that case we should not set the attach state to FALSE,
since then running LTE the conext activation reflects the attached
state.
Previously the valid "unknown" netreg status was set
during startup, but its a bit problematic for gprs.
There might be cases where a LTE context is activated
before netreg is finished updating its status.
Resulting in gprs taking faulty actions.
Instead we set the status to -1 until we are updated
with a known value.
During the time the status is -1, gprs postpones actions until
the status is valid (>= 0).
To detect if a context gets activated before we register
for unsolicited events we need to check if any is
already activated, and flag it auto activated.
The Quectel modems issues unsolicited strings in case of power related
events. The UC15 uses +QIND: for the events, while M95 and MC60 uses
descriptive strings. (UC15 also uses a string for normal power down).
Register listeners for these strings/codes. The handler emits an
appropriate dbus signal, and closes down the modem if needed.
The gprs-context does special casing on the quectel serial modem when
probing the supported layer 2 protocols, so pass the vendor id when
setting up the atoms.
The Quectel M95 and MC60 modems respond to AT+CGDATA=? with a single
+CGDATA="PPP", but the callback in gprs-context expects a list of
protocols.
Avoid falling back to the old-style ATD*99 by not expecting a list of
protocols for serial quectel modems.
For uBlox modems, a bit of custom setup is required, but after that the
generic "atmodem" (27.007-compatible) method implementations are
sufficient. This driver, therefore, just puts the custom probe method
into place and defers remaining functionality to the recently exported
atmodem implementations.
Some uBlox modems support multiple, simultaneously active contexts. These
contexts are either bridged to the network interface or handled
transparently by the modem acting like a router.
The problem with this approach is that ofono and ofono clients (e.g.
mmsd) expect a dedicated _local_ network interface for each context.
As such, it doesn't make sense for ofono to set up the multiple gprs
contexts.
Some u-blox devices present a USB network class device for data and some
just switch to PPP on (one of) the communication channel(s). Whether
the atmodem or ubloxmodem gprs-context driver should be used depends on
whether or not the network interface is present; check this condition
directly when deciding which driver to us.
An upcoming netreg driver for uBlox modems will need to override the
probe method in order to set itself up, but for further functionality
the "generic" AT implementations are sufficient. The easiest way to do
this is to just set up a vtable with a custom probe implementation and
defer all other methods to the common/generic methods.
The problem is that the AT methods are not actually exported. This
generic AT functionality was not intended to be hooked directly into
other drivers.
This patch exports all the methods of the atmodem network-registration
driver implementation so that they can be used as generic/common
implementations for other drivers.
Prepare the test to print commands to execute and let the caller
evaluate those. In that way, more commands can be added to also set up
name servers and default routes without secretly breaking the existing
system network setup.
Lac and cellid information are optional in ss_info notifications.
Remember them in order to give a correct information each time a
notification is received.
Some Quectel models supports different features such as GNSS or
different URC strings. Add a field in the quectel data structure to be
used when adding support for said features.
Some vendors might print trailing spaces after unsolicited result codes.
Avoid duplicating and stripping the string after calling
g_at_result_iter_next_unquoted_string() by stripping the spaces in
gatresult instead.
The Quectel M95 modem issues a "Call ready" notification when call and
phonebook are ready, so set up a listener for that.
The only way to know when sms is ready is to issue QINITSTAT queries.
Since sms is always ready after call and phonebook, the queries are
initiated after creating call/phonebook.
This adds support for configuring a gpio in udev to control the modem
power.
To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and
OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example:
KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \
ENV{OFONO_QUECTEL_GPIO_CHIP}="gpiochip2", \
ENV{OFONO_QUECTEL_GPIO_OFFSET}="26"
Setup GSM 07.10 multiplexing using the kernel n_gsm line discpline
driver, and use the virtual tty devices as Aux and Modem channels.
The driver supports rts/cts on the underlying serial device. This is
enabled with OFONO_QUECTED_RTSCTS udev environment, e.g.:
KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \
ENV{OFONO_QUECTEL_RTSCTS}="on"
CNMA isn't mentioned in the m95 documentation, but trial'n'error has
revealed some details:
* the CSMS query returns the list (0,128) instead of a range
* CNMA is enabled by setting 128 as CSMS service
* once enabled, SMS deliveries are acked by sending AT+CNMA without a
value setting
Add m95 quirks to the atmodem driver, so that CNMA is correctly
detected, configured, and used.