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

View File

@ -24,8 +24,8 @@
/** /**
* OnboardCellularInterface is an on-board specific implementation. * 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) : OnboardCellularInterface::OnboardCellularInterface(bool debug) :
UARTCellularInterface(MDMTXD, MDMRXD, MDMDCD, MDMRTS, UARTCellularInterface(MDMTXD, MDMRXD, MDMDCD, MDMRTS,
MDMCTS, MDMRI, MDMDTR, MDMDSR, MDMCTS, MDMRI, MDMDTR, MDMDSR,

View File

@ -31,15 +31,16 @@ typedef mbed::EasyCellularConnection OnboardCellularInterface;
* Depending on the type of on-board modem, OnboardCellularInterface * Depending on the type of on-board modem, OnboardCellularInterface
* could be derived from different implementation classes. * could be derived from different implementation classes.
* Portable applications should only rely on it being a CellularBase. * 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 { class OnboardCellularInterface : public UARTCellularInterface {
public: 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); 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(); virtual ~OnboardCellularInterface();
protected: protected:
@ -48,6 +49,7 @@ protected:
* modem_init() is equivalent to plugging in the device, for example, attaching power and serial port. * 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. * 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(); virtual void modem_init();
/** Sets the modem in unplugged state /** Sets the modem in unplugged state
@ -56,6 +58,7 @@ protected:
* and serial port. This puts the modem in lowest power state. * 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. * 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(); virtual void modem_deinit();
/** Powers up the modem /** Powers up the modem
@ -64,6 +67,7 @@ protected:
* The driver may repeat this if the modem is not responsive to AT commands. * 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. * 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(); virtual void modem_power_up();
/** Powers down the modem /** Powers down the modem
@ -71,6 +75,7 @@ protected:
* modem_power_down() is equivalent to turning off the modem by button press. * 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. * 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(); virtual void modem_power_down();
}; };

View File

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

View File

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

View File

@ -14,9 +14,7 @@
*/ */
#include "UARTCellularInterface.h" #include "UARTCellularInterface.h"
/**
* @attention UARTCellularInterface API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/
#if NSAPI_PPP_AVAILABLE #if NSAPI_PPP_AVAILABLE
UARTCellularInterface::UARTCellularInterface(PinName txd, PinName rxd, PinName dcd, PinName rts, PinName cts, PinName ri, 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 * It constructs a FileHandle and passes it back to its base class as well as overrides
* enable_hup() in the base class. * enable_hup() in the base class.
*
* @attention UARTCellularInterface API will be deprecated, use mbed-os/features/cellular/framework/API instead.
*/ */
class UARTCellularInterface : public PPPCellularInterface { class UARTCellularInterface : public PPPCellularInterface {
public: 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, 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, PinName dtr = NC, PinName dsr = NC, int baud = MBED_CONF_PPP_CELL_IFACE_BAUD_RATE,
bool active_high = false, bool active_high = false,
bool debug = 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(); virtual ~UARTCellularInterface();
private: private:
@ -55,6 +56,7 @@ protected:
* signaling is not desired. enable_hup() controls whether this function should be * signaling is not desired. enable_hup() controls whether this function should be
* active. * 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); virtual void enable_hup(bool enable);
}; };