Skip to content

Commit

Permalink
drivers/modem: Add generic cellular modem driver
Browse files Browse the repository at this point in the history
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.

If finalized, it can replace the gsm_ppp entirely in the
future. The goal of the driver however is to serve as a
bare minimum, not a production ready driver.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
  • Loading branch information
Bjarki Arge Andreasen committed May 19, 2023
1 parent fdcdfaa commit e5b699a
Show file tree
Hide file tree
Showing 4 changed files with 1,054 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/modem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ if (CONFIG_MODEM_SIM7080)
zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/ip)
zephyr_library_sources(simcom-sim7080.c)
endif()

zephyr_library_sources_ifdef(CONFIG_MODEM_CELLULAR modem_cellular.c)
1 change: 1 addition & 0 deletions drivers/modem/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ source "drivers/modem/Kconfig.ublox-sara-r4"
source "drivers/modem/Kconfig.quectel-bg9x"
source "drivers/modem/Kconfig.wncm14a2a"
source "drivers/modem/Kconfig.gsm"
source "drivers/modem/Kconfig.cellular"

source "drivers/modem/Kconfig.hl7800"
source "drivers/modem/Kconfig.simcom-sim7080"
Expand Down
39 changes: 39 additions & 0 deletions drivers/modem/Kconfig.cellular
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2023 Bjarki Arge Andreasen
# SPDX-License-Identifier: Apache-2.0

config MODEM_CELLULAR
bool "Generic cellular modem support"
select MODEM_MODULES
select MODEM_PPP
select MODEM_CMUX
select MODEM_CHAT
select MODEM_PIPE
select MODEM_BACKEND_UART
select RING_BUFFER
depends on DT_HAS_QUECTEL_BG9X_ENABLED || DT_HAS_ZEPHYR_GSM_PPP_ENABLED || \
DT_HAS_SIMCOM_SIM7080_ENABLED || DT_HAS_UBLOX_SARA_R4_ENABLED
help
This driver uses the generic 3gpp AT commands, along
with the standard protocols CMUX and PPP, to configure
cellular modems to establish a point-to-point
network connection. It is a plug-in replacement for the
existing GSM_PPP driver, and a template for tailored
drivers for the ublox, quectel and other modems, which
include power management and more complex device specific
features.

if MODEM_CELLULAR

config MODEM_CELLULAR_APN
string "APN"
default "internet"

config MODEM_CELLULAR_USERNAME
string "APN username"
default ""

config MODEM_CELLULAR_PASSWORD
string "APN password"
default ""

endif

0 comments on commit e5b699a

Please sign in to comment.