b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame^] | 1 | #ifndef LYNQ_DATA_H |
| 2 | #define LYNQ_DATA_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | #define LYNQ_APN_CHANNEL_MAX 10 |
| 7 | #define LYNQ_PDP_TYPE_MAX_LEN 16 |
| 8 | #define LYNQ_IFACE_NAME_MAX_LEN 50 |
| 9 | #define LYNQ_APN_MAX_LEN 50 |
| 10 | #define LYNQ_TYPE_MAX_LEN 50 |
| 11 | #define LYNQ_ADDRESSES_MAX_LEN 100 |
| 12 | #define LYNQ_DNSES_MAX_LEN 256 |
| 13 | #define LYNQ_GATEWAYS_MAX_LEN 50 |
| 14 | #define LYNQ_PCSCF_MAX_LEN 256 |
| 15 | #define LYNQ_APN_TYPE_MAX_LEN 50 |
| 16 | #define LYNQ_PDP_ADDR_MAX_LEN 64 |
| 17 | #define LYNQ_DNS_ADDR_MAX_LEN 256 |
| 18 | #define LYNQ_GETWAYS_ADDR_MAX_LEN 64 |
| 19 | #define LYNQ_POXY_ADDR_MAX_LEN 64 |
| 20 | |
| 21 | |
| 22 | typedef struct { |
| 23 | int status; /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */ |
| 24 | int suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry |
| 25 | back-off timer value RIL wants to override the one |
| 26 | pre-configured in FW. |
| 27 | The unit is miliseconds. |
| 28 | The value < 0 means no value is suggested. |
| 29 | The value 0 means retry should be done ASAP. |
| 30 | The value of INT_MAX(0x7fffffff) means no retry. */ |
| 31 | int cid; /* Context ID, uniquely identifies this call */ |
| 32 | int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ |
| 33 | char type[LYNQ_PDP_TYPE_MAX_LEN]; /* One of the PDP_type values in TS 27.007 section 10.1.1. |
| 34 | For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is |
| 35 | PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported |
| 36 | such as "IP" or "IPV6" */ |
| 37 | char ifname[LYNQ_IFACE_NAME_MAX_LEN]; /* The network interface name */ |
| 38 | char addresses[LYNQ_PDP_ADDR_MAX_LEN]; /* A space-delimited list of addresses with optional "/" prefix length, |
| 39 | e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". |
| 40 | May not be empty, typically 1 IPv4 or 1 IPv6 or |
| 41 | one of each. If the prefix length is absent the addresses |
| 42 | are assumed to be point to point with IPv4 having a prefix |
| 43 | length of 32 and IPv6 128. */ |
| 44 | char dnses[LYNQ_DNS_ADDR_MAX_LEN]; /* A space-delimited list of DNS server addresses, |
| 45 | e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". |
| 46 | May be empty. */ |
| 47 | char gateways[LYNQ_GETWAYS_ADDR_MAX_LEN]; /* A space-delimited list of default gateway addresses, |
| 48 | e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". |
| 49 | May be empty in which case the addresses represent point |
| 50 | to point connections. */ |
| 51 | char pcscf[LYNQ_POXY_ADDR_MAX_LEN]; /* the Proxy Call State Control Function address |
| 52 | via PCO(Protocol Configuration Option) for IMS client. */ |
| 53 | int mtu; /* MTU received from network |
| 54 | Value <= 0 means network has either not sent a value or |
| 55 | sent an invalid value */ |
| 56 | } lynq_data_call_response_v11_t; |
| 57 | |
| 58 | typedef struct |
| 59 | { |
| 60 | int index; |
| 61 | char apn[LYNQ_APN_MAX_LEN]; |
| 62 | char apnType[LYNQ_APN_TYPE_MAX_LEN]; |
| 63 | }lynq_apn_info; |
| 64 | |
| 65 | int lynq_init_data(int uToken); |
| 66 | int lynq_deinit_data(); |
| 67 | int lynq_setup_data_call(int *handle); |
| 68 | int lynq_deactive_data_call(int *handle); |
| 69 | int lynq_setup_data_call_sp(int *handle,char *apn,char *apnType,char *user,char *password,char *authType,char *normalProtocol,char *roamingProtocol); |
| 70 | int lynq_setup_data_call_sp_t106(int *handle,char *apn,char *apnType,char *user,char *password,char *authType,char *normalProtocol,char *roamingProtocol); |
| 71 | //int lynq_deactive_data_call_sp(int *handle,char *apnType); |
| 72 | int lynq_get_data_call_list(int *handle,lynq_data_call_response_v11_t *dataCallList); |
| 73 | int lynq_wait_data_call_state_change(int *handle); |
| 74 | int lynq_modify_apn_db(const int cmd,char *id,char *mcc,char *mnc,char *apn,char *apntype,char *user,char *password,char *normalprotocol,char *roamingprotocol,char *carrier,char *out); |
| 75 | int lynq_reset_apn(char *result); |
| 76 | int lynq_get_apn_table(int *size,lynq_apn_info **list); |
| 77 | void lynq_release_wait_data_call(); |
| 78 | |
| 79 | #ifdef __cplusplus |
| 80 | } |
| 81 | #endif |
| 82 | #endif |