Skip to content

Deprecated warnings for feature/netsocket/cellular #6264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion features/cellular/framework/API/CellularNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#ifndef CELLULAR_NETWORK_H_
#define CELLULAR_NETWORK_H_

#include "CellularInterface.h"
#include "NetworkInterface.h"
#include "CellularList.h"

Expand Down
6 changes: 5 additions & 1 deletion features/netsocket/CellularInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include "netsocket/NetworkInterface.h"


/** CellularInterface class
*
* Common interface that is shared between ethernet hardware
Expand All @@ -30,6 +29,7 @@ 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/CellularNetwork.h instead.")
virtual ~CellularInterface() {};

/** Set the cellular network APN and credentials
Expand All @@ -39,6 +39,7 @@ class CellularInterface : public NetworkInterface
* @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/CellularNetwork.h instead.")
virtual nsapi_error_t set_credentials(const char *apn,
const char *username = 0, const char *password = 0) = 0;

Expand All @@ -49,6 +50,7 @@ class CellularInterface : public NetworkInterface
* @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/CellularNetwork.h instead.")
virtual nsapi_error_t connect(const char *apn,
const char *username = 0, const char *password = 0) = 0;

Expand All @@ -58,12 +60,14 @@ class CellularInterface : public NetworkInterface
*
* @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/CellularNetwork.h 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/CellularNetwork.h instead.")
virtual nsapi_error_t disconnect() = 0;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

/**
* OnboardCellularInterface is an on-board specific implementation.
*
*/

OnboardCellularInterface::OnboardCellularInterface(bool debug) :
UARTCellularInterface(MDMTXD, MDMRXD, MDMDCD, MDMRTS,
MDMCTS, MDMRI, MDMDTR, MDMDSR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ typedef mbed::EasyCellularConnection OnboardCellularInterface;
* could be derived from different implementation classes.
* Portable applications should only rely on it being a CellularBase.
*/

class OnboardCellularInterface : public UARTCellularInterface {

public:

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

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

protected:
Expand All @@ -46,6 +49,7 @@ class OnboardCellularInterface : public UARTCellularInterface {
* 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/CellularPower.h instead.")
virtual void modem_init();

/** Sets the modem in unplugged state
Expand All @@ -54,6 +58,7 @@ class OnboardCellularInterface : public UARTCellularInterface {
* 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/CellularPower.h instead.")
virtual void modem_deinit();

/** Powers up the modem
Expand All @@ -62,13 +67,15 @@ class OnboardCellularInterface : public UARTCellularInterface {
* 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/CellularPower.h instead.")
virtual void modem_power_up();

/** Powers down the modem
*
* 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/CellularPower.h instead.")
virtual void modem_power_down();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <string.h>
#include "nsapi_ppp.h"
#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
#include "utils/APN_db.h"
#include "APN_db.h"
#endif //MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
#if defined(FEATURE_COMMON_PAL)
#include "mbed_trace.h"
Expand Down Expand Up @@ -570,12 +570,12 @@ nsapi_error_t PPPCellularInterface::connect()
user_specified_apn = true;
#endif
}

if (is_connected()) {
return NSAPI_ERROR_IS_CONNECTED;
} else if (_connect_status == NSAPI_STATUS_CONNECTING) {
return NSAPI_ERROR_ALREADY;
}
}

_connect_status = NSAPI_STATUS_CONNECTING;
if (_connection_status_cb) {
Expand Down Expand Up @@ -677,7 +677,7 @@ nsapi_error_t PPPCellularInterface::connect()
}

tr_info("The APN being used is %s.\n", _apn);

/* Attempt to enter data mode */
success = set_atd(_at); //enter into Data mode with the modem
if (!success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ typedef struct {
* derived from in order to provide forms for specific interfaces, as well as
* adding extra power and reset controls alongside the FileHandle.
*/

class PPPCellularInterface : public CellularBase {

public:
Expand All @@ -108,8 +109,10 @@ class PPPCellularInterface : public CellularBase {
* 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/easy_cellular/EasyCellularConnection.h instead.")
PPPCellularInterface(FileHandle *fh, bool debug = false);

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

/** Set the Cellular network credentials
Expand All @@ -120,13 +123,15 @@ class PPPCellularInterface : public CellularBase {
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual void set_credentials(const char *apn, const char *uname = 0,
const char *pwd = 0);

/** Set the pin code for 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/easy_cellular/EasyCellularConnection.h instead.")
virtual void set_sim_pin(const char *sim_pin);

/** Start the interface
Expand All @@ -144,6 +149,7 @@ class PPPCellularInterface : public CellularBase {
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual nsapi_error_t connect(const char *sim_pin, const char *apn = 0,
const char *uname = 0, const char *pwd = 0);

Expand All @@ -167,6 +173,7 @@ class PPPCellularInterface : public CellularBase {
* 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/easy_cellular/EasyCellularConnection.h instead.")
virtual nsapi_error_t connect();

/** Attempt to disconnect from the network
Expand All @@ -176,6 +183,7 @@ class PPPCellularInterface : public CellularBase {
*
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual nsapi_error_t disconnect();

/** Adds or removes a SIM facility lock
Expand All @@ -188,6 +196,7 @@ class PPPCellularInterface : public CellularBase {
* @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/easy_cellular/EasyCellularConnection.h instead.")
void set_sim_pin_check(bool set);

/** Change the pin for the SIM card
Expand All @@ -198,6 +207,7 @@ class PPPCellularInterface : public CellularBase {
*
* @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/easy_cellular/EasyCellularConnection.h instead.")
void set_new_sim_pin(const char *new_pin);

/** Check if the connection is currently established or not
Expand All @@ -206,53 +216,61 @@ class PPPCellularInterface : public CellularBase {
* 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/easy_cellular/EasyCellularConnection.h instead.")
virtual bool is_connected();

/** Get the local IP address
*
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual const char *get_ip_address();

/** Get the local network mask
*
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual const char *get_netmask();

/** Get the local gateways
*
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual const char *get_gateway();


/** Turn modem debug traces on
*
* @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/easy_cellular/EasyCellularConnection.h 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/easy_cellular/EasyCellularConnection.h 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/easy_cellular/EasyCellularConnection.h instead.")
virtual nsapi_connection_status_t get_connection_status() const;

/** Set blocking status of connect() which by default should be blocking
*
* @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/easy_cellular/EasyCellularConnection.h instead.")
virtual nsapi_error_t set_blocking(bool blocking);

private:
Expand All @@ -274,7 +292,7 @@ class PPPCellularInterface : public CellularBase {
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#include "UARTCellularInterface.h"


#if NSAPI_PPP_AVAILABLE

UARTCellularInterface::UARTCellularInterface(PinName txd, PinName rxd, PinName dcd, PinName rts, PinName cts, PinName ri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@
* It constructs a FileHandle and passes it back to its base class as well as overrides
* enable_hup() in the base class.
*/

class UARTCellularInterface : public PPPCellularInterface {

public:

MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h 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/easy_cellular/EasyCellularConnection.h instead.")
virtual ~UARTCellularInterface();

private:
Expand All @@ -53,6 +56,7 @@ class UARTCellularInterface : public PPPCellularInterface {
* 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/easy_cellular/EasyCellularConnection.h instead.")
virtual void enable_hup(bool enable);
};

Expand Down
2 changes: 1 addition & 1 deletion features/netsocket/nsapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "netsocket/NetworkInterface.h"
#include "netsocket/EthInterface.h"
#include "netsocket/WiFiInterface.h"
#include "netsocket/CellularInterface.h"
#include "netsocket/CellularBase.h"
#include "netsocket/MeshInterface.h"

#include "netsocket/Socket.h"
Expand Down