MBED_DEPRECATED_SINCE taken into use

pull/6264/head
Antti Kauppila 2018-03-12 19:38:58 +02:00 committed by Teppo Järvelin
parent 7fd6b71337
commit 783d0c58f5
7 changed files with 37 additions and 18 deletions

View File

@ -19,19 +19,17 @@
#include "netsocket/NetworkInterface.h"
/** CellularInterface class
*
* Common interface that is shared between ethernet hardware
* @addtogroup netsocket
*
* @attention CellularInterface API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
class CellularInterface : public NetworkInterface
{
public:
/** CellularInterface lifetime
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual ~CellularInterface() {};
/** Set the cellular network APN and credentials
@ -41,6 +39,7 @@ public:
* @param password Optional password fot the APN
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t set_credentials(const char *apn,
const char *username = 0, const char *password = 0) = 0;
@ -51,6 +50,7 @@ public:
* @param password Optional password for your APN
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t connect(const char *apn,
const char *username = 0, const char *password = 0) = 0;
@ -60,12 +60,14 @@ public:
*
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t connect() = 0;
/** Stop the interface
*
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t disconnect() = 0;
};

View File

@ -24,8 +24,8 @@
/**
* OnboardCellularInterface is an on-board specific implementation.
*
* @attention This API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
OnboardCellularInterface::OnboardCellularInterface(bool debug) :
UARTCellularInterface(MDMTXD, MDMRXD, MDMDCD, MDMRTS,
MDMCTS, MDMRI, MDMDTR, MDMDSR,

View File

@ -31,15 +31,16 @@ typedef mbed::EasyCellularConnection OnboardCellularInterface;
* Depending on the type of on-board modem, OnboardCellularInterface
* could be derived from different implementation classes.
* Portable applications should only rely on it being a CellularBase.
*
* @attention This API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
class OnboardCellularInterface : public UARTCellularInterface {
public:
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
OnboardCellularInterface(bool debug = false);
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual ~OnboardCellularInterface();
protected:
@ -48,6 +49,7 @@ protected:
* modem_init() is equivalent to plugging in the device, for example, attaching power and serial port.
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void modem_init();
/** Sets the modem in unplugged state
@ -56,6 +58,7 @@ protected:
* and serial port. This puts the modem in lowest power state.
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void modem_deinit();
/** Powers up the modem
@ -64,6 +67,7 @@ protected:
* The driver may repeat this if the modem is not responsive to AT commands.
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void modem_power_up();
/** Powers down the modem
@ -71,6 +75,7 @@ protected:
* modem_power_down() is equivalent to turning off the modem by button press.
* Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void modem_power_down();
};

View File

@ -14,10 +14,6 @@
*/
#include "PPPCellularInterface.h"
/**
* @attention This API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
#if NSAPI_PPP_AVAILABLE
#include <string.h>

View File

@ -98,9 +98,8 @@ typedef struct {
* The driver will work with any generic FileHandle, and can be
* derived from in order to provide forms for specific interfaces, as well as
* adding extra power and reset controls alongside the FileHandle.
*
* @attention This API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
class PPPCellularInterface : public CellularBase {
public:
@ -110,8 +109,10 @@ public:
* The file handle pointer is not accessed within the constructor, only recorded for later
* use - this permits a derived class to pass a pointer to a not-yet-constructed member object.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
PPPCellularInterface(FileHandle *fh, bool debug = false);
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual ~PPPCellularInterface();
/** Set the Cellular network credentials
@ -122,6 +123,7 @@ public:
* @param uname optionally, Username
* @param pwd optionally, password
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void set_credentials(const char *apn, const char *uname = 0,
const char *pwd = 0);
@ -129,6 +131,7 @@ public:
*
* @param sim_pin PIN for the SIM card
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void set_sim_pin(const char *sim_pin);
/** Start the interface
@ -146,6 +149,7 @@ public:
* @param pwd optionally, password
* @return NSAPI_ERROR_OK on success, or negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t connect(const char *sim_pin, const char *apn = 0,
const char *uname = 0, const char *pwd = 0);
@ -169,6 +173,7 @@ public:
* Preferred method is to setup APN using 'set_credentials()' API.
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t connect();
/** Attempt to disconnect from the network
@ -178,6 +183,7 @@ public:
*
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t disconnect();
/** Adds or removes a SIM facility lock
@ -190,6 +196,7 @@ public:
* @param set can be set to true if the SIM pin check is supposed to be enabled
* and vice versa.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
void set_sim_pin_check(bool set);
/** Change the pin for the SIM card
@ -200,6 +207,7 @@ public:
*
* @param new_pin new pin to be used in string format
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
void set_new_sim_pin(const char *new_pin);
/** Check if the connection is currently established or not
@ -208,6 +216,7 @@ public:
* connected to an external packet data network using PPP, isConnected()
* API returns true and false otherwise.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual bool is_connected();
/** Get the local IP address
@ -215,6 +224,7 @@ public:
* @return Null-terminated representation of the local IP address
* or null if no IP address has been recieved
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual const char *get_ip_address();
/** Get the local network mask
@ -222,6 +232,7 @@ public:
* @return Null-terminated representation of the local network mask
* or null if no network mask has been recieved
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual const char *get_netmask();
/** Get the local gateways
@ -229,6 +240,7 @@ public:
* @return Null-terminated representation of the local gateway
* or null if no network mask has been recieved
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual const char *get_gateway();
@ -236,18 +248,21 @@ public:
*
* @param on set true to enable debug traces
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
void modem_debug_on(bool on);
/** Register callback for status reporting
*
* @param status_cb The callback for status changes
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void attach(Callback<void(nsapi_event_t, intptr_t)> status_cb);
/** Get the connection status
*
* @return The connection status according to nsapi_connection_status_t
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_connection_status_t get_connection_status() const;
/** Set blocking status of connect() which by default should be blocking
@ -255,6 +270,7 @@ public:
* @param blocking true if connect is blocking
* @return 0 on success, negative error code on failure
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual nsapi_error_t set_blocking(bool blocking);
private:

View File

@ -14,9 +14,7 @@
*/
#include "UARTCellularInterface.h"
/**
* @attention UARTCellularInterface API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
#if NSAPI_PPP_AVAILABLE
UARTCellularInterface::UARTCellularInterface(PinName txd, PinName rxd, PinName dcd, PinName rts, PinName cts, PinName ri,

View File

@ -28,18 +28,19 @@
*
* It constructs a FileHandle and passes it back to its base class as well as overrides
* enable_hup() in the base class.
*
* @attention UARTCellularInterface API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
class UARTCellularInterface : public PPPCellularInterface {
public:
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
UARTCellularInterface(PinName tx, PinName rx, PinName dcd = NC, PinName rts = NC, PinName cts = NC, PinName ri = NC,
PinName dtr = NC, PinName dsr = NC, int baud = MBED_CONF_PPP_CELL_IFACE_BAUD_RATE,
bool active_high = false,
bool debug = false);
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual ~UARTCellularInterface();
private:
@ -55,6 +56,7 @@ protected:
* signaling is not desired. enable_hup() controls whether this function should be
* active.
*/
MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API instead.")
virtual void enable_hup(bool enable);
};