Changed UBLOX C027 to LISA-U

pull/6082/head
Ari Parkkila 2018-02-20 09:36:36 +02:00
parent b7bf83001d
commit 1df28b28c7
7 changed files with 45 additions and 41 deletions

View File

@ -28,9 +28,9 @@ namespace mbed {
#elif TARGET_MTB_MTS_DRAGONFLY
#define CELLULAR_DEVICE TELIT_HE910
#elif TARGET_UBLOX_C030
#define CELLULAR_DEVICE UBLOX_C027
#define CELLULAR_DEVICE UBLOX_LISA_U
#elif TARGET_UBLOX_C027
#define CELLULAR_DEVICE UBLOX_C027
#define CELLULAR_DEVICE UBLOX_LISA_U
#else
//#error Cellular target not defined, see cellular/targets.h
//#define CELLULAR_TARGET <target-modem>

View File

@ -15,33 +15,33 @@
* limitations under the License.
*/
#include "UBLOX_C027_CellularNetwork.h"
#include "UBLOX_C027_CellularPower.h"
#include "UBLOX_C027.h"
#include "UBLOX_LISA_U.h"
#include "UBLOX_LISA_U_CellularNetwork.h"
#include "UBLOX_LISA_U_CellularPower.h"
using namespace mbed;
using namespace events;
UBLOX_C027::UBLOX_C027(EventQueue &queue) : AT_CellularDevice(queue)
UBLOX_LISA_U::UBLOX_LISA_U(EventQueue &queue) : AT_CellularDevice(queue)
{
}
UBLOX_C027::~UBLOX_C027()
UBLOX_LISA_U::~UBLOX_LISA_U()
{
}
CellularNetwork *UBLOX_C027::open_network(FileHandle *fh)
CellularNetwork *UBLOX_LISA_U::open_network(FileHandle *fh)
{
if (!_network) {
_network = new UBLOX_C027_CellularNetwork(*get_at_handler(fh));
_network = new UBLOX_LISA_U_CellularNetwork(*get_at_handler(fh));
}
return _network;
}
CellularPower *UBLOX_C027::open_power(FileHandle *fh)
CellularPower *UBLOX_LISA_U::open_power(FileHandle *fh)
{
if (!_power) {
_power = new UBLOX_C027_CellularPower(*get_at_handler(fh));
_power = new UBLOX_LISA_U_CellularPower(*get_at_handler(fh));
}
return _power;
}

View File

@ -15,20 +15,20 @@
* limitations under the License.
*/
#ifndef UBLOX_C027_H_
#define UBLOX_C027_H_
#ifndef UBLOX_LISA_U_H_
#define UBLOX_LISA_U_H_
#include "AT_CellularDevice.h"
namespace mbed {
class UBLOX_C027 : public AT_CellularDevice
class UBLOX_LISA_U : public AT_CellularDevice
{
public:
UBLOX_C027(events::EventQueue &queue);
virtual ~UBLOX_C027();
UBLOX_LISA_U(events::EventQueue &queue);
virtual ~UBLOX_LISA_U();
public: // CellularDevice
virtual CellularNetwork *open_network(FileHandle *fh);
@ -37,4 +37,4 @@ public: // CellularDevice
public: // NetworkInterface
};
} // namespace mbed
#endif // UBLOX_C027_H_
#endif // UBLOX_LISA_U_H_

View File

@ -15,29 +15,29 @@
* limitations under the License.
*/
#include "UBLOX_C027_CellularNetwork.h"
#include "UBLOX_LISA_U_CellularNetwork.h"
using namespace mbed;
UBLOX_C027_CellularNetwork::UBLOX_C027_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
UBLOX_LISA_U_CellularNetwork::UBLOX_LISA_U_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
{
}
UBLOX_C027_CellularNetwork::~UBLOX_C027_CellularNetwork()
UBLOX_LISA_U_CellularNetwork::~UBLOX_LISA_U_CellularNetwork()
{
}
bool UBLOX_C027_CellularNetwork::get_modem_stack_type(nsapi_ip_stack_t requested_stack)
bool UBLOX_LISA_U_CellularNetwork::get_modem_stack_type(nsapi_ip_stack_t requested_stack)
{
return requested_stack == IPV4_STACK ? true : false;
}
bool UBLOX_C027_CellularNetwork::has_registration(RegistrationType reg_type)
bool UBLOX_LISA_U_CellularNetwork::has_registration(RegistrationType reg_type)
{
return (reg_type == C_REG || reg_type == C_GREG);
}
nsapi_error_t UBLOX_C027_CellularNetwork::set_access_technology_impl(operator_t::RadioAccessTechnology opRat)
nsapi_error_t UBLOX_LISA_U_CellularNetwork::set_access_technology_impl(operator_t::RadioAccessTechnology opRat)
{
_op_act = operator_t::RAT_UNKNOWN;
return NSAPI_ERROR_UNSUPPORTED;

View File

@ -15,18 +15,18 @@
* limitations under the License.
*/
#ifndef UBLOX_C027_CELLULAR_NETWORK_H_
#define UBLOX_C027_CELLULAR_NETWORK_H_
#ifndef UBLOX_LISA_U_CELLULAR_NETWORK_H_
#define UBLOX_LISA_U_CELLULAR_NETWORK_H_
#include "AT_CellularNetwork.h"
namespace mbed {
class UBLOX_C027_CellularNetwork : public AT_CellularNetwork
class UBLOX_LISA_U_CellularNetwork : public AT_CellularNetwork
{
public:
UBLOX_C027_CellularNetwork(ATHandler &atHandler);
virtual ~UBLOX_C027_CellularNetwork();
UBLOX_LISA_U_CellularNetwork(ATHandler &atHandler);
virtual ~UBLOX_LISA_U_CellularNetwork();
protected:
virtual bool get_modem_stack_type(nsapi_ip_stack_t requested_stack);
@ -48,5 +48,7 @@ protected:
*/
virtual nsapi_error_t set_access_technology_impl(operator_t::RadioAccessTechnology opRat);
};
} // namespace mbed
#endif // UBLOX_C027_CELLULAR_NETWORK_H_
#endif // UBLOX_LISA_U_CELLULAR_NETWORK_H_

View File

@ -15,23 +15,23 @@
* limitations under the License.
*/
#include "onboard_modem_api.h"
#include "UBLOX_LISA_U_CellularPower.h"
#include "UBLOX_C027_CellularPower.h"
#include "onboard_modem_api.h"
using namespace mbed;
UBLOX_C027_CellularPower::UBLOX_C027_CellularPower(ATHandler &atHandler) : AT_CellularPower(atHandler)
UBLOX_LISA_U_CellularPower::UBLOX_LISA_U_CellularPower(ATHandler &atHandler) : AT_CellularPower(atHandler)
{
}
UBLOX_C027_CellularPower::~UBLOX_C027_CellularPower()
UBLOX_LISA_U_CellularPower::~UBLOX_LISA_U_CellularPower()
{
}
nsapi_error_t UBLOX_C027_CellularPower::on()
nsapi_error_t UBLOX_LISA_U_CellularPower::on()
{
#if MODEM_ON_BOARD
::onboard_modem_init();
@ -40,7 +40,7 @@ nsapi_error_t UBLOX_C027_CellularPower::on()
return NSAPI_ERROR_OK;
}
nsapi_error_t UBLOX_C027_CellularPower::off()
nsapi_error_t UBLOX_LISA_U_CellularPower::off()
{
#if MODEM_ON_BOARD
::onboard_modem_power_down();

View File

@ -15,18 +15,18 @@
* limitations under the License.
*/
#ifndef UBLOX_C027_CELLULARPOWER_H_
#define UBLOX_C027_CELLULARPOWER_H_
#ifndef UBLOX_LISA_U_CELLULARPOWER_H_
#define UBLOX_LISA_U_CELLULARPOWER_H_
#include "AT_CellularPower.h"
namespace mbed {
class UBLOX_C027_CellularPower : public AT_CellularPower
class UBLOX_LISA_U_CellularPower : public AT_CellularPower
{
public:
UBLOX_C027_CellularPower(ATHandler &atHandler);
virtual ~UBLOX_C027_CellularPower();
UBLOX_LISA_U_CellularPower(ATHandler &atHandler);
virtual ~UBLOX_LISA_U_CellularPower();
public: //from CellularPower
/**
@ -41,5 +41,7 @@ public: //from CellularPower
*/
virtual nsapi_error_t off();
};
} // namespace mbed
#endif // UBLOX_C027_CELLULARPOWER_H_
#endif // UBLOX_LISA_U_CELLULARPOWER_H_