Developer World
Spresense SDK Library v3.2.0-ebc0364
lte_api.h
Go to the documentation of this file.
1/****************************************************************************
2 * apps/include/lte/lte_api.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
20
21#ifndef __APPS_INCLUDE_LTE_LTE_API_H
22#define __APPS_INCLUDE_LTE_LTE_API_H
23
190/****************************************************************************
191 * Included Files
192 ****************************************************************************/
193
194#include <nuttx/config.h>
195
196#include <stdbool.h>
197#include <stdint.h>
199
200#ifdef __cplusplus
201#define EXTERN extern "C"
202extern "C"
203{
204#else
205#define EXTERN extern
206#endif
207
208/****************************************************************************
209 * Public Function Prototypes
210 ****************************************************************************/
211
223
231int lte_finalize(void);
232
265
278int lte_power_on(void);
279
297
309
310#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
311
327int lte_radio_on(radio_on_cb_t callback);
328
329#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
330
342
343#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
344
360int lte_radio_off(radio_off_cb_t callback);
361
362#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
363
388int lte_get_netinfo_sync(uint8_t pdn_num, FAR lte_netinfo_t *info);
389
390#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
391
411int lte_get_netinfo(get_netinfo_cb_t callback);
412
413#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
414
442
470
479
496int lte_deactivate_pdn_sync(uint8_t session_id);
497
498#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
499
521int lte_deactivate_pdn(uint8_t session_id, deactivate_pdn_cb_t callback);
522
523#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
524
546int lte_data_allow_sync(uint8_t session_id, uint8_t allow,
547 uint8_t roaming_allow);
548
549#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
550
576int lte_data_allow(uint8_t session_id, uint8_t allow,
577 uint8_t roaming_allow, data_allow_cb_t callback);
578
579#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
580
593int lte_get_imscap_sync(FAR bool *imscap);
594
595#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
596
609int lte_get_imscap(get_imscap_cb_t callback);
610
611#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
612
624
625#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
626
639int lte_get_version(get_ver_cb_t callback);
640
641#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
642
656#ifdef CONFIG_LTE_LAPI_KEEP_COMPATIBILITY
657int lte_get_phoneno_sync(FAR char *phoneno);
658#else
659int lte_get_phoneno_sync(FAR char *phoneno, size_t len);
660#endif
661
662#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
663
676int lte_get_phoneno(get_phoneno_cb_t callback);
677
678#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
679
693#ifdef CONFIG_LTE_LAPI_KEEP_COMPATIBILITY
694int lte_get_imsi_sync(FAR char *imsi);
695#else
696int lte_get_imsi_sync(FAR char *imsi, size_t len);
697#endif
698
699#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
700
713int lte_get_imsi(get_imsi_cb_t callback);
714
715#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
716
730#ifdef CONFIG_LTE_LAPI_KEEP_COMPATIBILITY
731int lte_get_imei_sync(FAR char *imei);
732#else
733int lte_get_imei_sync(FAR char *imei, size_t len);
734#endif
735
736#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
737
750int lte_get_imei(get_imei_cb_t callback);
751
752#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
753
765
766#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
767
780int lte_get_pinset(get_pinset_cb_t callback);
781
782#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
783
803int lte_set_pinenable_sync(bool enable, FAR char *pincode,
804 FAR uint8_t *attemptsleft);
805
806#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
807
829int lte_set_pinenable(bool enable, FAR char *pincode,
830 set_pinenable_cb_t callback);
831
832#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
833
859int lte_change_pin_sync(int8_t target_pin, FAR char *pincode,
860 FAR char *new_pincode, FAR uint8_t *attemptsleft);
861
862#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
863
891int lte_change_pin(int8_t target_pin, FAR char *pincode,
892 FAR char *new_pincode, change_pin_cb_t callback);
893
894#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
895
941int lte_enter_pin_sync(FAR char *pincode, FAR char *new_pincode,
942 FAR uint8_t *simstat, FAR uint8_t *attemptsleft);
943
944#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
945
972int lte_enter_pin(FAR char *pincode, FAR char *new_pincode,
973 enter_pin_cb_t callback);
974
975#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
976
987
988#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
989
1002int lte_get_localtime(get_localtime_cb_t callback);
1003
1004#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1005
1020#ifdef CONFIG_LTE_LAPI_KEEP_COMPATIBILITY
1021int lte_get_operator_sync(FAR char *oper);
1022#else
1023int lte_get_operator_sync(FAR char *oper, size_t len);
1024#endif
1025
1026#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1027
1040int lte_get_operator(get_operator_cb_t callback);
1041
1042#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1043
1054
1055#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1056
1069int lte_get_edrx(get_edrx_cb_t callback);
1070
1071#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1072
1083
1084#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1085
1100int lte_set_edrx(FAR lte_edrx_setting_t *settings, set_edrx_cb_t callback);
1101
1102#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1103
1114
1115#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1116
1129int lte_get_psm(get_psm_cb_t callback);
1130
1131#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1132
1143
1144#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1145
1160int lte_set_psm(FAR lte_psm_setting_t *settings, set_psm_cb_t callback);
1161
1162#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1163
1174
1175#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1176
1189int lte_get_ce(get_ce_cb_t callback);
1190
1191#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1192
1203
1204#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1205
1220int lte_set_ce(FAR lte_ce_setting_t *settings, set_ce_cb_t callback);
1221
1222#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1223
1238
1253
1274 uint32_t period);
1275
1296 uint32_t period);
1297
1312
1326
1345int lte_get_siminfo_sync(uint32_t option, FAR lte_siminfo_t *siminfo);
1346
1347#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1348
1370int lte_get_siminfo(uint32_t option, get_siminfo_cb_t callback);
1371
1387int lte_get_dynamic_edrx_param(get_dynamic_edrx_param_cb_t callback);
1388
1389#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1390
1407
1408#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1409
1427int lte_get_current_edrx(get_current_edrx_cb_t callback);
1428
1444int lte_get_dynamic_psm_param(get_dynamic_psm_param_cb_t callback);
1445
1446#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1447
1464
1465#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1466
1484int lte_get_current_psm(get_current_psm_cb_t callback);
1485
1486#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1487
1498
1499#ifdef CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API
1500
1513int lte_get_quality(get_quality_cb_t callback);
1514
1515#endif /* CONFIG_LTE_LAPI_ENABLE_DEPRECATED_API */
1516
1530
1541
1558int lte_set_rat_sync(uint8_t rat, bool persistent);
1559
1572
1586
1598
1609
1626int lte_send_atcmd_sync(FAR const char *cmd, int cmdlen,
1627 FAR char *respbuff, int respbufflen,
1628 FAR int *resplen);
1629
1638
1650
1662int lte_hibernation_resume(FAR const uint8_t *res_ctx, int len);
1663
1668#undef EXTERN
1669#ifdef __cplusplus
1670}
1671#endif
1672
1673#endif /* __APPS_INCLUDE_LTE_LTE_API_H */
void(* get_ver_cb_t)(uint32_t result, lte_version_t *version)
Definition: lte.h:1551
void(* get_ce_cb_t)(uint32_t result, lte_ce_setting_t *settings)
Definition: lte.h:1801
void(* set_pinenable_cb_t)(uint32_t result, uint8_t attemptsleft)
Definition: lte.h:1642
void(* get_imei_cb_t)(uint32_t result, char *imei)
Definition: lte.h:1610
void(* get_operator_cb_t)(uint32_t result, char *oper)
Definition: lte.h:1730
void(* radio_on_cb_t)(uint32_t result)
Definition: lte.h:1874
void(* get_dynamic_edrx_param_cb_t)(uint32_t result, lte_edrx_setting_t *param)
Definition: lte.h:2017
void(* localtime_report_cb_t)(lte_localtime_t *localtime)
Definition: lte.h:1841
void(* get_imsi_cb_t)(uint32_t result, uint8_t errcause, char *imsi)
Definition: lte.h:1593
void(* data_allow_cb_t)(uint32_t result)
Definition: lte.h:1963
void(* quality_report_cb_t)(lte_quality_t *quality)
Definition: lte.h:1851
void(* get_imscap_cb_t)(uint32_t result, bool imscap)
Definition: lte.h:1921
void(* activate_pdn_cb_t)(uint32_t result, lte_pdn_t *pdn)
Definition: lte.h:1937
void(* simstat_report_cb_t)(uint32_t simstat)
Definition: lte.h:1831
void(* get_localtime_cb_t)(uint32_t result, lte_localtime_t *localtime)
Definition: lte.h:1712
void(* set_edrx_cb_t)(uint32_t result)
Definition: lte.h:1758
void(* get_quality_cb_t)(uint32_t result, lte_quality_t *quality)
Definition: lte.h:2081
void(* get_edrx_cb_t)(uint32_t result, lte_edrx_setting_t *settings)
Definition: lte.h:1745
void(* netinfo_report_cb_t)(lte_netinfo_t *info)
Definition: lte.h:1987
void(* restart_report_cb_t)(uint32_t reason)
Definition: lte.h:1976
void(* get_phoneno_cb_t)(uint32_t result, uint8_t errcause, char *phoneno)
Definition: lte.h:1572
void(* radio_off_cb_t)(uint32_t result)
Definition: lte.h:1887
void(* deactivate_pdn_cb_t)(uint32_t result)
Definition: lte.h:1950
void(* set_ce_cb_t)(uint32_t result)
Definition: lte.h:1814
void(* get_current_edrx_cb_t)(uint32_t result, lte_edrx_setting_t *settings)
Definition: lte.h:2049
void(* set_psm_cb_t)(uint32_t result)
Definition: lte.h:1786
void(* get_netinfo_cb_t)(uint32_t result, lte_netinfo_t *info)
Definition: lte.h:1903
void(* get_siminfo_cb_t)(uint32_t result, lte_siminfo_t *siminfo)
Definition: lte.h:2002
void(* context_save_cb_t)(uint8_t *data, int size)
Definition: lte.h:2094
void(* change_pin_cb_t)(uint32_t result, uint8_t attemptsleft)
Definition: lte.h:1658
void(* get_dynamic_psm_param_cb_t)(uint32_t result, lte_psm_setting_t *param)
Definition: lte.h:2033
void(* get_psm_cb_t)(uint32_t result, lte_psm_setting_t *settings)
Definition: lte.h:1773
void(* get_pinset_cb_t)(uint32_t result, lte_getpin_t *pinset)
Definition: lte.h:1626
void(* get_current_psm_cb_t)(uint32_t result, lte_psm_setting_t *settings)
Definition: lte.h:2065
void(* cellinfo_report_cb_t)(lte_cellinfo_t *cellinfo)
Definition: lte.h:1861
void(* enter_pin_cb_t)(uint32_t result, uint8_t simstat, uint8_t attemptsleft)
Definition: lte.h:1695
int lte_set_report_localtime(localtime_report_cb_t localtime_callback)
int lte_get_ce_sync(FAR lte_ce_setting_t *settings)
int lte_activate_pdn_sync(FAR lte_apn_setting_t *apn, FAR lte_pdn_t *pdn)
int lte_set_report_netinfo(netinfo_report_cb_t netinfo_callback)
int lte_get_current_edrx_sync(FAR lte_edrx_setting_t *settings)
int lte_set_report_restart(restart_report_cb_t restart_callback)
int lte_power_off(void)
int lte_set_context_save_cb(context_save_cb_t callback)
int lte_get_cellinfo_sync(FAR lte_cellinfo_t *cellinfo)
int lte_set_edrx_sync(FAR lte_edrx_setting_t *settings)
int lte_activate_pdn(FAR lte_apn_setting_t *apn, activate_pdn_cb_t callback)
int lte_radio_off_sync(void)
int lte_set_pinenable_sync(bool enable, FAR char *pincode, FAR uint8_t *attemptsleft)
int lte_hibernation_resume(FAR const uint8_t *res_ctx, int len)
int lte_get_current_psm_sync(FAR lte_psm_setting_t *settings)
int lte_enter_pin_sync(FAR char *pincode, FAR char *new_pincode, FAR uint8_t *simstat, FAR uint8_t *attemptsleft)
int lte_data_allow_sync(uint8_t session_id, uint8_t allow, uint8_t roaming_allow)
int lte_get_errinfo(FAR lte_errinfo_t *info)
int lte_set_rat_sync(uint8_t rat, bool persistent)
Set RAT setting.
int lte_get_psm_sync(FAR lte_psm_setting_t *settings)
int lte_finalize(void)
int lte_set_ce_sync(FAR lte_ce_setting_t *settings)
int lte_get_rat_sync(void)
Get RAT type.
int lte_activate_pdn_cancel(void)
int lte_get_pinset_sync(FAR lte_getpin_t *pinset)
int lte_set_psm_sync(FAR lte_psm_setting_t *settings)
int lte_get_imei_sync(FAR char *imei, size_t len)
int lte_get_operator_sync(FAR char *oper, size_t len)
int lte_factory_reset_sync(void)
int lte_send_atcmd_sync(FAR const char *cmd, int cmdlen, FAR char *respbuff, int respbufflen, FAR int *resplen)
Send AT command to the modem.
int lte_set_report_quality(quality_report_cb_t quality_callback, uint32_t period)
int lte_acquire_wakelock(void)
int lte_get_version_sync(FAR lte_version_t *version)
int lte_set_report_cellinfo(cellinfo_report_cb_t cellinfo_callback, uint32_t period)
int lte_get_localtime_sync(FAR lte_localtime_t *localtime)
int lte_get_netinfo_sync(uint8_t pdn_num, FAR lte_netinfo_t *info)
int lte_get_imscap_sync(FAR bool *imscap)
int lte_initialize(void)
int lte_get_siminfo_sync(uint32_t option, FAR lte_siminfo_t *siminfo)
int lte_set_report_simstat(simstat_report_cb_t simstat_callback)
int lte_deactivate_pdn_sync(uint8_t session_id)
int lte_get_phoneno_sync(FAR char *phoneno, size_t len)
int lte_get_quality_sync(FAR lte_quality_t *quality)
int lte_get_ratinfo_sync(FAR lte_ratinfo_t *info)
Get RAT information.
int lte_power_on(void)
int lte_change_pin_sync(int8_t target_pin, FAR char *pincode, FAR char *new_pincode, FAR uint8_t *attemptsleft)
int lte_get_wakelock_count(void)
int lte_radio_on_sync(void)
int lte_release_wakelock(void)
int lte_get_edrx_sync(FAR lte_edrx_setting_t *settings)
int lte_get_imsi_sync(FAR char *imsi, size_t len)
Definition: lte.h:1083
Definition: lte.h:1369
Definition: lte.h:827
Definition: lte.h:947
Definition: lte.h:1336
Definition: lte.h:678
Definition: lte.h:718
Definition: lte.h:1288
Definition: lte.h:1164
Definition: lte.h:1055
Definition: lte.h:740
Definition: lte.h:1484
Definition: lte.h:1394
Definition: lte.h:653