mirror of https://github.com/ARMmbed/mbed-os.git
Cellular: Default modem drivers with FF_ARDUINO
parent
75caa75a96
commit
269d151b12
|
@ -135,7 +135,7 @@ void GEMALTO_CINTERION::init_module_ems31()
|
|||
_module = ModuleEMS31;
|
||||
}
|
||||
|
||||
#if MBED_CONF_GEMALTO_CINTERION_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_GEMALTO_CINTERION_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,13 +18,21 @@
|
|||
#ifndef GEMALTO_CINTERION_H_
|
||||
#define GEMALTO_CINTERION_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_GEMALTO_CINTERION_TX
|
||||
#define MBED_CONF_GEMALTO_CINTERION_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_GEMALTO_CINTERION_RX
|
||||
#define MBED_CONF_GEMALTO_CINTERION_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
||||
class GEMALTO_CINTERION : public AT_CellularDevice {
|
||||
public:
|
||||
|
||||
GEMALTO_CINTERION(FileHandle *fh);
|
||||
|
||||
/** Actual model of cellular module is needed to make AT command adaptation at runtime
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"name": "GEMALTO_CINTERION",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,15 +21,9 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
},
|
||||
"target_overrides": {
|
||||
"K64F": {
|
||||
"rx": "D0",
|
||||
"tx": "D1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,16 @@ GENERIC_AT3GPP::GENERIC_AT3GPP(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
GENERIC_AT3GPP::~GENERIC_AT3GPP()
|
||||
#if MBED_CONF_GENERIC_AT3GPP_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MBED_CONF_GENERIC_AT3GPP_TX, MBED_CONF_GENERIC_AT3GPP_RX, MBED_CONF_GENERIC_AT3GPP_BAUDRATE);
|
||||
#if defined (MBED_CONF_GENERIC_AT3GPP_RTS) && defined(MBED_CONF_GENERIC_AT3GPP_CTS)
|
||||
tr_info("GENERIC_AT3GPP flow control: RTS %d CTS %d", MBED_CONF_GENERIC_AT3GPP_RTS, MBED_CONF_GENERIC_AT3GPP_CTS);
|
||||
serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_GENERIC_AT3GPP_RTS, MBED_CONF_GENERIC_AT3GPP_CTS);
|
||||
#endif
|
||||
static GENERIC_AT3GPP device(&serial);
|
||||
return &device;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef GENERIC_AT3GPP_H_
|
||||
#define GENERIC_AT3GPP_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_GENERIC_AT3GPP_TX
|
||||
#define MBED_CONF_GENERIC_AT3GPP_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_GENERIC_AT3GPP_RX
|
||||
#define MBED_CONF_GENERIC_AT3GPP_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
@ -38,8 +47,6 @@ namespace mbed {
|
|||
class GENERIC_AT3GPP : public AT_CellularDevice {
|
||||
public:
|
||||
GENERIC_AT3GPP(FileHandle *fh);
|
||||
virtual ~GENERIC_AT3GPP();
|
||||
|
||||
};
|
||||
} // namespace mbed
|
||||
#endif // GENERIC_AT3GPP_H_
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "GENERIC_AT3GPP",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
"help": "RTS pin for serial connection",
|
||||
"value": null
|
||||
},
|
||||
"cts": {
|
||||
"help": "CTS pin for serial connection",
|
||||
"value": null
|
||||
},
|
||||
"baudrate" : {
|
||||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,16 +38,12 @@ SARA4_PPP::SARA4_PPP(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
SARA4_PPP::~SARA4_PPP()
|
||||
{
|
||||
}
|
||||
|
||||
AT_CellularNetwork *SARA4_PPP::open_network_impl(ATHandler &at)
|
||||
{
|
||||
return new SARA4_PPP_CellularNetwork(at);
|
||||
}
|
||||
|
||||
#if MBED_CONF_SARA4_PPP_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_SARA4_PPP_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef SARA4_PPP_H_
|
||||
#define SARA4_PPP_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_SARA4_PPP_TX
|
||||
#define MBED_CONF_SARA4_PPP_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_SARA4_PPP_RX
|
||||
#define MBED_CONF_SARA4_PPP_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
@ -26,7 +35,6 @@ class SARA4_PPP : public AT_CellularDevice {
|
|||
|
||||
public:
|
||||
SARA4_PPP(FileHandle *fh);
|
||||
virtual ~SARA4_PPP();
|
||||
|
||||
public: // CellularDevice
|
||||
virtual AT_CellularNetwork *open_network_impl(ATHandler &at);
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"name": "SARA4_PPP",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
|
|
|
@ -45,10 +45,6 @@ QUECTEL_BC95::QUECTEL_BC95(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
QUECTEL_BC95::~QUECTEL_BC95()
|
||||
{
|
||||
}
|
||||
|
||||
nsapi_error_t QUECTEL_BC95::get_sim_state(SimState &state)
|
||||
{
|
||||
_at->lock();
|
||||
|
@ -105,7 +101,7 @@ nsapi_error_t QUECTEL_BC95::reset()
|
|||
return _at->unlock_return_error();
|
||||
}
|
||||
|
||||
#if MBED_CONF_QUECTEL_BC95_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_QUECTEL_BC95_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef QUECTEL_BC95_H_
|
||||
#define QUECTEL_BC95_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_QUECTEL_BC95_TX
|
||||
#define MBED_CONF_QUECTEL_BC95_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_QUECTEL_BC95_RX
|
||||
#define MBED_CONF_QUECTEL_BC95_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
@ -25,7 +34,6 @@ namespace mbed {
|
|||
class QUECTEL_BC95 : public AT_CellularDevice {
|
||||
public:
|
||||
QUECTEL_BC95(FileHandle *fh);
|
||||
virtual ~QUECTEL_BC95();
|
||||
|
||||
public: // AT_CellularDevice
|
||||
virtual nsapi_error_t get_sim_state(SimState &state);
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"name": "QUECTEL_BC95",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 9600
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
|
|
|
@ -48,10 +48,6 @@ QUECTEL_BG96::QUECTEL_BG96(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
QUECTEL_BG96::~QUECTEL_BG96()
|
||||
{
|
||||
}
|
||||
|
||||
AT_CellularNetwork *QUECTEL_BG96::open_network_impl(ATHandler &at)
|
||||
{
|
||||
return new QUECTEL_BG96_CellularNetwork(at);
|
||||
|
@ -72,7 +68,7 @@ void QUECTEL_BG96::set_ready_cb(Callback<void()> callback)
|
|||
_at->set_urc_handler(DEVICE_READY_URC, callback);
|
||||
}
|
||||
|
||||
#if MBED_CONF_QUECTEL_BG96_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_QUECTEL_BG96_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef QUECTEL_BG96_H_
|
||||
#define QUECTEL_BG96_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_QUECTEL_BG96_TX
|
||||
#define MBED_CONF_QUECTEL_BG96_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_QUECTEL_BG96_RX
|
||||
#define MBED_CONF_QUECTEL_BG96_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
@ -25,7 +34,6 @@ namespace mbed {
|
|||
class QUECTEL_BG96 : public AT_CellularDevice {
|
||||
public:
|
||||
QUECTEL_BG96(FileHandle *fh);
|
||||
virtual ~QUECTEL_BG96();
|
||||
|
||||
protected: // AT_CellularDevice
|
||||
virtual AT_CellularNetwork *open_network_impl(ATHandler &at);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "QUECTEL_BB96",
|
||||
"name": "QUECTEL_BG96",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,15 +21,9 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
},
|
||||
"target_overrides": {
|
||||
"K64F": {
|
||||
"rx": "PTC16",
|
||||
"tx": "PTC17"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,16 +44,12 @@ QUECTEL_UG96::QUECTEL_UG96(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
QUECTEL_UG96::~QUECTEL_UG96()
|
||||
{
|
||||
}
|
||||
|
||||
AT_CellularContext *QUECTEL_UG96::create_context_impl(ATHandler &at, const char *apn, bool cp_req, bool nonip_req)
|
||||
{
|
||||
return new QUECTEL_UG96_CellularContext(at, this, apn, cp_req, nonip_req);
|
||||
}
|
||||
|
||||
#if MBED_CONF_QUECTEL_UG96_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_QUECTEL_UG96_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef QUECTEL_UG96_H_
|
||||
#define QUECTEL_UG96_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_QUECTEL_UG96_TX
|
||||
#define MBED_CONF_QUECTEL_UG96_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_QUECTEL_UG96_RX
|
||||
#define MBED_CONF_QUECTEL_UG96_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
@ -33,7 +42,6 @@ namespace mbed {
|
|||
class QUECTEL_UG96 : public AT_CellularDevice {
|
||||
public:
|
||||
QUECTEL_UG96(FileHandle *fh);
|
||||
virtual ~QUECTEL_UG96();
|
||||
|
||||
protected: // AT_CellularDevice
|
||||
virtual nsapi_error_t power_on();
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "QUECTEL_UB96",
|
||||
"name": "QUECTEL_UG96",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
|
|
|
@ -38,10 +38,6 @@ TELIT_HE910::TELIT_HE910(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
TELIT_HE910::~TELIT_HE910()
|
||||
{
|
||||
}
|
||||
|
||||
uint16_t TELIT_HE910::get_send_delay() const
|
||||
{
|
||||
return DEFAULT_DELAY_BETWEEN_AT_COMMANDS;
|
||||
|
@ -60,7 +56,7 @@ nsapi_error_t TELIT_HE910::init()
|
|||
return _at->unlock_return_error();
|
||||
}
|
||||
|
||||
#if MBED_CONF_TELIT_HE910_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_TELIT_HE910_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef CELLULAR_TARGETS_TELIT_HE910_TELIT_HE910_H_
|
||||
#define CELLULAR_TARGETS_TELIT_HE910_TELIT_HE910_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_TELIT_HE910_TX
|
||||
#define MBED_CONF_TELIT_HE910_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_TELIT_HE910_RX
|
||||
#define MBED_CONF_TELIT_HE910_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
//the delay between sending AT commands
|
||||
|
@ -28,7 +37,6 @@ namespace mbed {
|
|||
class TELIT_HE910 : public AT_CellularDevice {
|
||||
public:
|
||||
TELIT_HE910(FileHandle *fh);
|
||||
virtual ~TELIT_HE910();
|
||||
|
||||
protected: // AT_CellularDevice
|
||||
virtual uint16_t get_send_delay() const;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"name": "TELIT_HE910",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
|
|
|
@ -54,10 +54,6 @@ UBLOX_AT::UBLOX_AT(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
UBLOX_AT::~UBLOX_AT()
|
||||
{
|
||||
}
|
||||
|
||||
AT_CellularNetwork *UBLOX_AT::open_network_impl(ATHandler &at)
|
||||
{
|
||||
return new UBLOX_AT_CellularNetwork(at);
|
||||
|
@ -68,7 +64,7 @@ AT_CellularContext *UBLOX_AT::create_context_impl(ATHandler &at, const char *apn
|
|||
return new UBLOX_AT_CellularContext(at, this, apn, cp_req, nonip_req);
|
||||
}
|
||||
|
||||
#if MBED_CONF_UBLOX_AT_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_UBLOX_AT_PROVIDE_DEFAULT
|
||||
#include "UARTSerial.h"
|
||||
CellularDevice *CellularDevice::get_default_instance()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef UBLOX_AT_H_
|
||||
#define UBLOX_AT_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_UBLOX_AT_TX
|
||||
#define MBED_CONF_UBLOX_AT_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_UBLOX_AT_RX
|
||||
#define MBED_CONF_UBLOX_AT_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
@ -25,7 +34,6 @@ namespace mbed {
|
|||
class UBLOX_AT : public AT_CellularDevice {
|
||||
public:
|
||||
UBLOX_AT(FileHandle *fh);
|
||||
virtual ~UBLOX_AT();
|
||||
|
||||
protected: // AT_CellularDevice
|
||||
virtual nsapi_error_t power_on();
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"name": "UBLOX_AT",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ UBLOX_PPP::UBLOX_PPP(FileHandle *fh) : AT_CellularDevice(fh)
|
|||
AT_CellularBase::set_cellular_properties(cellular_properties);
|
||||
}
|
||||
|
||||
#if MBED_CONF_UBLOX_PPP_DEFAULT_CELLULAR_DEVICE
|
||||
#if MBED_CONF_UBLOX_PPP_PROVIDE_DEFAULT
|
||||
|
||||
#if !NSAPI_PPP_AVAILABLE
|
||||
#error Must define lwip.ppp-enabled
|
||||
|
|
|
@ -18,6 +18,15 @@
|
|||
#ifndef UBLOX_PPP_H_
|
||||
#define UBLOX_PPP_H_
|
||||
|
||||
#ifdef TARGET_FF_ARDUINO
|
||||
#ifndef MBED_CONF_UBLOX_PPP_TX
|
||||
#define MBED_CONF_UBLOX_PPP_TX D1
|
||||
#endif
|
||||
#ifndef MBED_CONF_UBLOX_PPP_RX
|
||||
#define MBED_CONF_UBLOX_PPP_RX D0
|
||||
#endif
|
||||
#endif /* TARGET_FF_ARDUINO */
|
||||
|
||||
#include "AT_CellularDevice.h"
|
||||
|
||||
namespace mbed {
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
"name": "UBLOX_PPP",
|
||||
"config": {
|
||||
"tx": {
|
||||
"help": "TX pin for serial connection",
|
||||
"help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rx": {
|
||||
"help": "RX pin for serial connection",
|
||||
"help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.",
|
||||
"value": null
|
||||
},
|
||||
"rts": {
|
||||
|
@ -21,7 +21,7 @@
|
|||
"help": "Serial connection baud rate",
|
||||
"value": 115200
|
||||
},
|
||||
"default-cellular-device": {
|
||||
"provide-default": {
|
||||
"help": "Provide as default CellularDevice [true/false]",
|
||||
"value": false
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ nsapi_error_t ONBOARD_UBLOX_PPP::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_UBLOX_PPP_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
#if DEVICE_SERIAL_FC
|
||||
if (MDMRTS != NC && MDMCTS != NC) {
|
||||
tr_info("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
|
||||
|
|
|
@ -24,10 +24,6 @@ ONBOARD_TELIT_HE910::ONBOARD_TELIT_HE910(FileHandle *fh) : TELIT_HE910(fh)
|
|||
{
|
||||
}
|
||||
|
||||
ONBOARD_TELIT_HE910::~ONBOARD_TELIT_HE910()
|
||||
{
|
||||
}
|
||||
|
||||
nsapi_error_t ONBOARD_TELIT_HE910::power_on()
|
||||
{
|
||||
::onboard_modem_init();
|
||||
|
@ -44,7 +40,7 @@ nsapi_error_t ONBOARD_TELIT_HE910::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_TELIT_HE910_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
static ONBOARD_TELIT_HE910 device(&serial);
|
||||
return &device;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace mbed {
|
|||
class ONBOARD_TELIT_HE910 : public TELIT_HE910 {
|
||||
public:
|
||||
ONBOARD_TELIT_HE910(FileHandle *fh);
|
||||
virtual ~ONBOARD_TELIT_HE910();
|
||||
|
||||
virtual nsapi_error_t power_on();
|
||||
virtual nsapi_error_t power_off();
|
||||
|
|
|
@ -41,7 +41,7 @@ nsapi_error_t ONBOARD_TELIT_HE910::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_SARA4_PPP_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
#if DEVICE_SERIAL_FC
|
||||
if (MDMRTS != NC && MDMCTS != NC) {
|
||||
tr_info("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
|
||||
|
|
|
@ -23,10 +23,10 @@ using namespace mbed;
|
|||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
#if defined(TARGET_UBLOX_C030_N211) || defined(TARGET_UBLOX_C030_R410M)
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_UBLOX_AT_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
static ONBOARD_UBLOX_AT device(&serial);
|
||||
#else
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_UBLOX_PPP_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
static ONBOARD_UBLOX_PPP device(&serial);
|
||||
#endif
|
||||
return &device;
|
||||
|
|
|
@ -45,7 +45,7 @@ nsapi_error_t ONBOARD_QUECTEL_BG96::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_QUECTEL_BG96_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
static ONBOARD_QUECTEL_BG96 device(&serial);
|
||||
return &device;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ nsapi_error_t ONBOARD_QUECTEL_BG96::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_QUECTEL_BG96_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
static ONBOARD_QUECTEL_BG96 device(&serial);
|
||||
return &device;
|
||||
}
|
||||
|
|
|
@ -25,10 +25,6 @@ ONBOARD_SARA4_PPP::ONBOARD_SARA4_PPP(FileHandle *fh) : SARA4_PPP(fh)
|
|||
{
|
||||
}
|
||||
|
||||
ONBOARD_SARA4_PPP::~ONBOARD_SARA4_PPP()
|
||||
{
|
||||
}
|
||||
|
||||
nsapi_error_t ONBOARD_SARA4_PPP::power_on()
|
||||
{
|
||||
::onboard_modem_init();
|
||||
|
@ -45,7 +41,7 @@ nsapi_error_t ONBOARD_SARA4_PPP::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_SARA4_PPP_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 115200);
|
||||
#if DEVICE_SERIAL_FC
|
||||
if (MDMRTS != NC && MDMCTS != NC) {
|
||||
tr_info("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace mbed {
|
|||
class ONBOARD_SARA4_PPP : public SARA4_PPP {
|
||||
public:
|
||||
ONBOARD_SARA4_PPP(FileHandle *fh);
|
||||
virtual ~ONBOARD_SARA4_PPP();
|
||||
|
||||
virtual nsapi_error_t power_on();
|
||||
virtual nsapi_error_t power_off();
|
||||
|
|
|
@ -42,7 +42,7 @@ nsapi_error_t ONBOARD_QUECTEL_BC95::power_off()
|
|||
|
||||
CellularDevice *CellularDevice::get_target_default_instance()
|
||||
{
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, MBED_CONF_QUECTEL_BC95_BAUDRATE);
|
||||
static UARTSerial serial(MDMTXD, MDMRXD, 9600);
|
||||
#if DEVICE_SERIAL_FC
|
||||
if (MDMRTS != NC && MDMCTS != NC) {
|
||||
tr_info("Modem flow control: RTS %d CTS %d", MDMRTS, MDMCTS);
|
||||
|
|
Loading…
Reference in New Issue