| /*
|
| *
|
| * Data : 2022/10/20 11:24:09
|
| * Author : LiuBin
|
| */
|
| #ifndef _MBTK_INFO_API_H
|
| #define _MBTK_INFO_API_H
|
| #include <netinet/in.h>
|
|
|
| #include "mbtk_type.h"
|
| #include "mbtk_list.h"
|
| #include "mbtk_log.h"
|
| #include "mbtk_utils.h"
|
| #include "mbtk_pdu_sms.h"
|
|
|
| #ifndef UNUSED
|
| #define UNUSED(a) (void)(a)
|
| #endif
|
|
|
| // LOG_DEBUG_LEVEL 7
|
| #define LOG LOGI
|
|
|
| #define RIL_MAX_NUMBER_LEN 40
|
| #define MBTK_ECALL_MSD_LEN_MAX 600
|
|
|
| #define CELL_NUM_MAX 50
|
| #define APN_STR_MAX 128
|
| #if (defined(MBTK_AF_SUPPORT) || defined(MBTK_ALL_CID_SUPPORT))
|
| #define MBTK_APN_CID_MIN 1
|
| #else
|
| // 2 - 7
|
| #define MBTK_APN_CID_MIN 2
|
| #endif
|
| #define MBTK_APN_CID_MAX 7
|
| #define MBTK_DATA_CALL_TIMEOUT_DEFAULT 10 // 10s
|
|
|
| #define MBTK_APN_NAME_SIZE 150+1
|
| #define MBTK_APN_USERNAME_SIZE 127+1
|
| #define MBTK_APN_PASSWORD_SIZE 127+1
|
| #define MBTK_APN_TYPE_SIZE 127+1
|
|
|
|
|
|
|
| typedef void (*mbtk_info_callback_func)(const void* data, int data_len);
|
|
|
| typedef enum {
|
| MBTK_TIME_TYPE_CELL = 0,
|
| MBTK_TIME_TYPE_NTP,
|
| MBTK_TIME_TYPE_USER
|
| } mbtk_time_type_enum;
|
|
|
| typedef enum {
|
| MBTK_ACTIVE,
|
| MBTK_HELD,
|
| MBTK_DIALING,
|
| MBTK_ALERTING,
|
| MBTK_INCOMING,
|
| MBTK_WAITING,
|
| MBTK_OFFERING,
|
| } mbtk_call_stat_enum;
|
|
|
| typedef enum { |
| MBTK_ECALL_CFG_ITEM_T3 = 0, // ms
|
| MBTK_ECALL_CFG_ITEM_T5, // ms
|
| MBTK_ECALL_CFG_ITEM_T6, // ms
|
| MBTK_ECALL_CFG_ITEM_T7, // ms
|
| MBTK_ECALL_CFG_ITEM_TH, // ms
|
| MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK, // T9 // 5
|
| MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN, // T2 |
| MBTK_ECALL_CFG_ITEM_TIMER_DEREG, // T10 |
| MBTK_ECALL_CFG_ITEM_TIMER_DIAL, // "dial" |
| MBTK_ECALL_CFG_ITEM_TIMER_REDIAL, // "redialtmr" |
| MBTK_ECALL_CFG_ITEM_TIMER_SMS, // "sms" // 10
|
| MBTK_ECALL_CFG_ITEM_REDIALCNT, // "redialcnt" |
| MBTK_ECALL_CFG_ITEM_SMSPROCESS, // "smsprocess" |
| MBTK_ECALL_CFG_ITEM_SMSMSDCNT, // "smsmsdcnt"
|
|
|
| MBTK_ECALL_CFG_ITEM_MAX
|
| } mbtk_ecall_cfg_item_enum;
|
|
|
| #define MBTK_ECALL_CFG_T3 (1 << MBTK_ECALL_CFG_ITEM_T3) // ms
|
| #define MBTK_ECALL_CFG_T5 (1 << MBTK_ECALL_CFG_ITEM_T5) // ms
|
| #define MBTK_ECALL_CFG_T6 (1 << MBTK_ECALL_CFG_ITEM_T6) // ms
|
| #define MBTK_ECALL_CFG_T7 (1 << MBTK_ECALL_CFG_ITEM_T7) // ms
|
| #define MBTK_ECALL_CFG_TH (1 << MBTK_ECALL_CFG_ITEM_TH) // ms
|
| #define MBTK_ECALL_CFG_TIMER_CALLBACK (1 << MBTK_ECALL_CFG_ITEM_TIMER_CALLBACK) // T9
|
| #define MBTK_ECALL_CFG_TIMER_CLEARDOWN (1 << MBTK_ECALL_CFG_ITEM_TIMER_CLEARDOWN) // T2
|
| #define MBTK_ECALL_CFG_TIMER_DEREG (1 << MBTK_ECALL_CFG_ITEM_TIMER_DEREG) // T10
|
| #define MBTK_ECALL_CFG_TIMER_DIAL (1 << MBTK_ECALL_CFG_ITEM_TIMER_DIAL) // "dial"
|
| #define MBTK_ECALL_CFG_TIMER_REDIAL (1 << MBTK_ECALL_CFG_ITEM_TIMER_REDIAL) // "redialtmr"
|
| #define MBTK_ECALL_CFG_TIMER_SMS (1 << MBTK_ECALL_CFG_ITEM_TIMER_SMS) // "sms" // 10
|
| #define MBTK_ECALL_CFG_REDIALCNT (1 << MBTK_ECALL_CFG_ITEM_REDIALCNT) // "redialcnt"
|
| #define MBTK_ECALL_CFG_SMSPROCESS (1 << MBTK_ECALL_CFG_ITEM_SMSPROCESS) // "smsprocess"
|
| #define MBTK_ECALL_CFG_SMSMSDCNT (1 << MBTK_ECALL_CFG_ITEM_SMSMSDCNT) // "smsmsdcnt"
|
|
|
| #define MBTK_VOICE_END_REASON_UNKNOWN "0 "
|
| #define MBTK_VOICE_END_REASON_UNASSIGNED_NUMBER "1 "
|
| #define MBTK_VOICE_END_REASON_NO_ROUTE_DES "3 "
|
| #define MBTK_VOICE_END_REASON_CHANNEL_UNACCEPTABLE "6 "
|
| #define MBTK_VOICE_END_REASON_OPERATOR_DETERMINED_BARRING "8 "
|
| #define MBTK_VOICE_END_REASON_NORMAL_CALL_CLEARING "16 "
|
| #define MBTK_VOICE_END_REASON_USER_BUSY "17 "
|
| #define MBTK_VOICE_END_REASON_NO_USER_RESPONDING "18 "
|
| #define MBTK_VOICE_END_REASON_USER_ALERTING_NO_ANSWER "19 "
|
| #define MBTK_VOICE_END_REASON_CALL_REJECTED "21 "
|
| #define MBTK_VOICE_END_REASON_NUMBER_CHANGED "22 "
|
| #define MBTK_VOICE_END_REASON_PREEMPTION "25 "
|
| #define MBTK_VOICE_END_REASON_NON_SELECTED_USER_CLEARING "26 "
|
| #define MBTK_VOICE_END_REASON_DESTINATION_OUT_OF_ORDER "27 "
|
| #define MBTK_VOICE_END_REASON_INVALID_NUMBER_FORMAT "28 "
|
| #define MBTK_VOICE_END_REASON_FACILITY_REJECTED "29 "
|
| #define MBTK_VOICE_END_REASON_STATUS_ENQUIRY "30 "
|
| #define MBTK_VOICE_END_REASON_NORMAL_UNSPECIFIED "31 "
|
| #define MBTK_VOICE_END_REASON_NO_CIRCUIT_AVAILABLE "34 "
|
| #define MBTK_VOICE_END_REASON_NETWORK_OUT_OF_ORDER "38 "
|
| #define MBTK_VOICE_END_REASON_TEMPORARY_FAILURE "41 "
|
| #define MBTK_VOICE_END_REASON_SWITCHING_EQUIPMENT_CONGESTION "42 "
|
| #define MBTK_VOICE_END_REASON_ACCESS_INFORMATION_DISCARDED "43 "
|
| #define MBTK_VOICE_END_REASON_REQUESTED_CIRCUIT_UNAVAILABLE "44 "
|
| #define MBTK_VOICE_END_REASON_RESOURCE_UNAVAILABLE "47 "
|
| #define MBTK_VOICE_END_REASON_QOS_UNAVAILABLE "49 "
|
| #define MBTK_VOICE_END_REASON_REQUESTED_FACILITY_NOT_SUBSCRIBED "50 "
|
| #define MBTK_VOICE_END_REASON_INCOMING_CALLS_BARRED_WITHIN_CUG "55 "
|
| #define MBTK_VOICE_END_REASON_BEARER_CAPABILITY_NOT_AUTHORIZED "57 "
|
| #define MBTK_VOICE_END_REASON_BEARER_CAPABILITY_NOT_AVAILABLE "58 "
|
| #define MBTK_VOICE_END_REASON_SERVICE_NOT_AVAILABLE "63 "
|
| #define MBTK_VOICE_END_REASON_BEARER_SERVICE_NOT_IMPLEMENTED "65 "
|
| #define MBTK_VOICE_END_REASON_ACM_MAX_REACHED "68 "
|
| #define MBTK_VOICE_END_REASON_FACILITY_NOT_IMPLEMENTED "69 "
|
| #define MBTK_VOICE_END_REASON_ONLY_RDI_BEARER_CAPABILITY_AVAILABLE "70 "
|
| #define MBTK_VOICE_END_REASON_SERVICE_NOT_IMPLEMENTED "79 "
|
| #define MBTK_VOICE_END_REASON_INVALID_TRANSACTION_ID "81 "
|
| #define MBTK_VOICE_END_REASON_USER_NOT_MEMBER_OF_CUG "87 "
|
| #define MBTK_VOICE_END_REASON_INCOMPATIBLE_DESTINATION "88 "
|
| #define MBTK_VOICE_END_REASON_INVALID_TRANSIT_NETWORK_SELECTION "91 "
|
| #define MBTK_VOICE_END_REASON_INCORRECT_MESSAGE "95 "
|
| #define MBTK_VOICE_END_REASON_INVALID_MANDATORY_INFORMATION "96 "
|
| #define MBTK_VOICE_END_REASON_MESSAGE_TYPE_NON_EXISTENT "97 "
|
| #define MBTK_VOICE_END_REASON_MESSAGE_TYPE_WRONG_STATE "98 "
|
| #define MBTK_VOICE_END_REASON_INFORMATION_ELEMENT_NOT_EXISTENT "99 "
|
| #define MBTK_VOICE_END_REASON_CONDITIONAL_IE_ERROR "100 "
|
| #define MBTK_VOICE_END_REASON_MESSAGE_WRONG_STATE "101 "
|
| #define MBTK_VOICE_END_REASON_RECOVERY_AFTER_TIMER_EXPIRY "102 "
|
| #define MBTK_VOICE_END_REASON_PROTOCOL_ERROR_UNSPECIFIED "111 "
|
| #define MBTK_VOICE_END_REASON_INERWORKING_UNSPECIFIED "127 "
|
| #define MBTK_VOICE_END_REASON_CALL_BARRING "224 "
|
| #define MBTK_VOICE_END_REASON_FDN_BLOCKED "241 "
|
| #define MBTK_VOICE_END_REASON_END "end"
|
|
|
|
|
|
|
| /*
|
| 0 : GSM only
|
| 1 : UMTS only
|
| 2 : GSM/UMTS(auto)
|
| 3 : GSM/UMTS(GSM preferred)
|
| 4 : GSM/UMTS(UMTS preferred)
|
| 5 : LTE only
|
| 6 : GSM/LTE(auto)
|
| 7 : GSM/LTE(GSM preferred)
|
| 8 : GSM/LTE(LTE preferred)
|
| 9 : UMTS/LTE(auto)
|
| 10 : UMTS/LTE(UMTS preferred)
|
| 11 : UMTS/LTE(LTE preferred)
|
| 12 : GSM/UMTS/LTE(auto)
|
| 13 : GSM/UMTS/LTE(GSM preferred)
|
| 14 : GSM/UMTS/LTE(UMTS preferred)
|
| 15 : GSM/UMTS/LTE(LTE preferred)
|
| */
|
| typedef enum
|
| {
|
| MBTK_NET_PREF_GSM_ONLY = 0,
|
| MBTK_NET_PREF_UMTS_ONLY,
|
| MBTK_NET_PREF_GSM_UMTS_AUTO,
|
| MBTK_NET_PREF_GSM_UMTS_GSM_PREF,
|
| MBTK_NET_PREF_GSM_UMTS_UMTS_PREF,
|
| MBTK_NET_PREF_LTE_ONLY,
|
| MBTK_NET_PREF_GSM_LTE_AUTO,
|
| MBTK_NET_PREF_GSM_LTE_GSM_PREF,
|
| MBTK_NET_PREF_GSM_LTE_LTE_PREF,
|
| MBTK_NET_PREF_UMTS_LTE_AUTO,
|
| MBTK_NET_PREF_UMTS_LTE_UMTS_PREF,
|
| MBTK_NET_PREF_UMTS_LTE_LTE_PREF,
|
| MBTK_NET_PREF_GSM_UMTS_LTE_AUTO,
|
| MBTK_NET_PREF_GSM_UMTS_LTE_GSM_PREF,
|
| MBTK_NET_PREF_GSM_UMTS_LTE_UMTS_PREF,
|
| MBTK_NET_PREF_GSM_UMTS_LTE_LTE_PREF
|
| } mbtk_net_pref_enum;
|
|
|
| typedef enum
|
| {
|
| MBTK_CELL_TYPE_GSM = 0,
|
| MBTK_CELL_TYPE_UMTS,
|
| MBTK_CELL_TYPE_LTE
|
| } mbtk_cell_type_enum;
|
|
|
| /*
|
| 0 : Plmm long character format
|
| 1 : Plmn Short character format
|
| 2 : Plmn number format
|
| */
|
| typedef enum
|
| {
|
| MBTK_NET_OPERA_FORMAT_LONG_CHAR = 0,
|
| MBTK_NET_OPERA_FORMAT_SHORT_CHAR,
|
| MBTK_NET_OPERA_FORMAT_NUMBER,
|
| } mbtk_net_opera_format_enum;
|
|
|
| /*
|
| 0 : Automatic registration
|
| 1 : Manual registration
|
| 2 : Forced cancellation
|
| 3 : Set format only
|
| 4 : Manual registration is performed first, and automatic registration fails
|
| */
|
| typedef enum
|
| {
|
| MBTK_NET_OPERA_REG_MODE_AUTO = 0,
|
| MBTK_NET_OPERA_REG_MODE_MANUAL,
|
| MBTK_NET_OPERA_REG_MODE_LOGOUT,
|
| MBTK_NET_OPERA_REG_MODE_SET_FORMAT,
|
| MBTK_NET_OPERA_REG_MODE_MANUAL_AUTO,
|
| } mbtk_net_opera_reg_mode_enum;
|
|
|
| typedef struct
|
| {
|
| int client_fd;
|
| pthread_t read_thread_id;
|
| int exit_fd[2];
|
| bool is_waitting;
|
| pthread_cond_t cond;
|
| pthread_mutex_t mutex;
|
|
|
| pthread_mutex_t send_mutex;
|
|
|
| // Temp response data.
|
| uint16 info_err;
|
| uint16 data_len;
|
| void *data;
|
|
|
| //mbtk wyq for server_ready_status add start
|
| char server_ready_status;
|
| //mbtk wyq for server_ready_status add end
|
|
|
| mbtk_info_callback_func net_state_cb;
|
| mbtk_info_callback_func call_state_cb;
|
| mbtk_info_callback_func sms_state_cb;
|
| mbtk_info_callback_func radio_state_cb;
|
| mbtk_info_callback_func sim_state_cb;
|
| mbtk_info_callback_func pdp_state_cb;
|
| //add signal by xr
|
| mbtk_info_callback_func signal_state_cb;
|
|
|
| mbtk_info_callback_func ecall_state_cb;
|
| } mbtk_info_handle_t;
|
|
|
| typedef struct
|
| {
|
| /*
|
| 0: automatic
|
| 1: manual
|
| */
|
| uint8 net_sel_mode;
|
| /*
|
| 0: GSM
|
| 1: GSM Compact
|
| 2: UTRAN
|
| 3: GSM w/EGPRS
|
| 4: UTRAN w/HSDPA
|
| 5: UTRAN w/HSUPA
|
| 6: UTRAN w/HSDPA and HSUPA
|
| 7: E-UTRAN
|
| 8: UTRAN HSPA+
|
| 0xFF: Unused
|
| */
|
| uint8 net_type;
|
| //uint8 plmn[10]; // 46000
|
| /*
|
| 0: unknown
|
| 1: available
|
| 2: current
|
| 3: forbidden
|
| */
|
| uint8 net_state;
|
| uint32 plmn;
|
| } __attribute__((packed)) mbtk_net_info_t;
|
|
|
| typedef struct
|
| {
|
| uint8 net_pref; // mbtk_net_pref_enum
|
| uint16 gsm_band; // mbtk_gsm_band_enum
|
| uint16 umts_band; // mbtk_umts_band_enum
|
| uint32 tdlte_band; // mbtk_tdlte_band_enum
|
| uint32 fddlte_band; // mbtk_fddlte_band_enum
|
| uint32 lte_ext_band; // mbtk_lte_ext_band_enum
|
| } __attribute__((packed)) mbtk_band_info_t;
|
|
|
| typedef struct
|
| {
|
| uint8 type; // mbtk_radio_technology_enum
|
| uint8 rssi; // 0: 113 dBm or less
|
| // 1: 111 dBm
|
| // 2��30: 109��53 dBm
|
| // 31: 51 dBm or greater
|
| // 99: not known or not detectable
|
| uint8 rxlev;// 0:rssi < -110 dBm
|
| // 1: -110 dBm �� rssi < -109 dBm
|
| // 2: -109 dBm �� rssi < -108 dBm
|
| // ......
|
| // 61: -50 dBm �� rssi < -49 dBm
|
| // 62: -49 dBm �� rssi < -48 dBm
|
| // 63: -48 dBm �� rssi
|
| // 99: not known or not detectable
|
| uint8 ber; // 0...7 as RXQUAL values in the table in 3GPP TS 45.008 [20] subclause 8.2.4
|
| // 99 not known or not detectable
|
| uint8 rscp; // 0: rscp < -120 dBm
|
| // 1: -120 dBm �� rscp < -119 dBm
|
| // 2: -119 dBm �� rscp < -118 dBm
|
| // ......
|
| // 94: -27 dBm �� rscp < -26 dBm
|
| // 95: -26 dBm �� rscp < -25 dBm
|
| // 96: - 25 dBm �� rscp
|
| // 255: not known or not detectable
|
| uint8 ecno; // 0: Ec/Io < -24 dB
|
| // 1: -24 dB �� Ec/Io < -23.5 dB
|
| // 2: -23.5 dB �� Ec/Io < -23 dB
|
| // ......
|
| // 47: -1 dB �� Ec/Io < -0.5 dB
|
| // 48: -0.5 dB �� Ec/Io < 0 dB
|
| // 49: 0 dB �� Ec/Io
|
| // 255: not known or not detectable
|
| uint8 rsrq; // 0: rsrq < -19.5 dB
|
| // 1: -19.5 dB �� rsrq < -19 dB
|
| // 2: -19 dB �� rsrq < -18.5 dB
|
| // ......
|
| // 32: -4 dB �� rsrq < -3.5 dB
|
| // 33: -3.5 dB �� rsrq < -3 dB
|
| // 34: -3 dB �� rsrq
|
| // 255: not known or not detectable
|
| uint8 rsrp; // 0: rsrp < -140 dBm
|
| // 1: -140 dBm �� rsrp < -139 dBm
|
| // 2: -139 dBm �� rsrp < -138 dBm
|
| // ......
|
| // 95: -46 dBm �� rsrp < -45 dBm
|
| // 96: -45 dBm �� rsrp < -44 dBm
|
| // 97: -44 dBm �� rsrp
|
| // 255: not known or not detectable
|
| int8 sinr; //-20-35 dbm
|
| } __attribute__((packed)) mbtk_signal_info_t;
|
|
|
| typedef struct
|
| {
|
| uint8 call_state;// mbtk_net_reg_state_enum
|
| uint8 data_state;// mbtk_net_reg_state_enum
|
| uint8 ims_state;// mbtk_net_reg_state_enum
|
| uint8 type; // mbtk_radio_technology_enum
|
| uint16 lac;
|
| uint32 ci;
|
| } __attribute__((packed)) mbtk_net_reg_info_t;
|
|
|
| typedef struct
|
| {
|
| uint8 call_wait;
|
| uint8 dir1;
|
| uint8 dir;
|
| uint8 state;
|
| uint8 mode;
|
| uint8 mpty;
|
| char phone_number[100];
|
| uint8 type;
|
| uint8 pas;
|
| uint8 disconnected_id;
|
| uint8 end_reason[128];
|
| } __attribute__((packed)) mbtk_call_info_t;
|
|
|
| typedef struct
|
| {
|
| char character;
|
| uint32 duration;
|
| } __attribute__((packed)) mbtk_call_dtmf_info_t;
|
|
|
| typedef enum {
|
| MBTK_SIM_ABSENT = 0,
|
| MBTK_SIM_NOT_READY = 1,
|
| MBTK_SIM_READY = 2,
|
| MBTK_SIM_PIN = 3,
|
| MBTK_SIM_PUK = 4,
|
| MBTK_SIM_NETWORK_PERSONALIZATION = 5
|
| } mbtk_sim_state_enum;
|
|
|
| typedef enum {
|
| MBTK_PIN_DISABLE = 0,
|
| MBTK_PIN_ENABLE = 1,
|
| }mbtk_pin_state_enum;
|
|
|
| typedef enum {
|
| MBTK_IP_TYPE_IP,
|
| MBTK_IP_TYPE_IPV6,
|
| MBTK_IP_TYPE_IPV4V6,
|
| MBTK_IP_TYPE_PPP
|
| } mbtk_ip_type_enum;
|
|
|
| typedef enum
|
| {
|
| MBTK_NET_TYPE_UNKNOWN,
|
| MBTK_NET_TYPE_GSM,
|
| MBTK_NET_TYPE_UMTS,
|
| MBTK_NET_TYPE_LTE
|
| } mbtk_net_type_enum;
|
|
|
| typedef enum {
|
| MBTK_CLCC = 1,
|
| MBTK_CPAS,
|
| MBTK_DISCONNECTED,
|
| } mbtk_call_enum;
|
|
|
| typedef struct
|
| {
|
| // NR server cell:
|
| // NR cell:
|
| // LTE server cell: tac, PCI, dlEuarfcn, ulEuarfcn, band
|
| // LTE cell: phyCellId,euArfcn,rsrp,rsrq
|
| // WCDMA server cell: lac, ci, arfcn
|
| // WCDMA cell: lac, ci, arfcn
|
| // GSM server cell: lac, ci, arfcn, bsic
|
| // GSM cell:
|
| uint32 value1; //tac
|
| uint32 value2; //pci
|
| uint32 value3; //dlEuarfcn
|
| uint32 value4; //bler
|
| uint32 value5; //band
|
| uint32 value6; //mcc
|
| uint32 value7; //mnc
|
| uint32 value8; //rsrp
|
| uint32 value9; //rsrq
|
| uint32 value10; //cell identiy
|
| uint32 value11; //sinr
|
| uint32 value12; //is tdd
|
| uint32 value13;
|
| uint32 value14;
|
| uint32 value15;
|
| } __attribute__((packed)) mbtk_cell_info_t;
|
|
|
|
|
|
|
| typedef enum {
|
| MBTK_CALL_RADY, //MT allows commands from TA/TE
|
| MBTK_CALL_UNAVAILABLE, //MT does not allow commands from TA/TE
|
| MBTK_CALL_UNKNOWN, //MT is not guaranteed to respond to instructions
|
| MBTK_CALL_RINGING, //MT is ready for commands from TA/TE, but the ringer is active
|
| MBTK_CALL_PROGRESS, //MT is ready for commands from TA/TE, but a call is in progress
|
| MBTK_CALL_ASLEEP, //MT is unable to process commands from TA/TE because it is in a low functionality state
|
| MBTK_CALL_ACTIVE,
|
| } mbtk_call_pas_enum;
|
|
|
| typedef enum {
|
| MBTK_RADIO_STATE_UNKNOWN,
|
| MBTK_RADIO_STATE_ON,
|
| MBTK_RADIO_STATE_OFF
|
| } mbtk_radio_state_enum;
|
|
|
| typedef enum {
|
| MBTK_DATA_CALL_STOP = 0, // Stop data call.
|
| MBTK_DATA_CALL_START, // Start data call.
|
| MBTK_DATA_CALL_STATE // Get data call state
|
| } mbtk_data_call_type_enum;
|
| /*
|
| 0: not registered, MT is not currently searching a new operator to register to
|
| 1: registered, home network
|
| 2: not registered, but MT is currently searching a new operator to register to
|
| 3: registration denied
|
| 4: unknown
|
| 5: registered, roaming
|
| 6: registered, home network, SMS-only (applicable only when AcT is E-UTRAN)
|
| 7: registered, roaming, SMS-only (applicable only when AcT is E-UTRAN)
|
| 8: attached for emergency bearer services only (not applicable)
|
| 9: registered for ��CSFB not preferred��,home network(applicable only when AcT is E-UTRAN)
|
| 10: registered for ��CSFB not preferred��,roaming(applicable only when AcT is E-UTRAN)
|
| 11: only emergency services are available
|
| */
|
| typedef enum
|
| {
|
| MBTK_NET_REG_STATE_NON = 0,
|
| MBTK_NET_REG_STATE_HOME,
|
| MBTK_NET_REG_STATE_SEARCHING,
|
| MBTK_NET_REG_STATE_DENIED,
|
| MBTK_NET_REG_STATE_UNKNOWN,
|
| MBTK_NET_REG_STATE_ROAMING,
|
| MBTK_NET_REG_STATE_SMS_ONLY,
|
| MBTK_NET_REG_STATE_ROAMING_SMS,
|
| MBTK_NET_REG_STATE_ATTACHED_EMERGENCY,
|
| MBTK_NET_REG_STATE_CSFB_HOME,
|
| MBTK_NET_REG_STATE_CSFB_ROAMING,
|
| MBTK_NET_REG_STATE_EMERGENCY_ONLY
|
| } mbtk_net_reg_state_enum;
|
|
|
| typedef struct {
|
| int cid; // 2 - 7
|
| mbtk_ip_type_enum ip_type; // mbtk_ip_type_enum
|
| uint8 apn[APN_STR_MAX];
|
| uint8 user[APN_STR_MAX];
|
| uint8 pass[APN_STR_MAX];
|
| uint8 auth[APN_STR_MAX];
|
| } mbtk_apn_info_t;
|
|
|
| typedef struct {
|
| bool valid;
|
| uint32 IPAddr;
|
| uint32 PrimaryDNS;
|
| uint32 SecondaryDNS;
|
| uint32 GateWay;
|
| uint32 NetMask;
|
| } __attribute__((packed)) mbtk_ipv4_info_t;
|
|
|
| typedef struct {
|
| bool valid;
|
| uint32 IPV6Addr[4];
|
| uint32 PrimaryDNS[4];
|
| uint32 SecondaryDNS[4];
|
| uint32 GateWay[4];
|
| uint32 NetMask[4];
|
| } __attribute__((packed)) mbtk_ipv6_info_t;
|
|
|
| typedef struct {
|
| uint8 state; // Must be placed at the forefront.
|
|
|
| mbtk_ipv4_info_t ipv4;
|
| mbtk_ipv6_info_t ipv6;
|
| } __attribute__((packed)) mbtk_pdp_act_info_t;
|
|
|
| typedef enum
|
| {
|
| MBTK_DEV_MODEM_MIN_FUN, //Modem 最小功能
|
| MBTK_DEV_MODEM_FULL_FUN, //Modem 全功能
|
| MBTK_DEV_MODEM_DISABLE_RECEIVE_RF_CIRCUITS = 3, //Modem 禁用射频接收电路
|
| MBTK_DEV_MODEM_DISABLE_TRANSMIT_AND_RECEIVE_RF_CIRCUITS, //Modem禁用射频发射和接收电路
|
| MBTK_DEV_MODEM_DISABLE_SIM, //Modem 禁用(U)SIM 卡
|
| MBTK_DEV_MODEM_TURN_OFF_FULL_SECONDARY_RECEIVE, //Modem 完全禁用辅助接收
|
| }MBTK_DEV_MODEM_FUNCTION;
|
|
|
| /*
|
| 0: GSM
|
| 1: GSM Compact
|
| 2: UTRAN
|
| 3: GSM w/EGPRS
|
| 4: UTRAN w/HSDPA
|
| 5: UTRAN w/HSUPA
|
| 6: UTRAN w/HSDPA and HSUPA
|
| 7: E-UTRAN
|
| 8: UTRAN HSPA+
|
| */
|
| typedef enum {
|
| MBTK_RADIO_TECH_GSM = 0,
|
| MBTK_RADIO_TECH_GSM_COMPACT,
|
| MBTK_RADIO_TECH_UTRAN,
|
| MBTK_RADIO_TECH_GSM_EGPRS,
|
| MBTK_RADIO_TECH_UTRAN_HSDPA,
|
| MBTK_RADIO_TECH_UTRAN_HSUPA,
|
| MBTK_RADIO_TECH_UTRAN_HSDPA_HSUPA,
|
| MBTK_RADIO_TECH_E_UTRAN, // LTE
|
| MBTK_RADIO_TECH_UTRAN_HSPA
|
| } mbtk_radio_technology_enum;
|
|
|
| typedef struct
|
| {
|
| MBTK_DEV_MODEM_FUNCTION fun;
|
| int rst;
|
| } mbtk_modem_info_t;
|
|
|
| typedef enum {
|
| MBTK_SIM = 0,
|
| MBTK_USIM = 1,
|
| MBTK_TEST_SIM = 2,
|
| MBTK_TEST_USIM = 3,
|
| MBTK_UNKNOWN = 4,
|
| } mbtk_sim_card_type_enum;
|
|
|
| typedef struct
|
| {
|
| uint8_t p1_retry;
|
| uint8_t p2_retry;
|
| uint8_t puk1_retry;
|
| uint8_t puk2_retry;
|
| } mbtk_pin_puk_last_times;
|
|
|
| typedef struct
|
| {
|
| uint8_t format;
|
| char plmn_name[16];
|
| }MBTK_SIM_PLMN_INFO_C; //string type
|
|
|
|
|
| typedef struct
|
| {
|
| uint8_t count;
|
| uint8_t format;
|
| MBTK_SIM_PLMN_INFO_C mbtk_plmn_name[24];
|
| } mbtk_plmn_info;
|
|
|
| typedef struct
|
| {
|
| uint8_t old_pin_value[16];
|
| uint8_t new_pin_value[16];
|
| } mbtk_change_pin_info;
|
|
|
| typedef struct
|
| {
|
| uint8_t pin_value[16];
|
| uint8_t puk_value[16];
|
| } mbtk_unlock_pin_info;
|
|
|
| typedef struct
|
| {
|
| uint8_t pin_value[16];
|
| uint8_t enable;
|
| } mbtk_enable_pin_info;
|
|
|
| typedef struct
|
| {
|
| int sim;
|
| int sim_card_type;
|
| mbtk_pin_puk_last_times ql_last_times;
|
| } mbtk_sim_card_info;
|
|
|
|
|
| typedef struct{
|
| uint8_t mode;
|
| uint32_t oosPhase[3]; //单位为秒
|
| } mbtk_oos_info;
|
|
|
| typedef struct
|
| {
|
| int8 ther;
|
| } mbtk_thermal_info_t;
|
|
|
| /**************led enum*********/
|
| typedef enum
|
| {
|
| MBTK_LED_TYPE_NET, //set net_led
|
| MBTK_LED_TYPE_STATUS //set status_led
|
| }mbtk_led_type;
|
|
|
| typedef enum
|
| {
|
| MBTK_LED_STATUS_CLOSE, //close led
|
| MBTK_LED_STATUS_OPEN //open led
|
| }mbtk_led_status;
|
| /**************led enum*********/
|
|
|
| /**************qser data_call*****************/
|
| typedef enum {
|
| MBTK_APN_REQ_TYPE_SET = 0, // set apn req
|
| MBTK_APN_REQ_TYPE_ADD // add apn req
|
| }mbtk_apn_req_type_enum;
|
|
|
| typedef enum {
|
| MBTK_APN_AUTH_PROTO_DEFAULT = 0,
|
| MBTK_APN_AUTH_PROTO_NONE,
|
| MBTK_APN_AUTH_PROTO_PAP,
|
| MBTK_APN_AUTH_PROTO_CHAP,
|
| #if 0
|
| MBTK_APN_AUTH_PROTO_PAP_CHAP,
|
| //NOT SUPPORT
|
| #endif
|
| } mbtk_apn_auth_proto_enum;
|
|
|
| typedef struct |
| { |
| uint8 urc_id; |
| uint8 urc_data[5]; |
| } mbtk_ril_ecall_state_info_t;
|
|
|
| typedef struct {
|
| int cid; /*!< UMTS/CDMA profile ID. range: 0 - 7*/
|
| mbtk_ip_type_enum ip_type; /*!< Packet Data Protocol (PDP) type specifies the type of data payload
|
| exchanged over the airlink when the packet data session is
|
| established with this profile. */
|
| mbtk_apn_req_type_enum req_type; /*!< apn req type*/
|
| mbtk_apn_auth_proto_enum auth_proto; /*!< Authentication Protocol. */
|
| uint8 apn_name[MBTK_APN_NAME_SIZE]; /*!< A string parameter that is a logical name used to select the GGSN
|
| and external packet data network. */
|
| uint8 user_name[MBTK_APN_USERNAME_SIZE]; /*!< Username used during data network authentication. */
|
| uint8 user_pass[MBTK_APN_PASSWORD_SIZE]; /*!< Password to be used during data network authentication. */
|
| uint8 apn_type[MBTK_APN_TYPE_SIZE];
|
| } mbtk_qser_apn_info_s;
|
| /**************qser data_call*****************/
|
|
|
| |
| typedef enum { |
| MBTK_ECALL_MSD_ITEM_VERSION = 0, |
| MBTK_ECALL_MSD_ITEM_MSG_ID, |
| MBTK_ECALL_MSD_ITEM_CONTROLTYPE, |
| MBTK_ECALL_MSD_ITEM_VIN, |
| MBTK_ECALL_MSD_ITEM_STORAGETYPE, |
| MBTK_ECALL_MSD_ITEM_TIMESTAMP, |
| MBTK_ECALL_MSD_ITEM_LOCATION, |
| MBTK_ECALL_MSD_ITEM_DIRECTION, |
| MBTK_ECALL_MSD_ITEM_LOCATIONN1, |
| MBTK_ECALL_MSD_ITEM_LOCATIONN2, |
| MBTK_ECALL_MSD_ITEM_NUMBEROFOCCUPANTS, |
| MBTK_ECALL_MSD_ITEM_ADDITIONALDATA, |
| MBTK_ECALL_MSD_ITEM_ALL_IN_ONE, |
| MBTK_ECALL_MSD_ITEM_ASI, |
| MBTK_ECALL_MSD_ITEM_VEHICLE_DIAGNOSTIC, |
| MBTK_ECALL_MSD_ITEM_CRASH_INFO, |
| MBTK_ECALL_MSD_ITEM_GNSS_TYPE |
| } mbtk_ecall_msd_item_enum; |
| |
| typedef struct |
| { |
| mbtk_ecall_msd_item_enum item_type; |
| |
| uint8 data[64]; |
| } mbtk_ecall_msd_cfg_info_t;
|
|
|
| typedef enum { |
| MBTK_ECALL_ONLY_TYPE_DISABLE = 0, |
| MBTK_ECALL_ONLY_TYPE_ENABLE_ECALL, |
| MBTK_ECALL_ONLY_TYPE_ENABLE_NG_ECALL, |
| MBTK_ECALL_ONLY_TYPE_ENABLE_ALL, |
| MBTK_ECALL_ONLY_TYPE_CONF_NUM, |
| MBTK_ECALL_ONLY_TYPE_NORMAL |
| } mbtk_ecall_only_type_enum; |
| |
| typedef enum { |
| MBTK_ECALL_SIM_TYPE_NO_SUPPORT = 0, |
| MBTK_ECALL_SIM_TYPE_SUPPORT_ECALL, |
| MBTK_ECALL_SIM_TYPE_SUPPORT_ECALL_ONLY |
| } mbtk_ecall_sim_type_enum; |
| |
| typedef struct { |
| mbtk_ecall_only_type_enum active : 8; |
| mbtk_ecall_sim_type_enum sim_type : 8; // Only for GET. |
| uint8 test_num[RIL_MAX_NUMBER_LEN]; |
| uint8 reconfig_num[RIL_MAX_NUMBER_LEN]; |
| } mbtk_ecall_only_info_t;
|
|
|
| typedef enum { |
| MBTK_ECALL_DIAL_TYPE_TEST = 0, |
| MBTK_ECALL_DIAL_TYPE_RECONFIG, |
| MBTK_ECALL_DIAL_TYPE_MANUALLY, |
| MBTK_ECALL_DIAL_TYPE_AUTO, |
| MBTK_ECALL_DIAL_TYPE_NOT_ACTIVATED, |
| MBTK_ECALL_DIAL_TYPE_RELEASE |
| } mbtk_ecall_dial_type_enum;
|
|
|
| typedef enum { |
| MBTK_ECALL_MODE_TYPE_EU = 0, |
| MBTK_ECALL_MODE_TYPE_ERA |
| } mbtk_ecall_mode_type_enum; |
| |
| typedef struct { |
| uint32 type; // mbtk_ecall_cfg_item_enum
|
|
|
| #if 0
|
| uint32 timer_t3; // ms
|
| uint32 timer_t5; // ms
|
| uint32 timer_t6; // ms
|
| uint32 timer_t7; // ms
|
| uint32 timer_th; // ms
|
|
|
| uint32 timer_callback; // s (T9)
|
| uint32 timer_cleardown; // s (T2)
|
| uint32 timer_dereg; // s (T10)
|
| uint32 timer_dial; // s
|
| uint32 timer_redialtmr; // s
|
| uint32 timer_sms; // s
|
|
|
| uint32 redialcnt;
|
| uint32 smsprocess;
|
| uint32 smsmsdcnt;
|
| #else
|
| uint8 data_valid[MBTK_ECALL_CFG_ITEM_MAX];
|
| uint32 data[MBTK_ECALL_CFG_ITEM_MAX];
|
| #endif
|
| } mbtk_ecall_cfg_info_t; |
| |
| typedef enum { |
| MBTK_ECALL_GAIN_MODE_TX = 0, |
| MBTK_ECALL_GAIN_MODE_RX, |
| MBTK_ECALL_GAIN_MODE_SIDETONE |
| } mbtk_ecall_gain_mode_enum; |
| |
| typedef struct { |
| mbtk_ecall_gain_mode_enum mode; |
| |
| int8 gain; |
| } mbtk_ecall_gain_info_t;
|
|
|
| typedef enum {
|
| MBTK_ECALL_URC_ID_ALACK = 0, // AL-ACK signal received (refer to : urc_data)
|
| MBTK_ECALL_URC_ID_SYNC_LOST, // eIM lost synchronization with PSAP
|
| // (A resynch occurs after the synchronization is lost.)
|
| MBTK_ECALL_URC_ID_NACK, // NACK signal received
|
| MBTK_ECALL_URC_ID_RESERVED_3,
|
| MBTK_ECALL_URC_ID_RESERVED_4,
|
| MBTK_ECALL_URC_ID_RESERVED_5, // 5
|
| MBTK_ECALL_URC_ID_3GPP_FATAL, // eIM is terminated: fatal error (3GPP Abort function)
|
| MBTK_ECALL_URC_ID_CALL_DROP, // eIM is terminated: call drop
|
| MBTK_ECALL_URC_ID_GENERIC, // Generic error
|
| MBTK_ECALL_URC_ID_MSD_REQ, // PSAP request MSD (Only for PULL modem)
|
| MBTK_ECALL_URC_ID_MSD_SEND_START, // 10 : eIM starts sending MSD
|
| MBTK_ECALL_URC_ID_INITIATION, // The eIM starts sending the Initiation signal (Only for PUSH modem).
|
| // It also indicates that the call setup is completed.
|
| MBTK_ECALL_URC_ID_SEND_MSD, // PUSH: SEND_MSD -> MSD_SEND_START
|
| // PULL: SEND_MSD -> MSD_REQ -> MSD_SEND_START
|
| MBTK_ECALL_URC_ID_SEND_MSD_FULL,// SEND MSD signal received too often, PSAP sync failure assumed
|
| MBTK_ECALL_URC_ID_SYNCED_PSAP, // IVS eIM is synced with PSAP
|
| MBTK_ECALL_URC_ID_SYNCED_PSAP_EIM, // 15: IVS eIM is synced with PSAP eIM
|
| MBTK_ECALL_URC_ID_LLACK, // Link layer ACK received
|
| MBTK_ECALL_URC_ID_HLACK, // Higher Layer ACK received (similar to AL-ACK (#0) but without data)
|
| MBTK_ECALL_URC_ID_EIM_RESET, // The eIM transmitter idles after a full reset. The eIM transmitter is reset after sync loss
|
| // (for example, because of the end of PSAP transmission).
|
| MBTK_ECALL_URC_ID_EIM_IDLES, // The eIM transmitter idles after the transmission of the Initiation signal (push mode)
|
| MBTK_ECALL_URC_ID_MSD_UPDATE, // 20 : MSD update request is received.
|
| MBTK_ECALL_URC_ID_MSD_UPDATE_DONE, // MSD update is done.
|
| MBTK_ECALL_URC_ID_MSD_UPDATE_ERR, // MSD update request cannot be processed.
|
| MBTK_ECALL_URC_ID_T3_EXPIRED, // T3 expired
|
| MBTK_ECALL_URC_ID_T5_EXPIRED, // T5 expired
|
| MBTK_ECALL_URC_ID_T6_EXPIRED, // 25 : T6 expired
|
| MBTK_ECALL_URC_ID_T7_EXPIRED, // T7 expired
|
| MBTK_ECALL_URC_ID_TH_EXPIRED, // TH expired
|
| MBTK_ECALL_URC_ID_RESERVED_28,
|
| MBTK_ECALL_URC_ID_RESERVED_29,
|
| MBTK_ECALL_URC_ID_RESERVED_30, // 30
|
| MBTK_ECALL_URC_ID_IVS_EVENT_TIMEOUT,
|
| MBTK_ECALL_URC_ID_PSAP_REQ, // Only for ERA
|
| MBTK_ECALL_URC_ID_MSD_SEND_FAIL_FOR_NG // NG-eCall fail to transfer MSD
|
| } mbtk_ecall_urc_id_enum;
|
|
|
| typedef struct{
|
| uint8 cid; //cid number
|
| bool connect_state; //true: connect, false: disconnect;
|
| bool auto_urc; //urc generated by manual/auto dialing
|
| uint8 pdp_result; //The cause of the dialing result
|
| mbtk_ipv4_info_t ipv4; //ipv4 info
|
| mbtk_ipv6_info_t ipv6; //ipv6 info
|
| }mbtk_pdp_cb_info_s;
|
|
|
| int ipv6_2_str(const void *ipv6, void *ipv6_str);
|
|
|
| mbtk_info_handle_t* mbtk_info_handle_get();
|
|
|
| int mbtk_info_handle_free(mbtk_info_handle_t** handle);
|
|
|
| /*
|
| * Get platform version.
|
| */
|
| int mbtk_version_get(mbtk_info_handle_t* handle, void *version);
|
|
|
| /*
|
| * Get platform model.
|
| */
|
| int mbtk_model_get(mbtk_info_handle_t* handle, void *model);
|
|
|
| /*
|
| * Get platform IMEI.
|
| */
|
| int mbtk_imei_get(mbtk_info_handle_t* handle, void *imei);
|
|
|
| /*
|
| * Get platform SN.
|
| */
|
| int mbtk_sn_get(mbtk_info_handle_t* handle, void *sn);
|
|
|
| /*
|
| * Get platform MEID.
|
| */
|
| int mbtk_meid_get(mbtk_info_handle_t* handle, void *meid);
|
|
|
| /*
|
| * Return VoLTE state.
|
| */
|
| int mbtk_volte_state_get(mbtk_info_handle_t* handle, int *volte_state);
|
|
|
| /*
|
| * Return modem state.
|
| */
|
| int mbtk_get_modem_fun(mbtk_info_handle_t* handle, int* fun);
|
|
|
| /*
|
| * Set modem state.
|
| */
|
| int mbtk_set_modem_fun(mbtk_info_handle_t* handle, mbtk_modem_info_t *info);
|
|
|
|
|
| /*
|
| * Set VoLTE state.
|
| *
|
| * volte_state:
|
| * 0 : Close VoLTE.
|
| * 1 : Open VoLTE.
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_volte_state_set(mbtk_info_handle_t* handle, int volte_state);
|
|
|
| /*
|
| * Get platform IMSI.
|
| */
|
| int mbtk_imsi_get(mbtk_info_handle_t* handle, void *imsi);
|
|
|
| /*
|
| * Get platform ICCID.
|
| */
|
| int mbtk_iccid_get(mbtk_info_handle_t* handle, void *iccid);
|
|
|
| /*
|
| * Get current phone number.
|
| */
|
| int mbtk_phone_number_get(mbtk_info_handle_t* handle, void *phone_number);
|
|
|
| /*
|
| * Get available network.
|
| */
|
| int mbtk_available_net_get(mbtk_info_handle_t* handle, list_node_t **net_list);
|
|
|
| /*
|
| * Set network select mode. (+COPS=...)
|
| */
|
| int mbtk_net_sel_mode_set(mbtk_info_handle_t* handle, const mbtk_net_info_t *net);
|
|
|
| /*
|
| * Get network select mode. (+COPS?)
|
| */
|
| int mbtk_net_sel_mode_get(mbtk_info_handle_t* handle, mbtk_net_info_t *net);
|
|
|
| /*
|
| * Get platform support bands.
|
| */
|
| int mbtk_support_band_get(mbtk_info_handle_t* handle, mbtk_band_info_t *band);
|
|
|
| /*
|
| * Get platform current bands.
|
| */
|
| int mbtk_current_band_get(mbtk_info_handle_t* handle, mbtk_band_info_t *band);
|
|
|
| /*
|
| * Set platform current bands.
|
| */
|
| int mbtk_current_band_set(mbtk_info_handle_t* handle, const mbtk_band_info_t *band);
|
|
|
| /*
|
| * Get current cell infomation.
|
| */
|
| int mbtk_cell_get(mbtk_info_handle_t* handle, mbtk_cell_type_enum *type, list_node_t **cell_list);
|
|
|
| /*
|
| * Set AT*CELL.
|
| */
|
| int mbtk_cell_set(mbtk_info_handle_t* handle, char * info, char* response);
|
|
|
| /*
|
| * Get current APN informations.
|
| */
|
| int mbtk_apn_get(mbtk_info_handle_t* handle, int *apn_num, mbtk_apn_info_t apns[]);
|
|
|
| /*
|
| * Set current QSER APN informations.
|
| */
|
| int mbtk_qser_apn_set(mbtk_info_handle_t* handle, mbtk_qser_apn_info_s *apninfo, unsigned char *cid);
|
|
|
| /*
|
| * Set current QSER APN informations.
|
| */
|
| int mbtk_qser_apn_get(mbtk_info_handle_t* handle, int *apn_num, mbtk_qser_apn_info_s apns[]);
|
|
|
| /*
|
| * Set current APN informations.
|
| */
|
| int mbtk_apn_set(mbtk_info_handle_t* handle, int cid, mbtk_ip_type_enum ip_type, const void* apn_name,
|
| const void *user_name, const void *user_pass, const void *auth);
|
|
|
| /*
|
| * Delete apn.
|
| */
|
| int mbtk_apn_del(mbtk_info_handle_t* handle, unsigned char profile_idx);
|
|
|
| /*
|
| * Start data call.
|
| */
|
| int mbtk_data_call_start(mbtk_info_handle_t* handle, int cid, int auto_conn_interval, bool boot_conn, int timeout);
|
|
|
| /*
|
| * Stop data call.
|
| */
|
| int mbtk_data_call_stop(mbtk_info_handle_t* handle, int cid, int timeout);
|
|
|
| /*
|
| * Get data call state.
|
| */
|
| int mbtk_data_call_state_get(mbtk_info_handle_t* handle, int cid, mbtk_ipv4_info_t *ipv4, mbtk_ipv6_info_t *ipv6);
|
|
|
| /*
|
| * Get current network signal.
|
| */
|
| int mbtk_net_signal_get(mbtk_info_handle_t* handle, mbtk_signal_info_t *signal);
|
|
|
| /*
|
| * Get current network register information.
|
| */
|
| int mbtk_net_reg_get(mbtk_info_handle_t* handle, mbtk_net_reg_info_t *reg);
|
|
|
| /*
|
| * Get current IMS enable or not.
|
| */
|
| int mbtk_net_ims_get(mbtk_info_handle_t* handle, int* enable);
|
|
|
| /*
|
| * Set IMS enable or not. This function takes effect after starting the device.
|
| */
|
| int mbtk_net_ims_set(mbtk_info_handle_t* handle, int enable);
|
|
|
| /*
|
| * Get current network IMS register state.
|
| */
|
| int mbtk_net_ims_reg_state_get(mbtk_info_handle_t* handle, int* reg);
|
|
|
| /*
|
| * Get radio state.
|
| */
|
| int mbtk_radio_state_get(mbtk_info_handle_t* handle, int *radio_state);
|
|
|
| /*
|
| * Set radio state.
|
| */
|
| int mbtk_radio_state_set(mbtk_info_handle_t* handle, int radio_state);
|
|
|
| /*
|
| * Return sms cmgf.
|
| */
|
| int mbtk_sms_cmgf_get(mbtk_info_handle_t* handle, int *volte_state);
|
|
|
| /*
|
| * Set sms cmgf.
|
| *
|
| * volte_state:
|
| * 0 : PDU mode.
|
| * 1 : text mode.
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cmgf_set(mbtk_info_handle_t* handle, int mode);
|
|
|
| /*
|
| * Set sms cmgs.
|
| *
|
| if PDU mode (+CMGF=0):
|
| +CMGS=<length><CR>
|
| PDU is given<ctrl-Z/ESC>
|
|
|
| if text mode (+CMGF=1):
|
| +CMGS=<da>[,<toda>]<CR>
|
| text is entered<ctrl-Z/ESC>
|
|
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cmgs_set(mbtk_info_handle_t* handle, char * cmgs, char *resp);
|
|
|
| /*
|
| * Set sms cmgw.
|
| *
|
| if text mode (+CMGF=1):
|
| +CMGW=<oa/da>[,<tooa/toda>[,<stat>]]
|
| <CR>
|
| text is entered<ctrl-Z/ESC>
|
| if PDU mode (+CMGF=0):
|
| +CMGW=<length>[,<stat>]<CR>PDU is
|
| given<ctrl-Z/ESC>
|
|
|
| */
|
| int mbtk_sms_cmgw_set(mbtk_info_handle_t* handle, char * cmgw, char *resp);
|
|
|
| /*
|
| * Set sms cmgd.
|
| *
|
| * +CMGD=<index>[,<delflag>]
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cmgd_set(mbtk_info_handle_t* handle, char * cmdg);
|
|
|
| /*
|
| * Get sms cmgd.
|
| *
|
| * +CMGD: (XXX,XXX)(0-4)
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cmgd_get(mbtk_info_handle_t* handle, char * cmdg);
|
|
|
| /*
|
| * Set sms cmgl.
|
| *
|
| * AT+CMGL[=<stat>]
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cmgl_set(mbtk_info_handle_t* handle, char * cmgl, char *resp);
|
|
|
| /*
|
| * Return sms csca.
|
| */
|
| int mbtk_sms_csca_get(mbtk_info_handle_t* handle, char *buf);
|
|
|
| /*
|
| * Set sms csca.
|
| *
|
| * AT+CSCA=<number> [,<type>]
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_csca_set(mbtk_info_handle_t* handle, char * csca);
|
|
|
| /*
|
| * Set sms csmp.
|
| *
|
| * AT+CSMP=[<fo>[,<vp>[,<pid>[,<dcs>]]]]
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_csmp_set(mbtk_info_handle_t* handle, char * csmp);
|
|
|
| /*
|
| * Set sms cscb.
|
| *
|
| * AT+CSCB=<[<mode>[,<mids>[,<dcss>]]]>
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cscb_set(mbtk_info_handle_t* handle, char * cscb);
|
|
|
| /*
|
| * Set sms cnmi.
|
| *
|
| at+cnmi=1,2
|
|
|
| OK
|
| if sending fails:
|
| +CMS ERROR: <err>
|
| */
|
| int mbtk_sms_cnmi_set(mbtk_info_handle_t* handle);
|
|
|
| /*
|
| * Set sms cmss.
|
| *
|
| +CMSS=<index>[,<da>[,<toda>]]
|
|
|
| if sending successful:
|
| +CMSS: <mr>
|
| OK
|
| if sending fails:
|
| +CMS ERROR: <err>
|
| */
|
| int mbtk_sms_cmss_set(mbtk_info_handle_t* handle, char * cmss, char *resp);
|
|
|
| /*
|
| * Return sms cmgf.
|
| */
|
| int mbtk_sms_cpms_get(mbtk_info_handle_t* handle, char * mem);
|
|
|
| /*
|
| * Set sms cpms.
|
| *
|
| * AT+CPMS=<mem1>[,<mem2>[,<mem3>]]
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cpms_set(mbtk_info_handle_t* handle, char * mem, char* response);
|
|
|
| /*
|
| * Set sms cm.
|
| *
|
| * +CMGR=<index>
|
|
|
| if PDU mode (+CMGF=0) ��command successful:
|
| +CMGR: <stat>,[<alpha>],<length><CR><LF><pdu>
|
| OK
|
| if text mode (+CMGF=1), command successful and SMS-DELIVER:
|
| +CMGR:<stat>,<oa>,[<alpha>],<scts>[,<tooa>,<fo>,<pid>,<dcs
|
| >, <sca>,<tosca>,<length>]<CR><LF><data>
|
| OK
|
| if text mode (+CMGF=1), command successful and SMS-SUBMIT:
|
| +CMGR:
|
| <stat>,<da>,[<alpha>][,<toda>,<fo>,<pid>,<dcs>,[<vp>],
|
| <sca>,<tosca>,<length>]<CR><LF><data>
|
| OK
|
| otherwise:
|
| +CMS ERROR: <err>
|
| *
|
| * Restarting takes effect after execution.
|
| */
|
| int mbtk_sms_cmgr_set(mbtk_info_handle_t* handle, int index, char *resp);
|
|
|
| /*
|
| * Get sim state.
|
| */
|
| int mbtk_sim_state_get(mbtk_info_handle_t* handle, mbtk_sim_state_enum *sim_state);
|
|
|
| /*
|
| * Get sim card type.
|
| */
|
| int mbtk_sim_card_type_get(mbtk_info_handle_t* handle, mbtk_sim_card_type_enum *sim_card_type);
|
|
|
| /*
|
| * Get PIN’s number of remaining retry
|
| */
|
| int mbtk_pin_last_num_get(mbtk_info_handle_t* handle, mbtk_pin_puk_last_times *last_times);
|
|
|
| /*
|
| * Get plmn list
|
| */
|
| int mbtk_get_plmn_list(mbtk_info_handle_t* handle, mbtk_plmn_info *pin);
|
|
|
| /*
|
| * Get system temperature.
|
| *
|
| * type[IN]:
|
| * 0: Soc temperature.
|
| * 1: RF temperature.
|
| * temp[OUT]:
|
| * temperature in celsius.
|
| */
|
| int mbtk_temp_get(mbtk_info_handle_t* handle, int type, mbtk_thermal_info_t* temp);
|
|
|
| /*
|
| * Set sim power state.
|
| * power:
|
| * 0: Sim power off.
|
| * 1: Sim power on.
|
| */
|
| int mbtk_sim_power_set(int power);
|
|
|
| /*
|
| *enable PIN
|
| */
|
| int mbtk_enable_pin(mbtk_info_handle_t* handle, mbtk_enable_pin_info *pin);
|
|
|
| /*
|
| * GET PIN STATE
|
| */
|
| int mbtk_get_pin_state(mbtk_info_handle_t* handle, mbtk_pin_state_enum *pin_state);
|
|
|
| /*
|
| *Verify PIN
|
| */
|
| int mbtk_verify_pin(mbtk_info_handle_t* handle, char *pin);
|
|
|
| /*
|
| *change PIN
|
| */
|
| int mbtk_change_pin(mbtk_info_handle_t* handle, mbtk_change_pin_info *pin);
|
|
|
| /*
|
| *unlock PIN
|
| */
|
| int mbtk_unlock_pin(mbtk_info_handle_t* handle, mbtk_unlock_pin_info *pin);
|
|
|
|
|
| /*
|
| * System power.
|
| * type:
|
| * 0: Reboot system.
|
| * 1: Poweroff system.
|
| * 2: Halt system.
|
| */
|
| int mbtk_system_reboot(int type);
|
|
|
| /*
|
| * Get time type.
|
| */
|
| int mbtk_time_get(mbtk_info_handle_t* handle, int *time_type);
|
|
|
| /*
|
| * Get net time.
|
| */
|
| int mbtk_net_time_get(mbtk_info_handle_t* handle, char* time_str);
|
|
|
| /*
|
| * Absolute time conversion
|
| */
|
| int mbtk_get_abs_time(char *time_str, time_t *time_out);
|
|
|
| /*
|
| * Set time.
|
| *
|
| * time_type:
|
| * 0: Cell time
|
| * 1: NTP time
|
| * 2: User time
|
| * time_str: "YYYY-MM-DD HH:MM:SS"
|
| */
|
| int mbtk_time_set(mbtk_info_handle_t* handle, mbtk_time_type_enum time_type, char* time_str);
|
|
|
| //call a phone number
|
| int mbtk_call_start(mbtk_info_handle_t* handle, char* phone_number);
|
| //answer a call
|
| int mbtk_call_answer(mbtk_info_handle_t* handle);
|
| //hang up all call
|
| int mbtk_call_hang(mbtk_info_handle_t* handle);
|
| //hang up a call
|
| int mbtk_a_call_hang(mbtk_info_handle_t* handle, int phone_id);
|
| //hang up waiting or background call
|
| int mbtk_waiting_or_background_call_hang(mbtk_info_handle_t* handle);
|
| //hang up foreground resume background call
|
| int mbtk_foreground_resume_background_call_hang(mbtk_info_handle_t* handle);
|
| //get call infomation
|
| int mbtk_call_reg_get(mbtk_info_handle_t* handle, mbtk_call_info_t *reg);
|
| //set call mute
|
| int mbtk_mute_state_set(mbtk_info_handle_t* handle, int mute_state);
|
| //get mute state
|
| int mbtk_mute_state_get(mbtk_info_handle_t* handle, int *mute_state);
|
| //Wake-up control
|
| int mbtk_wakeup_state_set(mbtk_info_handle_t* handle, uint32 wakeup_state);
|
| //Get the searching interval of OOS
|
| int mbtk_oos_get(mbtk_info_handle_t* handle, mbtk_oos_info *oos_info);
|
| //Set the searching interval of OOS
|
| int mbtk_oos_set(mbtk_info_handle_t* handle, mbtk_oos_info *oos_info);
|
|
|
|
|
| //set dtmf character
|
| int mbtk_dtmf_send(mbtk_info_handle_t* handle, mbtk_call_dtmf_info_t *dtmf_character);
|
| int mbtk_ceer_get(mbtk_info_handle_t* handle, void *ceer);
|
|
|
| //set led
|
| int mbtk_led_set(mbtk_info_handle_t* handle, mbtk_led_type type, mbtk_led_status status);
|
|
|
| |
| /* |
| * Set msd item. |
| * |
| */ |
| int mbtk_ecall_msd_item_set(mbtk_info_handle_t* handle, const mbtk_ecall_msd_cfg_info_t *msd_cfg);
|
| |
| /* |
| * Generate msd after msd item set. |
| * |
| */ |
| int mbtk_ecall_msd_gen(mbtk_info_handle_t* handle);
|
| |
| /* |
| * Set ecall msd. |
| * |
| */ |
| int mbtk_ecall_msd_set(mbtk_info_handle_t* handle, const void* msd);
|
| |
| /* |
| * Get ecall msd. |
| * |
| */ |
| int mbtk_ecall_msd_get(mbtk_info_handle_t* handle, void* msd);
|
| |
| |
| /* |
| * Set ecall msd item. |
| * |
| */ |
| int mbtk_ecall_push(mbtk_info_handle_t* handle);
|
| |
| /* |
| * Set ecall only configs. |
| * |
| */ |
| int mbtk_ecall_only_set(mbtk_info_handle_t* handle, const mbtk_ecall_only_info_t* info);
|
| |
| /* |
| * Get ecall only configs. |
| * |
| */ |
| int mbtk_ecall_only_get(mbtk_info_handle_t* handle, mbtk_ecall_only_info_t* info);
|
| |
| /* |
| * Set ecall network reg. |
| * |
| */ |
| int mbtk_ecall_reg_set(mbtk_info_handle_t* handle, int reg);
|
| |
| /* |
| * Start ecall dial start. |
| * |
| */ |
| int mbtk_ecall_dial_start(mbtk_info_handle_t* handle, mbtk_ecall_dial_type_enum type);
|
| |
| /* |
| * Get ecall dial state. |
| * |
| */ |
| int mbtk_ecall_dial_state_get(mbtk_info_handle_t* handle, mbtk_ecall_dial_type_enum* type);
|
| |
| /* |
| * Set ecall mode. |
| * |
| */ |
| int mbtk_ecall_mode_set(mbtk_info_handle_t* handle, mbtk_ecall_mode_type_enum mode);
|
| |
| /* |
| * Get ecall mode. |
| * |
| */ |
| int mbtk_ecall_mode_get(mbtk_info_handle_t* handle, mbtk_ecall_mode_type_enum *mode);
|
| |
| /* |
| * Set ecall configs. |
| * |
| */ |
| int mbtk_ecall_cfg_set(mbtk_info_handle_t* handle, const mbtk_ecall_cfg_info_t *cfg);
|
| |
| /* |
| * Get ecall configs. |
| * |
| */ |
| int mbtk_ecall_cfg_get(mbtk_info_handle_t* handle, mbtk_ecall_cfg_info_t* cfg);
|
| |
| /* |
| * Set ecall sms number. |
| * |
| */ |
| int mbtk_ecall_sms_number_set(mbtk_info_handle_t* handle, const void *number);
|
| |
| /* |
| * Get ecall sms number. |
| * |
| */ |
| int mbtk_ecall_sms_number_get(mbtk_info_handle_t* handle, void *number);
|
| |
| /* |
| * Set ecall mute speaker. |
| * |
| */ |
| int mbtk_ecall_mute_spk_set(mbtk_info_handle_t* handle, int mute);
|
| |
| /* |
| * Set ecall dsp gain. |
| * |
| */ |
| int mbtk_ecall_dsp_gain_set(mbtk_info_handle_t* handle, const mbtk_ecall_gain_info_t *gain_info);
|
|
|
| /*
|
| * Set pdp state change callback function.
|
| */
|
| int mbtk_pdp_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set network state change callback function.
|
| */
|
| int mbtk_net_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set call state change callback function.
|
| */
|
| int mbtk_call_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set sms state change callback function.
|
| */
|
| int mbtk_sms_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set radio state change callback function.
|
| */
|
| int mbtk_radio_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set sim state change callback function.
|
| */
|
| int mbtk_sim_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set signal state change callback function.
|
| */
|
| int mbtk_signal_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| /*
|
| * Set ril server state change callback function.
|
| */
|
| int mbtk_ril_server_state_change_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| int mbtk_ecall_state_change_cb_reg(mbtk_info_handle_t* handle, mbtk_info_callback_func cb);
|
|
|
| int mbtk_sms_cnmi_set(mbtk_info_handle_t* handle);
|
|
|
| int mbtk_get_modem_version(mbtk_info_handle_t* handle, void *modem_version);
|
|
|
| //get fplmn list
|
| int mbtk_fplmn_get(mbtk_info_handle_t *handle, void *fplmn);
|
|
|
| //set fplmn list
|
| int mbtk_fplmn_set(mbtk_info_handle_t *handle, void *fplmn);
|
|
|
|
|
| #endif /* _MBTK_INFO_API_H */
|