The res param in offload_freeaddrinfo is not used.
Mark it as unused, to avoid static analysis complaining about
Parse warning (PW.PARAM_SET_BUT_NOT_USED)
Fixes CID 316235
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
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>
rssi 31 will be -51dBm or greater, where -51 is valid. Fix the
range by allowing until -51.
Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
This commit implements parsing of the CESQ extended signal quality AT
command, extracting RSRP and RSRQ which is relevant for LTE connections.
It's used in the U-blox SARA-R5 modem instance. Furthermore, the IMEI,
IMSI is extracted in the same modem.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
The QCCID handler is Quectel specific and as such may not be part
of the modem cellular driver which only supports commands defined
in 3GPP TS 27.007
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
The modem_cellular.c driver now uses a common script to get
signal strenght, which is run on demand. This is more efficient
than polling it, and simpler since every modem doesn't have to
define their own variant of the script.
Additionally, the CSQ handler now stores the "raw" rssi value
returned from AT+CSQ to be parsed by the cellular_modem_get_signal
implementation.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Move the implementations of the cellular API in modem_cellular.c
to an cellular_driver_structure, and implement this API structure
withing the device drivers.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Fixed Kconfig to remove dependency between modem_socket and
modem_context, the two do not depend on each other and
should be possible to use independently
Signed-off-by: Alessio Lei <alelei94@yahoo.it>
Do not allow the modem to sleep if the driver is busy.
Fix CTS filtering. Ignore small pulses on the CTS line.
Fix socket restoration. Restored sockets could be mismatched
with a wrong type.
UDP sockets could be duplicated during restore.
Improve IO debug mode. Use warning message for IO debug mode
to easily see IO transitions color coded in a terminal.
Ensure the UART is enabled whenever the driver needs to send
commands to the modem.
Ensure DNS resolver is re-initialized after the modem is powered off.
PROD-307
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
U-blox SARA-R4 already exists but the behavior is different,
requiring a separate driver instance. For instance, R5 autostarts,
so this commit also adds support for skipping power on pulse.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Some modems or networks require PAP authentication for successful
LCP handshake. Tested on U-blox SARA-R5 with zephyr,gsm-ppp.
Signed-off-by: Emil Lindqvist <emil@lindq.gr>
Fix handling of strncpy in cgnsinf parsing function to avoid
potentially getting a non-null terminated string.
Fixes#58573 / CID: 248403
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Build errors where introduced by
c76d5b882c and are fixed with this
commit. They are trivial fixes of malformed lines.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
The init scripts need a missing wait for OK after sending
AT+CGMM and the AT+CMUX command specifies more parameters
than nessesary, and in some cases incorrectly.
This commit adds the missing wait for OK and fixes the AT+CMUX
commands in the init scripts.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Added chat script and initial config to support Telit ME910G1.
Needed to edit power_pulse pin timing in accordance to datasheet.
Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
This contribution addresses the support for various types of modems in
gsm driver. As some 4G modems have failed to return correct output
from AT+CREG?, so AT+CEREG? is the right AT command in such situation.
This commit provides the possibility for user to select one type of
AT command. This PR fixes zephyrproject-rtos#63917
Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com>
There is no fallthrough statement or comment so I assume break is
missing.
Fixes build time warning from some tools.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit adjust the chat scripts for the simcom
sim7080 and gsm_ppp compatibles to fix an issue found
when trying to use a sim7080 modem. The CMUX command
includes optional parameters which are not identical
for all modems, so the AT+CMUX command has been adjusted
to only contain the mandatory parameters.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.
Rename it to random.h and get consistently with other
subsystems.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit adds a timeout of 300ms to the generic (gsm_ppp) init
chat script. This delay is required for some modems (discovered on
a Telit ME910G1-WW) to allow it to enter CMUX mode. Without this
delay, the modem simply refuses to respond to any CMUX commands.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
GCC format-truncation kicks in on this printk whenever the logging
configuration transforms the LOG_WRN below into a noop, and the snprintk
return argument become unused.
Fix that by switching to strncpy, fixes:
zephyrproject/zephyr/drivers/modem/hl7800.c:1786:74: warning: '%s'
directive output may be truncated writing up to 53 bytes into a region
of size 21 [-Wformat-truncation=]
reproduced with:
west build -p -b mg100 -T samples/net/telnet/sample.net.telnet
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit updates the modem_cellular driver to use the
new naming scheme for the modem_chat functions.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit improves the usage of the bus pipe (connected
to UART) to only open it when the modem is actually
powered and ready, not when leaving the idle state. This
ensures the pipe is flushed before sending the init script,
and re-enables the UART driver if it is disabled due to
errors.
While building a test platform based on the nRF9160 and a
Quectel BG95, it was discovered that the nRF9160 correctly
throws UART errors if the RX is enabled while the UART RX
line is low (which was due to the modem being powered
down).
The improvements should also help help remove the
"<wrn> modem_chat: receive buffer overrun" warning which
would occur during startup as the pipe was opened, but
nothing was receiving the data, causing the buffer to
overflow.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.
The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);
has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);
The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.
All in-tree uses of the function have been adapted.
Fixes#61888.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The added cellular modem driver is a naive driver, which
shall serve as a template for implementing tailored
drivers for modems like the UBLOX-R4. It uses only
generic at commands, described in 3gpp, and protocols,
like CMUX and PPP.
A binding for the BG95 has been added, which replaces
the quectel,bg9x. This is neccesary since the BG95 does
not have a usable reset pin, the reset and powerkey are
internally connected to each other.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
Use the symbol iface_ctx in place of ictx. This was
introduced seemingly by mistake in PR #61510
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Ensure the driver enables the LTE radio during init unless boot
in airplane mode is specified.
To ensure the settings applied during init are used, the LTE radio
is turned off during config.
Fix issue where PDP and GPRS connection config could have a mismatched APN.
Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit removes the direct calls of the PPP API of the
network device used by gsm_ppp.c
These calls are now performed by the L2 PPP interface when it
is brought up or down using net_if_up() or net_if_down()
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Cache the delimiter string length in `parse_params`, instead of
calculating it on each character in the match buffer.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>