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