From 783d0c58f5e923ea13ed3c7168fb1f35aed2362f Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Mon, 12 Mar 2018 19:38:58 +0200 Subject: [PATCH] MBED_DEPRECATED_SINCE taken into use --- features/netsocket/CellularInterface.h | 8 ++++--- .../OnboardCellularInterface.cpp | 2 +- .../OnboardCellularInterface.h | 9 ++++++-- .../PPPCellularInterface.cpp | 4 ---- .../PPPCellularInterface.h | 22 ++++++++++++++++--- .../UARTCellularInterface.cpp | 4 +--- .../UARTCellularInterface.h | 6 +++-- 7 files changed, 37 insertions(+), 18 deletions(-) diff --git a/features/netsocket/CellularInterface.h b/features/netsocket/CellularInterface.h index de0a0e533d..cfcf2dd4c5 100644 --- a/features/netsocket/CellularInterface.h +++ b/features/netsocket/CellularInterface.h @@ -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; }; diff --git a/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.cpp b/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.cpp index 8aca57c76b..4857dc1a85 100644 --- a/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.cpp +++ b/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.cpp @@ -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, diff --git a/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h b/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h index 482ccb5bbf..140ef02440 100644 --- a/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h +++ b/features/netsocket/cellular/generic_modem_driver/OnboardCellularInterface.h @@ -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(); }; diff --git a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp index 0d8e39f2f2..76a5ed288f 100644 --- a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp +++ b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp @@ -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 diff --git a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h index e1bca0f1b3..309f2fd11e 100644 --- a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h +++ b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.h @@ -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 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: @@ -276,7 +292,7 @@ private: nsapi_error_t initialize_sim_card(); nsapi_error_t setup_context_and_credentials(); bool power_up(); - void power_down(); + void power_down(); void ppp_status_cb(nsapi_event_t, intptr_t); protected: diff --git a/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.cpp b/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.cpp index eace5a8d96..87ee0f3349 100644 --- a/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.cpp +++ b/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.cpp @@ -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, diff --git a/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h b/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h index ea6b8dc346..b1f4748e61 100644 --- a/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h +++ b/features/netsocket/cellular/generic_modem_driver/UARTCellularInterface.h @@ -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); };