Skip to content

Commit 235f3d4

Browse files
committed
include: Update network.h for LTE support
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 66823d4 commit 235f3d4

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

include/network.h

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
#ifndef INCLUDE_NETWORK_H_
77
#define INCLUDE_NETWORK_H_
88

9+
#include <stdint.h>
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
915
/**
10-
* Network status
16+
* Network state
1117
*/
1218
enum _net_state {
1319
NET_STATE_INVALID, /**< Network status unknown/invalid */
@@ -22,36 +28,17 @@ enum _net_state {
2228
/**
2329
* Network parameter structure
2430
*/
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-
3331
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 */
3840
const char *apn; /**< Currently used APN as null terminted string */
3941
};
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
5542

5643
/**
5744
* Get Network parameters
@@ -108,10 +95,8 @@ int network_resetdns(void);
10895
*/
10996
int network_getstatus(int sockfd);
11097

111-
#if defined(PLATFORM_BC20) || defined(_DOXYGEN_)
11298
/**
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
115100
*
116101
* @return returns 1 if network ready, 0 otherwise
117102
*/
@@ -121,7 +106,6 @@ int network_isready(void);
121106
* Reset and restart network
122107
*/
123108
void network_reset(void);
124-
#endif
125109

126110
#if !defined(PLATFORM_BC20) || defined(_DOXYGEN_)
127111
/**

0 commit comments

Comments
 (0)