Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cellular.h File Reference

Main header file for cellular modem driver API. More...

#include <zephyr/types.h>
#include <zephyr/device.h>
#include <errno.h>

Go to the source code of this file.

Data Structures

struct  cellular_network
 Cellular network structure. More...
struct  cellular_evt_modem_info
 Payload for CELLULAR_EVENT_MODEM_INFO_CHANGED. More...
struct  cellular_evt_registration_status
 Payload for CELLULAR_EVENT_REGISTRATION_STATUS_CHANGED. More...
struct  cellular_driver_api
 Cellular driver API. More...

Typedefs

typedef uint32_t cellular_event_mask_t
typedef void(* cellular_event_cb_t) (const struct device *dev, enum cellular_event event, const void *payload, void *user_data)
 Prototype for cellular event callbacks.
typedef int(* cellular_api_configure_networks) (const struct device *dev, const struct cellular_network *networks, uint8_t size)
 API for configuring networks.
typedef int(* cellular_api_get_supported_networks) (const struct device *dev, const struct cellular_network **networks, uint8_t *size)
 API for getting supported networks.
typedef int(* cellular_api_get_signal) (const struct device *dev, const enum cellular_signal_type type, int16_t *value)
 API for getting network signal strength.
typedef int(* cellular_api_get_modem_info) (const struct device *dev, const enum cellular_modem_info_type type, char *info, size_t size)
 API for getting modem information.
typedef int(* cellular_api_get_registration_status) (const struct device *dev, enum cellular_access_technology tech, enum cellular_registration_status *status)
 API for getting registration status.
typedef int(* cellular_api_set_apn) (const struct device *dev, const char *apn)
 API for programming APN.
typedef int(* cellular_api_set_callback) (const struct device *dev, cellular_event_mask_t mask, cellular_event_cb_t cb, void *user_data)
 API for registering an asynchronous callback.

Enumerations

enum  cellular_access_technology {
  CELLULAR_ACCESS_TECHNOLOGY_GSM = 0 , CELLULAR_ACCESS_TECHNOLOGY_GSM_COMPACT = 1 , CELLULAR_ACCESS_TECHNOLOGY_UTRAN = 2 , CELLULAR_ACCESS_TECHNOLOGY_GSM_EGPRS = 3 ,
  CELLULAR_ACCESS_TECHNOLOGY_UTRAN_HSDPA = 4 , CELLULAR_ACCESS_TECHNOLOGY_UTRAN_HSUPA = 5 , CELLULAR_ACCESS_TECHNOLOGY_UTRAN_HSDPA_HSUPA = 6 , CELLULAR_ACCESS_TECHNOLOGY_E_UTRAN = 7 ,
  CELLULAR_ACCESS_TECHNOLOGY_EC_GSM_IOT = 8 , CELLULAR_ACCESS_TECHNOLOGY_E_UTRAN_NB_S1 = 9 , CELLULAR_ACCESS_TECHNOLOGY_E_UTRA_5G_CN = 10 , CELLULAR_ACCESS_TECHNOLOGY_NR_5G_CN = 11 ,
  CELLULAR_ACCESS_TECHNOLOGY_NG_RAN = 12 , CELLULAR_ACCESS_TECHNOLOGY_E_UTRA_NR_DUAL = 13 , CELLULAR_ACCESS_TECHNOLOGY_E_UTRAN_NB_S1_SAT = 14 , CELLULAR_ACCESS_TECHNOLOGY_E_UTRAN_WB_S1_SAT = 15 ,
  CELLULAR_ACCESS_TECHNOLOGY_NG_RAN_SAT = 16 , CELLULAR_ACCESS_TECHNOLOGY_UNKNOWN = 255
}
 Cellular access technologies (3GPP TS 27.007 AcT) More...
enum  cellular_signal_type { CELLULAR_SIGNAL_RSSI , CELLULAR_SIGNAL_RSRP , CELLULAR_SIGNAL_RSRQ }
 Cellular signal type. More...
enum  cellular_modem_info_type {
  CELLULAR_MODEM_INFO_IMEI , CELLULAR_MODEM_INFO_MODEL_ID , CELLULAR_MODEM_INFO_MANUFACTURER , CELLULAR_MODEM_INFO_FW_VERSION ,
  CELLULAR_MODEM_INFO_SIM_IMSI , CELLULAR_MODEM_INFO_SIM_ICCID
}
 Cellular modem info type. More...
enum  cellular_registration_status {
  CELLULAR_REGISTRATION_NOT_REGISTERED = 0 , CELLULAR_REGISTRATION_REGISTERED_HOME = 1 , CELLULAR_REGISTRATION_SEARCHING = 2 , CELLULAR_REGISTRATION_DENIED = 3 ,
  CELLULAR_REGISTRATION_UNKNOWN = 4 , CELLULAR_REGISTRATION_REGISTERED_ROAMING = 5 , CELLULAR_REGISTRATION_SMS_ONLY_HOME = 6 , CELLULAR_REGISTRATION_SMS_ONLY_ROAMING = 7 ,
  CELLULAR_REGISTRATION_EMERGENCY_ONLY = 8 , CELLULAR_REGISTRATION_CSFB_NOT_PREFERRED_HOME = 9 , CELLULAR_REGISTRATION_CSFB_NOT_PREFERRED_ROAMING = 10 , CELLULAR_REGISTRATION_RLOS = 11
}
 Cellular registration status (3GPP TS 27.007) More...
enum  cellular_event { CELLULAR_EVENT_MODEM_INFO_CHANGED = BIT(0) , CELLULAR_EVENT_REGISTRATION_STATUS_CHANGED = BIT(1) }
 Events emitted asynchronously by a cellular driver. More...

Functions

static int cellular_configure_networks (const struct device *dev, const struct cellular_network *networks, uint8_t size)
 Configure cellular networks for the device.
static int cellular_get_supported_networks (const struct device *dev, const struct cellular_network **networks, uint8_t *size)
 Get supported cellular networks for the device.
static int cellular_get_signal (const struct device *dev, const enum cellular_signal_type type, int16_t *value)
 Get signal for the device.
static int cellular_get_modem_info (const struct device *dev, const enum cellular_modem_info_type type, char *info, size_t size)
 Get modem info for the device.
static int cellular_get_registration_status (const struct device *dev, enum cellular_access_technology tech, enum cellular_registration_status *status)
 Get network registration status for the device.
static int cellular_set_apn (const struct device *dev, const char *apn)
 Set the APN used for PDP context.
static int cellular_set_callback (const struct device *dev, cellular_event_mask_t mask, cellular_event_cb_t cb, void *user_data)
 Subscribe to asynchronous cellular events.

Detailed Description

Main header file for cellular modem driver API.