6
6
#ifndef INCLUDE_NETWORK_H_
7
7
#define INCLUDE_NETWORK_H_
8
8
9
+ #include <stdint.h>
10
+
11
+ #ifdef __cplusplus
12
+ extern "C" {
13
+ #endif
14
+
9
15
/**
10
- * Network status
16
+ * Network state
11
17
*/
12
18
enum _net_state {
13
19
NET_STATE_INVALID , /**< Network status unknown/invalid */
@@ -22,36 +28,17 @@ enum _net_state {
22
28
/**
23
29
* Network parameter structure
24
30
*/
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
31
struct netparam_t {
34
- int simstate ; /**< SIM CPIN status @ref simstate_e */
35
- int cereg ; /**< CEREG network status @ref networkstate_e */
36
- int state ; /**< Internal state (for debugging) */
37
- cesq_t cesq ; /**< Extended Signal quality structure */
32
+ uint8_t simstate ; /**< SIM CPIN status @ref simstate_e */
33
+ uint8_t creg ; /**< GSM status @ref networkstate_e */
34
+ uint8_t cgreg ; /**< EPS Network (4G/NB-Iot)/GPRS status @ref networkstate_e */
35
+ uint8_t state ; /**< Internal state (for debugging) */
36
+ uint8_t signal ; /**< Signal level\n
37
+ For GSM; RSSI Value - 0:-113dBm or less to 31:-55dBm or more,\n
38
+ For 4G/NB-IoT; RSRP Value - 0:-140dBm or less to 97:-44dBm or more,\n
39
+ 99: Not detectable */
38
40
const char * apn ; /**< Currently used APN as null terminted string */
39
41
};
40
- #else
41
- struct netparam_t {
42
- int simstate ; /**< SIM CPIN status @ref simstate_e */
43
- int creg ; /**< CREG GSM status @ref networkstate_e */
44
- int cgreg ; /**< CGREG GPRS status @ref networkstate_e */
45
- int state ; /**< Internal state (for debugging) */
46
- int atgprs ; /**< Internal state of GPRS (for debugging) */
47
- unsigned char csq ; /**< Signal strength RSSI value (0:-113dBm or less to 31:-55dBm or more, 99: Not detectable) */
48
- const char * apn ; /**< Currently used APN as null terminted string */
49
- };
50
- #endif
51
-
52
- #ifdef __cplusplus
53
- extern "C" {
54
- #endif
55
42
56
43
/**
57
44
* Get Network parameters
@@ -108,10 +95,8 @@ int network_resetdns(void);
108
95
*/
109
96
int network_getstatus (int sockfd );
110
97
111
- #if defined(PLATFORM_BC20 ) || defined(_DOXYGEN_ )
112
98
/**
113
- * Get status of network, if its ready or not for data transaction
114
- * @note This API applies to NBIoT Platforms only.
99
+ * Get status of network, if its ready or not for IP data transmission
115
100
*
116
101
* @return returns 1 if network ready, 0 otherwise
117
102
*/
@@ -121,7 +106,6 @@ int network_isready(void);
121
106
* Reset and restart network
122
107
*/
123
108
void network_reset (void );
124
- #endif
125
109
126
110
#if !defined(PLATFORM_BC20 ) || defined(_DOXYGEN_ )
127
111
/**
0 commit comments