blob: 30f883710a59548c3f74e7a66d6c7dc1a4f11a56 [file] [log] [blame]
/*
*
* Data : 2022/10/21 16:00:28
* Author : LiuBin
*/
#ifndef _LYNQ_NET_API_H
#define _LYNQ_NET_API_H
#include "mbtk_info_api.h"
typedef enum {
RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */
RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */
} RIL_RadioTechnologyFamily;
typedef struct
{
int rssi; // 0: 113 dBm or less
// 1: 111 dBm
// 2...30: 109 dBm...53 dBm
// 31: 51 dBm or greater
// 99: not known or not detectable
int 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
int gsm_sig_valid;
int 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
int umts_sig_valid;
int 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
int 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
int lte_sig_valid;
int 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
int 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
} signalStrength_t;
typedef enum {
ZONE_NUM_SOC = 0,
ZONE_NUM_RF
} ZONE_NUM;
int lynq_network_init(int uToken);
int lynq_network_deinit(void);
int lynq_get_version(char buf[]);
int lynq_get_imei(char buf[]);
int lynq_get_sn(char buf[]);
int lynq_shutdown(char options[]);
int lynq_time_set(mbtk_time_type_enum time_type, char* time_str);
int lynq_get_zone_tmp(ZONE_NUM num, int *temp);
int lynq_get_sim_status(int *card_status);
int lynq_get_imsi(char buf[]);
int lynq_get_iccid(char buf[]);
int lynq_query_phone_number(char buf[]);
int lynq_sim_power (int mode);
int lynq_query_operater(char *OperatorFN,char *OperatorSH,char *MccMnc);
int lynq_query_network_selection_mode (int *netselMode);
int lynq_set_network_selection_mode(const char *mode, const char* mccmnc);
int lynq_query_available_network(list_node_t** net_list);
int lynq_query_registration_state(const char *type, int* regState,int *imsRegState,char * LAC,char *CID,int *netType,int * radioTechFam,int *netRejected);
int lynq_query_prefferred_networktype (int *preNetType);
int lynq_set_prefferred_networktype (const int preNetType);
int lynq_set_band_mode(int gsm_band, int umts_band, int tdlte_band, int fddlte_band);
int lynq_query_available_bandmode (int *gsm_band, int *umts_band, int *tdlte_band, int *fddlte_band);
int lynq_radio_on (const int data);
int lynq_query_radio_tech (int* radioTech);
int lynq_solicited_signal_strength (signalStrength_t *solSigStren);
int lynq_set_ims (const int ims_mode);
int lynq_init_cell(void);
int lynq_deinit_cell(void);
int lynq_query_cell_info(int *type, list_node_t **cell_list);
void lynq_set_cell_info(char *mem);
/*
* Set specific APN informations.
*
* cid : 2-7
*/
int lynq_apn_set(int cid, mbtk_ip_type_enum ip_type, const void* apn_name,
const void *user_name, const void *user_pass, const void *auth);
/*
* Get current all APN informations.
*/
int lynq_apn_get(int *apn_num, mbtk_apn_info_t apns[]);
/*
* Start data call.
*/
int lynq_data_call_start(int cid, int timeout);
/*
* Stop data call.
*/
int lynq_data_call_stop(int cid, int timeout);
/*
* Query data call state.
*/
int lynq_data_call_query(int cid, mbtk_ipv4_info_t *ipv4, mbtk_ipv6_info_t *ipv6);
/*
*Get native ip and free port
*/
int lynq_get_ip_and_port(char *ipBuf_out,int *port,int iptype);
#endif /* _LYNQ_NET_API_H */