Skip to content

Commit 7c30faf

Browse files
authored
Merge pull request #6264 from jarvte/master
Deprecated warnings for feature/netsocket/cellular
2 parents 1aa78d1 + 53455c5 commit 7c30faf

File tree

10 files changed

+43
-8
lines changed

10 files changed

+43
-8
lines changed

features/cellular/framework/API/CellularNetwork.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef CELLULAR_NETWORK_H_
1919
#define CELLULAR_NETWORK_H_
2020

21-
#include "CellularInterface.h"
2221
#include "NetworkInterface.h"
2322
#include "CellularList.h"
2423

features/netsocket/CellularInterface.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "netsocket/NetworkInterface.h"
2121

22-
2322
/** CellularInterface class
2423
*
2524
* Common interface that is shared between ethernet hardware
@@ -30,6 +29,7 @@ class CellularInterface : public NetworkInterface
3029
public:
3130
/** CellularInterface lifetime
3231
*/
32+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
3333
virtual ~CellularInterface() {};
3434

3535
/** Set the cellular network APN and credentials
@@ -39,6 +39,7 @@ class CellularInterface : public NetworkInterface
3939
* @param password Optional password fot the APN
4040
* @return 0 on success, negative error code on failure
4141
*/
42+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
4243
virtual nsapi_error_t set_credentials(const char *apn,
4344
const char *username = 0, const char *password = 0) = 0;
4445

@@ -49,6 +50,7 @@ class CellularInterface : public NetworkInterface
4950
* @param password Optional password for your APN
5051
* @return 0 on success, negative error code on failure
5152
*/
53+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
5254
virtual nsapi_error_t connect(const char *apn,
5355
const char *username = 0, const char *password = 0) = 0;
5456

@@ -58,12 +60,14 @@ class CellularInterface : public NetworkInterface
5860
*
5961
* @return 0 on success, negative error code on failure
6062
*/
63+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
6164
virtual nsapi_error_t connect() = 0;
6265

6366
/** Stop the interface
6467
*
6568
* @return 0 on success, negative error code on failure
6669
*/
70+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
6771
virtual nsapi_error_t disconnect() = 0;
6872
};
6973

features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323

2424
/**
2525
* OnboardCellularInterface is an on-board specific implementation.
26+
*
2627
*/
28+
2729
OnboardCellularInterface::OnboardCellularInterface(bool debug) :
2830
UARTCellularInterface(MDMTXD, MDMRXD, MDMDCD, MDMRTS,
2931
MDMCTS, MDMRI, MDMDTR, MDMDSR,

features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ typedef mbed::EasyCellularConnection OnboardCellularInterface;
3232
* could be derived from different implementation classes.
3333
* Portable applications should only rely on it being a CellularBase.
3434
*/
35+
3536
class OnboardCellularInterface : public UARTCellularInterface {
3637

3738
public:
3839

40+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularPower.h instead.")
3941
OnboardCellularInterface(bool debug = false);
4042

43+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularPower.h instead.")
4144
virtual ~OnboardCellularInterface();
4245

4346
protected:
@@ -46,6 +49,7 @@ class OnboardCellularInterface : public UARTCellularInterface {
4649
* modem_init() is equivalent to plugging in the device, for example, attaching power and serial port.
4750
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
4851
*/
52+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularPower.h instead.")
4953
virtual void modem_init();
5054

5155
/** Sets the modem in unplugged state
@@ -54,6 +58,7 @@ class OnboardCellularInterface : public UARTCellularInterface {
5458
* and serial port. This puts the modem in lowest power state.
5559
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
5660
*/
61+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularPower.h instead.")
5762
virtual void modem_deinit();
5863

5964
/** Powers up the modem
@@ -62,13 +67,15 @@ class OnboardCellularInterface : public UARTCellularInterface {
6267
* The driver may repeat this if the modem is not responsive to AT commands.
6368
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
6469
*/
70+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularPower.h instead.")
6571
virtual void modem_power_up();
6672

6773
/** Powers down the modem
6874
*
6975
* modem_power_down() is equivalent to turning off the modem by button press.
7076
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
7177
*/
78+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularPower.h instead.")
7279
virtual void modem_power_down();
7380
};
7481

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <string.h>
2020
#include "nsapi_ppp.h"
2121
#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
22-
#include "utils/APN_db.h"
22+
#include "APN_db.h"
2323
#endif //MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
2424
#if defined(FEATURE_COMMON_PAL)
2525
#include "mbed_trace.h"
@@ -570,12 +570,12 @@ nsapi_error_t PPPCellularInterface::connect()
570570
user_specified_apn = true;
571571
#endif
572572
}
573-
573+
574574
if (is_connected()) {
575575
return NSAPI_ERROR_IS_CONNECTED;
576576
} else if (_connect_status == NSAPI_STATUS_CONNECTING) {
577577
return NSAPI_ERROR_ALREADY;
578-
}
578+
}
579579

580580
_connect_status = NSAPI_STATUS_CONNECTING;
581581
if (_connection_status_cb) {
@@ -677,7 +677,7 @@ nsapi_error_t PPPCellularInterface::connect()
677677
}
678678

679679
tr_info("The APN being used is %s.\n", _apn);
680-
680+
681681
/* Attempt to enter data mode */
682682
success = set_atd(_at); //enter into Data mode with the modem
683683
if (!success) {

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ typedef struct {
9999
* derived from in order to provide forms for specific interfaces, as well as
100100
* adding extra power and reset controls alongside the FileHandle.
101101
*/
102+
102103
class PPPCellularInterface : public CellularBase {
103104

104105
public:
@@ -108,8 +109,10 @@ class PPPCellularInterface : public CellularBase {
108109
* The file handle pointer is not accessed within the constructor, only recorded for later
109110
* use - this permits a derived class to pass a pointer to a not-yet-constructed member object.
110111
*/
112+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
111113
PPPCellularInterface(FileHandle *fh, bool debug = false);
112114

115+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
113116
virtual ~PPPCellularInterface();
114117

115118
/** Set the Cellular network credentials
@@ -120,13 +123,15 @@ class PPPCellularInterface : public CellularBase {
120123
* @param uname optionally, Username
121124
* @param pwd optionally, password
122125
*/
126+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
123127
virtual void set_credentials(const char *apn, const char *uname = 0,
124128
const char *pwd = 0);
125129

126130
/** Set the pin code for SIM card
127131
*
128132
* @param sim_pin PIN for the SIM card
129133
*/
134+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
130135
virtual void set_sim_pin(const char *sim_pin);
131136

132137
/** Start the interface
@@ -144,6 +149,7 @@ class PPPCellularInterface : public CellularBase {
144149
* @param pwd optionally, password
145150
* @return NSAPI_ERROR_OK on success, or negative error code on failure
146151
*/
152+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
147153
virtual nsapi_error_t connect(const char *sim_pin, const char *apn = 0,
148154
const char *uname = 0, const char *pwd = 0);
149155

@@ -167,6 +173,7 @@ class PPPCellularInterface : public CellularBase {
167173
* Preferred method is to setup APN using 'set_credentials()' API.
168174
* @return 0 on success, negative error code on failure
169175
*/
176+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
170177
virtual nsapi_error_t connect();
171178

172179
/** Attempt to disconnect from the network
@@ -176,6 +183,7 @@ class PPPCellularInterface : public CellularBase {
176183
*
177184
* @return 0 on success, negative error code on failure
178185
*/
186+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
179187
virtual nsapi_error_t disconnect();
180188

181189
/** Adds or removes a SIM facility lock
@@ -188,6 +196,7 @@ class PPPCellularInterface : public CellularBase {
188196
* @param set can be set to true if the SIM pin check is supposed to be enabled
189197
* and vice versa.
190198
*/
199+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
191200
void set_sim_pin_check(bool set);
192201

193202
/** Change the pin for the SIM card
@@ -198,6 +207,7 @@ class PPPCellularInterface : public CellularBase {
198207
*
199208
* @param new_pin new pin to be used in string format
200209
*/
210+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
201211
void set_new_sim_pin(const char *new_pin);
202212

203213
/** Check if the connection is currently established or not
@@ -206,53 +216,61 @@ class PPPCellularInterface : public CellularBase {
206216
* connected to an external packet data network using PPP, isConnected()
207217
* API returns true and false otherwise.
208218
*/
219+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
209220
virtual bool is_connected();
210221

211222
/** Get the local IP address
212223
*
213224
* @return Null-terminated representation of the local IP address
214225
* or null if no IP address has been received
215226
*/
227+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
216228
virtual const char *get_ip_address();
217229

218230
/** Get the local network mask
219231
*
220232
* @return Null-terminated representation of the local network mask
221233
* or null if no network mask has been received
222234
*/
235+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
223236
virtual const char *get_netmask();
224237

225238
/** Get the local gateways
226239
*
227240
* @return Null-terminated representation of the local gateway
228241
* or null if no network mask has been received
229242
*/
243+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
230244
virtual const char *get_gateway();
231245

232246

233247
/** Turn modem debug traces on
234248
*
235249
* @param on set true to enable debug traces
236250
*/
251+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
237252
void modem_debug_on(bool on);
238253

239254
/** Register callback for status reporting
240255
*
241256
* @param status_cb The callback for status changes
242257
*/
258+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
243259
virtual void attach(Callback<void(nsapi_event_t, intptr_t)> status_cb);
244260

245261
/** Get the connection status
246262
*
247263
* @return The connection status according to nsapi_connection_status_t
248264
*/
265+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
249266
virtual nsapi_connection_status_t get_connection_status() const;
250267

251268
/** Set blocking status of connect() which by default should be blocking
252269
*
253270
* @param blocking true if connect is blocking
254271
* @return 0 on success, negative error code on failure
255272
*/
273+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
256274
virtual nsapi_error_t set_blocking(bool blocking);
257275

258276
private:
@@ -274,7 +292,7 @@ class PPPCellularInterface : public CellularBase {
274292
nsapi_error_t initialize_sim_card();
275293
nsapi_error_t setup_context_and_credentials();
276294
bool power_up();
277-
void power_down();
295+
void power_down();
278296
void ppp_status_cb(nsapi_event_t, intptr_t);
279297

280298
protected:

features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515
#include "UARTCellularInterface.h"
1616

17+
1718
#if NSAPI_PPP_AVAILABLE
1819

1920
UARTCellularInterface::UARTCellularInterface(PinName txd, PinName rxd, PinName dcd, PinName rts, PinName cts, PinName ri,

features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@
2929
* It constructs a FileHandle and passes it back to its base class as well as overrides
3030
* enable_hup() in the base class.
3131
*/
32+
3233
class UARTCellularInterface : public PPPCellularInterface {
3334

3435
public:
3536

37+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
3638
UARTCellularInterface(PinName tx, PinName rx, PinName dcd = NC, PinName rts = NC, PinName cts = NC, PinName ri = NC,
3739
PinName dtr = NC, PinName dsr = NC, int baud = MBED_CONF_PPP_CELL_IFACE_BAUD_RATE,
3840
bool active_high = false,
3941
bool debug = false);
4042

43+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
4144
virtual ~UARTCellularInterface();
4245

4346
private:
@@ -53,6 +56,7 @@ class UARTCellularInterface : public PPPCellularInterface {
5356
* signaling is not desired. enable_hup() controls whether this function should be
5457
* active.
5558
*/
59+
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
5660
virtual void enable_hup(bool enable);
5761
};
5862

features/netsocket/nsapi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "netsocket/NetworkInterface.h"
3434
#include "netsocket/EthInterface.h"
3535
#include "netsocket/WiFiInterface.h"
36-
#include "netsocket/CellularInterface.h"
36+
#include "netsocket/CellularBase.h"
3737
#include "netsocket/MeshInterface.h"
3838

3939
#include "netsocket/Socket.h"

0 commit comments

Comments
 (0)