1 /*
2  * Copyright (c) 2020 Endian Technologies AB
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_INCLUDE_DRIVERS_MODEM_GSM_PPP_H_
8 #define ZEPHYR_INCLUDE_DRIVERS_MODEM_GSM_PPP_H_
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #define GSM_PPP_MDM_MANUFACTURER_LENGTH  10
15 #define GSM_PPP_MDM_MODEL_LENGTH         16
16 #define GSM_PPP_MDM_REVISION_LENGTH      64
17 #define GSM_PPP_MDM_IMEI_LENGTH          16
18 #define GSM_PPP_MDM_IMSI_LENGTH          16
19 #define GSM_PPP_MDM_ICCID_LENGTH         32
20 
21 struct gsm_ppp_modem_info {
22 	char mdm_manufacturer[GSM_PPP_MDM_MANUFACTURER_LENGTH];
23 	char mdm_model[GSM_PPP_MDM_MODEL_LENGTH];
24 	char mdm_revision[GSM_PPP_MDM_REVISION_LENGTH];
25 	char mdm_imei[GSM_PPP_MDM_IMEI_LENGTH];
26 #if defined(CONFIG_MODEM_SIM_NUMBERS)
27 	char mdm_imsi[GSM_PPP_MDM_IMSI_LENGTH];
28 	char mdm_iccid[GSM_PPP_MDM_ICCID_LENGTH];
29 #endif
30 	int  mdm_rssi;
31 };
32 
33 /** @cond INTERNAL_HIDDEN */
34 struct device;
35 typedef void (*gsm_modem_power_cb)(const struct device *, void *);
36 
37 void gsm_ppp_start(const struct device *dev);
38 void gsm_ppp_stop(const struct device *dev);
39 /** @endcond */
40 
41 /**
42  * @brief Register functions callbacks for power modem on/off.
43  *
44  * @param dev: gsm modem device
45  * @param modem_on: callback function to
46  *		execute during gsm ppp configuring.
47  * @param modem_off: callback function to
48  *		execute during gsm ppp stopping.
49  * @param user_data: user specified data
50  */
51 void gsm_ppp_register_modem_power_callback(const struct device *dev,
52 					   gsm_modem_power_cb modem_on,
53 					   gsm_modem_power_cb modem_off,
54 					   void *user_data);
55 
56 /**
57  * @brief Get GSM modem information.
58  *
59  * @param dev: GSM modem device.
60  *
61  * @retval struct gsm_ppp_modem_info * pointer to modem information structure.
62  */
63 const struct gsm_ppp_modem_info *gsm_ppp_modem_info(const struct device *dev);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif /* ZEPHYR_INCLUDE_DRIVERS_MODEM_GSM_PPP_H_ */
70