@@ -43,225 +43,68 @@ class AT_CellularNetwork : public CellularNetwork, public AT_CellularBase
43
43
44
44
public: // NetworkInterface
45
45
46
- /* * Set the cellular network APN and credentials
47
- *
48
- * @param apn Optional name of the network to connect to
49
- * @param username Optional username for the APN
50
- * @param password Optional password fot the APN
51
- * @return 0 on success, negative error code on failure
52
- */
53
46
virtual nsapi_error_t set_credentials (const char *apn,
54
47
const char *username = 0 , const char *password = 0 );
55
48
56
- /* * Set the cellular network APN and credentials
57
- *
58
- * @param apn Name of the network to connect to
59
- * @param type Authentication type to use
60
- * @param username Optional username for the APN
61
- * @param password Optional password fot the APN
62
- * @return 0 on success, negative error code on failure
63
- */
64
49
virtual nsapi_error_t set_credentials (const char *apn, AuthenticationType type,
65
50
const char *username = 0 , const char *password = 0 );
66
51
67
- /* * Start the interface. Attempts to connect to a cellular network.
68
- *
69
- * @param apn Optional name of the network to connect to
70
- * @param username Optional username for your APN
71
- * @param password Optional password for your APN
72
- * @return 0 on success, negative error code on failure
73
- */
74
52
virtual nsapi_error_t connect (const char *apn,
75
53
const char *username = 0 , const char *password = 0 );
76
54
77
- /* * Start the interface. Attempts to connect to a cellular network.
78
- *
79
- * @return 0 on success, negative error code on failure
80
- */
81
55
virtual nsapi_error_t connect ();
82
56
83
- /* * Stop the interface
84
- *
85
- * @return 0 on success, negative error code on failure
86
- */
87
57
virtual nsapi_error_t disconnect ();
88
58
89
59
protected:
90
- /* * Provide access to the NetworkStack object
91
- *
92
- * @return The underlying NetworkStack object
93
- */
94
60
virtual NetworkStack *get_stack ();
95
61
96
62
public: // CellularNetwork
97
- /* * Request registering to network.
98
- *
99
- * @param plmn format is in numeric format or 0 for automatic network registration
100
- * @return zero on success
101
- */
102
63
virtual nsapi_error_t set_registration (const char *plmn = 0 );
103
64
104
- /* *
105
- * Gets the network registration status.
106
- * @param type see RegistrationType values
107
- * @param status see RegistrationStatus values
108
- * @return zero on success
109
- */
110
65
virtual nsapi_error_t get_registration_status (RegistrationType type, RegistrationStatus &status);
111
66
112
- /* * Request attach to network.
113
- *
114
- * @param timeout milliseconds to wait for attach response
115
- * @return zero on success
116
- */
117
67
virtual nsapi_error_t set_attach (int timeout = 10 *1000 );
118
68
119
- /* * Request attach status from network.
120
- *
121
- * @param status see AttachStatus values
122
- * @return zero on success
123
- */
124
69
virtual nsapi_error_t get_attach (AttachStatus &status);
125
70
126
- /* * Get APN rate control.
127
- *
128
- * @remark optional params are not updated if not received from network, so use good defaults
129
- *
130
- * @param reports Additional exception reports at maximum rate reached are allowed to be sent [optional]
131
- * @param time_unit Uplink time unit with values 0=unrestricted, 1=minute, 2=hour, 3=day, 4=week [optional]
132
- * @param uplink_rate Maximum number of messages per timeUnit [optional]
133
- * @return zero on success
134
- */
135
71
virtual nsapi_error_t get_rate_control (CellularNetwork::RateControlExceptionReports &reports,
136
72
CellularNetwork::RateControlUplinkTimeUnit &time_unit, int &uplink_rate);
137
73
138
- /* * Get backoff timer value
139
- *
140
- * @param backoff_time Backoff timer value associated with PDP APN in seconds
141
- * @return zero on success
142
- */
143
74
virtual nsapi_error_t get_backoff_time (int &backoff_time);
144
75
145
- /* * Get notified if the connection gets lost
146
- *
147
- * @param status_cb user defined callback
148
- */
149
76
virtual void attach (Callback<void (nsapi_event_t , intptr_t )> status_cb);
150
77
151
- /* * Get the connection status
152
- *
153
- * @return The connection status according to ConnectionStatusType
154
- */
155
78
virtual nsapi_connection_status_t get_connection_status () const ;
156
79
157
- /* * Set blocking status of connect() which by default should be blocking
158
- *
159
- * @param blocking true if connect is blocking
160
- * @return 0 on success, negative error code on failure
161
- */
162
80
virtual nsapi_error_t set_blocking (bool blocking);
163
81
164
- /* * Get the local IP address
165
- *
166
- * @return Null-terminated representation of the local IP address
167
- * or null if no IP address has been received
168
- */
169
82
virtual const char *get_ip_address ();
170
83
171
- /* * Sets radio access technology.
172
- *
173
- * @param op_rat Radio access technology
174
- * @return zero on success
175
- */
176
84
virtual nsapi_error_t set_access_technology (operator_t ::RadioAccessTechnology op_rat);
177
85
178
- /* * Scans for operators module can reach.
179
- *
180
- * @param operators Container of reachable operators and their access technologies
181
- * @param ops_count Number of found operators
182
- * @return zero on success
183
- */
184
86
virtual nsapi_error_t scan_plmn (operList_t &operators, int &ops_count);
185
87
186
- /* * Set CIoT optimizations.
187
- *
188
- * @param supported_opt Supported CIoT EPS optimizations.
189
- * @param preferred_opt Preferred CIoT EPS optimizations.
190
- * @return zero on success
191
- */
192
88
virtual nsapi_error_t set_ciot_optimization_config (Supported_UE_Opt supported_opt,
193
89
Preferred_UE_Opt preferred_opt);
194
90
195
- /* * Get CIoT optimizations.
196
- *
197
- * @param supported_opt Supported CIoT EPS optimizations.
198
- * @param preferred_opt Preferred CIoT EPS optimizations.
199
- * @return zero on success
200
- */
201
91
virtual nsapi_error_t get_ciot_optimization_config (Supported_UE_Opt& supported_opt,
202
92
Preferred_UE_Opt& preferred_opt);
203
93
94
+ virtual nsapi_error_t set_stack_type (nsapi_ip_stack_t stack_type);
204
95
205
- /* * Set the pdn type to be used
206
- *
207
- * @param stack_type the stack type to be used.
208
- * @return NSAPI_ERROR_OK on success
209
- */
210
- virtual nsapi_error_t set_stack_type (nsapi_ip_stack_t stack_type);
96
+ virtual nsapi_ip_stack_t get_stack_type ();
211
97
212
- /* * Get the pdn type in use
213
- *
214
- * @return stack type
215
- */
216
- virtual nsapi_ip_stack_t get_stack_type ();
98
+ virtual nsapi_error_t get_pdpcontext_params (pdpContextList_t& params_list);
217
99
218
- /* * Get the relevant information for an active non secondary PDP context.
219
- *
220
- * @remark optional params are not updated if not received from network.
221
- *
222
- * @param params_list reference to linked list which is filled on successful call
223
- * @return 0 on success, negative error code on failure
224
- */
225
- virtual nsapi_error_t get_pdpcontext_params (pdpContextList_t& params_list);
226
-
227
- /* * Get extended signal quality parameters.
228
- *
229
- * @param rxlev signal strength level
230
- * @param ber bit error rate
231
- * @param rscp signal code power
232
- * @param ecno ratio of the received energy per PN chip to the total received power spectral density
233
- * @param rsrq signal received quality
234
- * @param rsrp signal received power
235
- * @return NSAPI_ERROR_OK on success, negative error code on failure
236
- */
237
100
virtual nsapi_error_t get_extended_signal_quality (int &rxlev, int &ber, int &rscp, int &ecno, int &rsrq, int &rsrp);
238
101
239
- /* * Get signal quality parameters.
240
- *
241
- * @param rssi signal strength level
242
- * @param ber bit error rate
243
- * @return NSAPI_ERROR_OK on success, negative error code on failure
244
- */
245
102
virtual nsapi_error_t get_signal_quality (int &rssi, int &ber);
246
103
247
- /* * Get cell id.
248
- *
249
- * @param cell_id cell id
250
- * @return NSAPI_ERROR_OK on success, negative error code on failure
251
- */
252
104
virtual nsapi_error_t get_cell_id (int &cell_id);
253
105
254
- /* * Get the last 3GPP error code
255
- * @return see 3GPP TS 27.007 error codes
256
- */
257
106
virtual int get_3gpp_error ();
258
107
259
- /* * Get the operator params
260
- *
261
- * @param format format of the operator field
262
- * @param operator_params applicable operator param fields filled
263
- * @return NSAPI_ERROR_OK on success, negative error code on failure
264
- */
265
108
virtual nsapi_error_t get_operator_params (int &format, operator_t &operator_params);
266
109
267
110
protected:
@@ -279,7 +122,7 @@ class AT_CellularNetwork : public CellularNetwork, public AT_CellularBase
279
122
*/
280
123
virtual bool has_registration (RegistrationType reg_type);
281
124
282
- /* * Sets access technology to be scanned.
125
+ /* * Sets access technology to be scanned. Modem specific implementation.
283
126
*
284
127
* @param op_rat Access technology
285
128
*
0 commit comments