@@ -22,6 +22,22 @@ enum _net_state {
22
22
/**
23
23
* Network parameter structure
24
24
*/
25
+ #ifdef PLATFORM_BC20
26
+ typedef struct {
27
+ uint8_t csq ; /**< Signal strength RSSI value (0:-113dBm or less to 31:-55dBm or more, 99: Not detectable) */
28
+ uint8_t rscp ; /**< Received signal code power */
29
+ uint8_t rsrp ; /**< Reference signal received quality */
30
+ uint8_t rsrq ; /**< Reference signal received power */
31
+ } cesq_t ;
32
+
33
+ struct netparam_t {
34
+ int simstate ; /**< SIM CPIN status @ref Enum_SIMState */
35
+ int cereg ; /**< CEREG network status @ref Enum_NetworkState */
36
+ int state ; /**< Internal state (for debugging) */
37
+ cesq_t cesq ; /**< Extended Signal quality structure */
38
+ const char * apn ; /**< Currently used APN as null terminted string */
39
+ };
40
+ #else
25
41
struct netparam_t {
26
42
int simstate ; /**< SIM CPIN status @ref Enum_SIMState */
27
43
int creg ; /**< CREG GSM status @ref Enum_NetworkState */
@@ -31,6 +47,7 @@ struct netparam_t {
31
47
unsigned char csq ; /**< Signal strength RSSI value (0:-113dBm or less to 31:-55dBm or more, 99: Not detectable) */
32
48
const char * apn ; /**< Currently used APN as null terminted string */
33
49
};
50
+ #endif
34
51
35
52
#ifdef __cplusplus
36
53
extern "C" {
@@ -43,14 +60,6 @@ extern "C" {
43
60
*/
44
61
int network_getparam (struct netparam_t * param );
45
62
46
- /**
47
- * Get network status.
48
- * If socket descriptor is provided, extended network status will be provided with socket status
49
- * @param sockfd [in] Socket descriptor (optional, 0 if not used)
50
- * @return network status see @ref _net_state
51
- */
52
- int network_getstatus (int sockfd );
53
-
54
63
/**
55
64
* Get APN configuration stored in memory
56
65
* @param apn [out] Access point name (APN)
@@ -91,6 +100,26 @@ int network_setdns(const char *pri, const char *sec);
91
100
*/
92
101
int network_resetdns (void );
93
102
103
+ #if defined(PLATFORM_BC20 ) || defined(_DOXYGEN_ )
104
+ /**
105
+ * Get status of network, if its ready or not for data transaction
106
+ * @return returns 1 if network ready, 0 otherwise
107
+ */
108
+ int network_isready (void );
109
+
110
+ /**
111
+ * Reset and restart network
112
+ */
113
+ void network_reset (void );
114
+ #else
115
+ /**
116
+ * Get network status.
117
+ * If socket descriptor is provided, extended network status will be provided with socket status
118
+ * @param sockfd [in] Socket descriptor (optional, 0 if not used)
119
+ * @return network status see @ref _net_state
120
+ */
121
+ int network_getstatus (int sockfd );
122
+
94
123
/**
95
124
* Enable/Disable GPRS. GPRS is enabled by default
96
125
* @param enable [in] 1 to enable, 0 to disable
@@ -109,6 +138,7 @@ int network_isgprsenable(void);
109
138
* @return IP Address octets
110
139
*/
111
140
unsigned char * network_getlocalip (void );
141
+ #endif
112
142
113
143
/**
114
144
* Get currently used APN
0 commit comments