Commit graph

15 commits

Author SHA1 Message Date
Andrei Hutanu 27ad7111cd drivers: modem: quectel-bg9x: fix reset BG95 mdm
In case of BG95 where there is no reset pin, reseting the board
which uses a BG95 modem could result in powering-off the modem
(as oposed to "reset" the modem). This commit is an attempt
to handle this case and re-power the modem.

Signed-off-by: Andrei Hutanu <andrei.hutanu.i@gmail.com>
2023-05-27 06:28:33 -04:00
Andrei Hutanu 3cf92bce11 drivers: modem: quectel-bg9x: mdm unsol ready
Using bg9x driver with bg95 specifically has the issue that BG95
modem replies with "RDY" when it's not fully initialized and AT
commands sent to the modem after this point would result in modem
reply of "ERROR". This commit adds a new prj.conf field in the build
configuration for custom unsolicited app ready string, with
the default being BG96 one ("RDY").

Signed-off-by: Andrei Hutanu <andrei.hutanu.i@gmail.com>
2023-05-27 06:28:33 -04:00
Bjarki Arge Andreasen a4afcf8c93 drivers/modem/modem_iface_uart: Update API
The UART IFACE API currently exposes the context struct
modem_iface_uart_data, expecting the user to fill in some
of the fields, with no documentation specifying which fields
and what they mean.

This API update moves all user configurable values in the context
out into a config struct, modem_iface_uart_config, within which
members are documented.

This prevents the user from interacting directly with the context
making use of the library safer and more readable.

The config structure helps make code readable by using "named args"
in a const struct instead of a long, nameless, parameter list passed
to the modem_iface_uart_init function.

The new API function modem_iface_uart_rx_wait is added to prevent the
user from having to interact with the rx sem in the context directly.

The context can now be safely interated with without direct access to
any of its members.

Pointers to the ring buffer params in the context have been moved to
config struct, as these are only useful during initialization of the
context.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-11 11:42:00 +02:00
Georges Oates_Larsen 3c6b7dc35a net: dummy L2 for offloaded ifaces
Adds dummy link layer for offloaded ifaces, allowing
ifaces to directly receive l2_enable calls

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-03-20 09:53:25 +01:00
Gerard Marull-Paretas fd2052d524 drivers: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Marcin Niestroj 10ebfb3877 modem: quectel-bg9x: use 'gpio_dt_spec' instead of 'modem_pin'
Move away from 'modem_pin' abstraction as it has not obvious value compared
to generic 'gpio_dt_spec'.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-06-06 17:58:52 +02:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Bartosz Bilas ee7cd10563 drivers: modem: improve modem context RSSI member
The previous bf68b67 commit incorrectly passes minfo.mdm_rssi
value to the modem context data_rssi member during the driver
initialization which causes the `modem info` shell command
to return 0 as RSSI value. Fix that by changing data_rssi
modem ctx member to a pointer that is assigned to the RSSI
variable stored within the modem driver context structure.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-07 15:02:43 +02:00
Marcin Niestroj 26bd4fb45e drivers: modem: operate on device pointers instead of names
So far modem API used UART device names / labels. Change API to operate
on device pointers instead, so that we stop using device_get_binding()
in modem core and in some DT compatible modem drivers.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-07-15 11:48:00 -04:00
Yong Cong Sin 084a8b6bf4 drivers: modem: BG9X wait for RDY instead of polling AT.
BG9X wait for RDY instead of polling AT.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-04-21 17:04:40 +03:00
Peter Bigot cc090726e6 drivers: modem: rote conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Be aware that this does not address architectural errors in the use
of the work API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-14 07:07:40 -04:00
Anas Nashif 5fa12073cb drivers: remove what appears to be code from comments
Some tools consider this as commented code because of the ifdef, so
remove that and fix a coding guideline violation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-01 05:34:17 -04:00
Thomas LE ROUX f360718d0b drivers: modem: Fix PDP context management for BG9X
The PDP context might be active.
If that's the case, the AT+QIACT command returns an error.
It's then not possible to succeed at setting up the module.

Furthermore, we apply the logic described in the Quectel Documentation :
- If there is an issue 3 consecutive times on activating/deactivating
the context, we restart the module.
- If the AT+QIDEAT command returns an error, we restart the module.

This PR is bug-fix aimed.
We leave parameterization of context ID for future enhancement.

Signed-off-by: Thomas LE ROUX <thomas.leroux@smile.fr>
2021-02-23 12:01:27 +02:00
Guillaume Paquet 143a776657 boards: arm: nordic: Add BG96 to RAK5010 board
Add BG96 in board description
Add W Disable Pin in BG96 descriptor

Signed-off-by: Guillaume Paquet <guillaume.paquet@smile.fr>
2021-02-15 08:25:46 -05:00
Bilal Wasim 503a70a40a drivers: modem: Add support for quectel bg95
Adding support for Quectel BG95 Modem offloaded driver
to zephyr.

The driver currently implements only the
client side functions of the "socket_op_vtable", and
so cannot be used for cases where Zephyr acts as a
server. Moreover the driver only supports TCP for now.

Looking through the guides, the same driver should be
usable for BG96 (and other modems) except for the modem
boot-up sequence. Hence its named as "bg9x" instead of
"bg95".

Tested extensively with Zephyr acting as MQTT endpoint
and publishing / subscribing data to / from an MQTT
broker.

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2020-12-01 17:43:59 -05:00