Fix variable declaration so that this driver will compile with clang,
which does not support variable declarations within switch statements
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Recent changes to net_link_addr structure to not use pointers
have made it necessary to update the modem_cellular driver
to ensure compatibility with the new structure definition.
Otherwise, an assertion failure occurs in subsys/net/l2/ppp/ipv6cp.c:40.
This commit updates that link address is set to NET_LINK_ADDR_MAX_LENGTH
least significant bytes of IMEI instead of IMEI total length.
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
SIM-cards remember which networks has rejected attach attempts. This is
not always desired if the user has control over which networks to allow.
This commit adds a Kconfig symbol which enables clearing of saved
forbidden networks from SIM-card on boot.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
U-blox LARA-R6 LWM2M client is enabled by default. Not only causes this
the modem to connect to U-blox's server on its own, it also for some
reason causes the modem to reply "Destination unreachable" to DNS answers
from DNS requests that we send
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Instead of using 32 bit enum values for event numbers, convert
the code to use 64 bit long bit fields. This means that the
user API is changed to use 64 bit event values instead of 32
bit event values.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for the simcom a76xx modem which is similar to the simcom 7080
but has a few key differences. Tested with a simcom A7672SA module but as
there is a single simcom A76XX AT commands manual, the driver should work
with other modems of the series.
Signed-off-by: Olivier Lalonde <o@syskall.com>
Fix regression introduced by dormant state, where the
carrier does not get closed when Cellular Modem driver
is suspended.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
Previously, it was expected that the modem would immediately
disconnect and close the PPP link, when the network was lost
(+CEREG: 4 is received). Failure to do so, would result in
modem attempting to chat with dlci2 channel, where as cellular
modem driver would drop to dlci1. This would show as dial
script timing out, which would freeze cellular modem driver.
Adding dormant state enables graceful disconnection of PPP-link
when the network is lost. This allows the modems which do
not automatically close with network link loss to close
based on PPP link closure.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
Allow configuring MTU for CMUX.
Some AT manual and specification define this as a
frame size. Linux ldattach default to 127 bytes,
3GPP TS 27.010 defaults to 31.
We should limit our CMUX frames to a size that
remote end is capable of handling.
Linux silently drops oversized frames.
Also, remove MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE as
this was only limiting a buffer sizes, and resulted
CMUX frames to be capped to same value.
Use MODEM_CMUX_WORK_BUFFER_SIZE and MODEM_CMUX_MTU instead.
Also rename CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZES to
CONFIG_MODEM_CELLULAR_CHAT_BUFFER_SIZE as it is now
only used as a Chat module. DLCI pipes use
CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
`+C*REG:` may be received as AT read command answer
or unsolicited notification.
Their syntax differs, and even the overall parameter count varies
depending on what `<n>` is used in the `AT+CEREG=` write command.
To handle all cases properly, check the parameter count and
the presence of the `<tac>` parameter (which is a string and
thus begins with `"`) to figure out what is the position of `<stat>`.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Add support for the Telit ME310G1 LTE modem which is very similar to
the ME910G1. Re-use the ME910G1's AT command scripts but rename
them to mex10_xx and define a shutdown script (AT#SHDN).
Signed-off-by: Niklas Gürtler <niklas.guertler@e-obs.de>
Add support to define a shutdown script for cellular modems, i.e.
AT commands to shutdown the modem. This allows to shutdown the
modem much quicker compared to using a power pulse which saves power.
Signed-off-by: Niklas Gürtler <niklas.guertler@e-obs.de>
It has been observed that using a CMUX max frame size of 127
causes FCS errors; smaller or larger works. This commit sets the max
frame size to the modem's default value.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
U-Blox LARA-R6 was added to modem_cellular, and an additional state
was introduced where the UART baudrate is changed if the modem supports
it
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
The OK response should be processed before entering CMUX mode.
Use UART ISR mode by default.
Fix warnings and errors produced by the sample.
Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
Introduced `MODEM_CELLULAR_DEFINE_INSTANCE` macro to streamline
the definition and initialization of modem cellular instances.
This macro enables passing parameters that vary among modems, including:
`power_pulse_duration_ms`, `reset_pulse_duration_ms`, `startup_time_ms`,
`shutdown_time_ms`, `autostarts`, `init_chat_script`, `dial_chat_script`
and `periodic_chat_script`.
This will reduce the number of redundant lines in the code, aiming for
improved maintainability.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Introduced the `MODEM_CELLULAR_DEFINE_AND_INIT_USER_PIPES` macro to
consolidate multiple user pipe data definitions into a single macro call.
This will reduce the number of redundant lines in the code, aiming for
improved maintainability.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
The supported modems don't have the same number or assignment
of DLCI channels. For example, the NRF91_SLM only has DLCI
channel 3 assigned to GNSS tunneling, where the ublox sara r5
has DLCI 3 assigned to an additional AT channel, and DLCI 4
assigned to GNSS tunneling.
This commit updates the creation and assignment of DLCI
channels and pipelinks to match the capabilties of each modem.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Add two DLCI channels to the cellular modem driver, and expose
them using the modem pipelink module.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The new modem_cellular driver had support for the deprecated
generic zephyr,gsm-ppp dts compatible for backwards compatibility.
zephyr,gsm-ppp is being removed, and as such, modem_cellular.c
no longer needs to support it.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Remove redundant `const` qualifiers in `struct modem_cellular_config` and
add `const` to the declaration to ensure the structure resides
in read-only memory (rodata).
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Adds the necessary defines with init, dial and periodic chat scripts to
support the Sequans GM02S Modem.
Modification to cxreg handler to process GM02S +CEREG response.
Signed-off-by: Thibo Verheyde <thibo@dptechnics.com>
Add missing fields to complete info struct to
chat script for Telit ME910G1. Also for test
suite modem bg95.
Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
This commit implements a network registration status API,
including return of reject cause in case of denial.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Add connect match for dialing PPP connection.
Ensure PDP authentication is disabled.
Request manufacturer, firmware version, and IMSI from the modem.
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
Allow not specifying the chat_filter parameter in a device
definition, which is equivalent to setting it to "".
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The nRF91 series devices, when running the Serial LTE Modem (SLM)
application starting with nRF Connect SDK 2.6.0, can now be used as
standalone modems via the generic modem_cellular driver.
A configuration to run the cellular_modem sample on the nRF9160 DK
(plugged in to another nRF91 series device running SLM) is provided.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
info level is printed always to console and it's noisy.
Change to debug level, which can be enabled with
CONFIG_MODEM_MODULES_LOG_LEVEL_DBG
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.
Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>