mirror of https://github.com/ARMmbed/mbed-os.git
Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).pull/12035/head
parent
9577b0853b
commit
d6a48b5124
|
@ -524,7 +524,7 @@ static void rf_if_reset_radio(void)
|
|||
#else
|
||||
rf->spi.frequency(MBED_CONF_ATMEL_RF_LOW_SPI_SPEED);
|
||||
#endif
|
||||
rf->IRQ.rise(0);
|
||||
rf->IRQ.rise(nullptr);
|
||||
rf->RST = 1;
|
||||
ThisThread::sleep_for(2);
|
||||
rf->RST = 0;
|
||||
|
|
|
@ -41,7 +41,7 @@ ESP8266::ESP8266(PinName tx, PinName rx, bool debug, PinName rts, PinName cts)
|
|||
: _sdk_v(-1, -1, -1),
|
||||
_at_v(-1, -1, -1),
|
||||
_tcp_passive(false),
|
||||
_callback(0),
|
||||
_callback(),
|
||||
_serial(tx, rx, MBED_CONF_ESP8266_SERIAL_BAUDRATE),
|
||||
_serial_rts(rts),
|
||||
_serial_cts(cts),
|
||||
|
|
|
@ -71,7 +71,7 @@ ESP8266Interface::ESP8266Interface()
|
|||
_connect_retval(NSAPI_ERROR_OK),
|
||||
_disconnect_retval(NSAPI_ERROR_OK),
|
||||
_conn_stat(NSAPI_STATUS_DISCONNECTED),
|
||||
_conn_stat_cb(NULL),
|
||||
_conn_stat_cb(),
|
||||
_global_event_queue(mbed_event_queue()), // Needs to be set before attaching event() to SIGIO
|
||||
_oob_event_id(0),
|
||||
_connect_event_id(0),
|
||||
|
@ -113,7 +113,7 @@ ESP8266Interface::ESP8266Interface(PinName tx, PinName rx, bool debug, PinName r
|
|||
_connect_retval(NSAPI_ERROR_OK),
|
||||
_disconnect_retval(NSAPI_ERROR_OK),
|
||||
_conn_stat(NSAPI_STATUS_DISCONNECTED),
|
||||
_conn_stat_cb(NULL),
|
||||
_conn_stat_cb(),
|
||||
_global_event_queue(mbed_event_queue()), // Needs to be set before attaching event() to SIGIO
|
||||
_oob_event_id(0),
|
||||
_connect_event_id(0),
|
||||
|
|
|
@ -216,7 +216,7 @@ public:
|
|||
/** Begin asynchronous write using 8bit buffer.
|
||||
*
|
||||
* The write operation ends with any of the enabled events and invokes
|
||||
* registered callback function (which can be NULL to not receive callback at all).
|
||||
* registered callback function (which can be empty to not receive callback at all).
|
||||
* Events that are not enabled by event argument are simply ignored.
|
||||
* Operation has to be ended explicitly by calling abort_write() when
|
||||
* no events are enabled.
|
||||
|
@ -233,7 +233,7 @@ public:
|
|||
/** Begin asynchronous write using 16bit buffer.
|
||||
*
|
||||
* The write operation ends with any of the enabled events and invokes
|
||||
* registered callback function (which can be NULL to not receive callback at all).
|
||||
* registered callback function (which can be empty to not receive callback at all).
|
||||
* Events that are not enabled by event argument are simply ignored.
|
||||
* Operation has to be ended explicitly by calling abort_write() when
|
||||
* no events are enabled.
|
||||
|
@ -256,7 +256,7 @@ public:
|
|||
/** Begin asynchronous reading using 8bit buffer.
|
||||
*
|
||||
* The read operation ends with any of the enabled events and invokes registered
|
||||
* callback function (which can be NULL to not receive callback at all).
|
||||
* callback function (which can be empty to not receive callback at all).
|
||||
* Events that are not enabled by event argument are simply ignored.
|
||||
* Operation has to be ended explicitly by calling abort_read() when
|
||||
* no events are enabled.
|
||||
|
@ -274,7 +274,7 @@ public:
|
|||
/** Begin asynchronous reading using 16bit buffer.
|
||||
*
|
||||
* The read operation ends with any of the enabled events and invokes registered
|
||||
* callback function (which can be NULL to not receive callback at all).
|
||||
* callback function (which can be empty to not receive callback at all).
|
||||
* Events that are not enabled by event argument are simply ignored.
|
||||
* Operation has to be ended explicitly by calling abort_read() when
|
||||
* no events are enabled.
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
*
|
||||
* @param cb Callback called when dispatch needs to be called
|
||||
*/
|
||||
PolledQueue(mbed::Callback<void()> cb = NULL);
|
||||
PolledQueue(mbed::Callback<void()> cb = nullptr);
|
||||
|
||||
virtual ~PolledQueue();
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
* @param callback Method pointer to be called when a packet is transferred
|
||||
* @returns true if successful, false otherwise
|
||||
*/
|
||||
bool endpoint_add(usb_ep_t endpoint, uint32_t max_packet, usb_ep_type_t type, mbed::Callback<void()> callback = NULL);
|
||||
bool endpoint_add(usb_ep_t endpoint, uint32_t max_packet, usb_ep_type_t type, mbed::Callback<void()> callback = nullptr);
|
||||
|
||||
/**
|
||||
* Add an endpoint
|
||||
|
|
|
@ -56,7 +56,7 @@ CAN::~CAN()
|
|||
|
||||
// Detaching interrupts releases the sleep lock if it was locked
|
||||
for (int irq = 0; irq < IrqCnt; irq++) {
|
||||
attach(NULL, (IrqType)irq);
|
||||
attach(nullptr, (IrqType)irq);
|
||||
}
|
||||
can_irq_free(&_can);
|
||||
can_free(&_can);
|
||||
|
@ -147,7 +147,7 @@ void CAN::attach(Callback<void()> func, IrqType type)
|
|||
if (_irq[(CanIrqType)type]) {
|
||||
sleep_manager_unlock_deep_sleep();
|
||||
}
|
||||
_irq[(CanIrqType)type] = NULL;
|
||||
_irq[(CanIrqType)type] = nullptr;
|
||||
can_irq_set(&_can, (CanIrqType)type, 0);
|
||||
}
|
||||
unlock();
|
||||
|
|
|
@ -26,8 +26,8 @@ namespace mbed {
|
|||
// constructor, with a default value for the PinMode.
|
||||
InterruptIn::InterruptIn(PinName pin) : gpio(),
|
||||
gpio_irq(),
|
||||
_rise(NULL),
|
||||
_fall(NULL)
|
||||
_rise(),
|
||||
_fall()
|
||||
{
|
||||
// No lock needed in the constructor
|
||||
irq_init(pin);
|
||||
|
@ -37,8 +37,8 @@ InterruptIn::InterruptIn(PinName pin) : gpio(),
|
|||
InterruptIn::InterruptIn(PinName pin, PinMode mode) :
|
||||
gpio(),
|
||||
gpio_irq(),
|
||||
_rise(NULL),
|
||||
_fall(NULL)
|
||||
_rise(),
|
||||
_fall()
|
||||
{
|
||||
// No lock needed in the constructor
|
||||
irq_init(pin);
|
||||
|
@ -76,7 +76,7 @@ void InterruptIn::rise(Callback<void()> func)
|
|||
_rise = func;
|
||||
gpio_irq_set(&gpio_irq, IRQ_RISE, 1);
|
||||
} else {
|
||||
_rise = NULL;
|
||||
_rise = nullptr;
|
||||
gpio_irq_set(&gpio_irq, IRQ_RISE, 0);
|
||||
}
|
||||
core_util_critical_section_exit();
|
||||
|
@ -89,7 +89,7 @@ void InterruptIn::fall(Callback<void()> func)
|
|||
_fall = func;
|
||||
gpio_irq_set(&gpio_irq, IRQ_FALL, 1);
|
||||
} else {
|
||||
_fall = NULL;
|
||||
_fall = nullptr;
|
||||
gpio_irq_set(&gpio_irq, IRQ_FALL, 0);
|
||||
}
|
||||
core_util_critical_section_exit();
|
||||
|
|
|
@ -151,14 +151,14 @@ SPI::~SPI()
|
|||
lock();
|
||||
/* Make sure a stale pointer isn't left in peripheral's owner field */
|
||||
if (_peripheral->owner == this) {
|
||||
_peripheral->owner = NULL;
|
||||
_peripheral->owner = nullptr;
|
||||
}
|
||||
unlock();
|
||||
}
|
||||
|
||||
SPI::spi_peripheral_s *SPI::_lookup(SPI::SPIName name)
|
||||
{
|
||||
SPI::spi_peripheral_s *result = NULL;
|
||||
SPI::spi_peripheral_s *result = nullptr;
|
||||
core_util_critical_section_enter();
|
||||
for (int idx = 0; idx < _peripherals_used; idx++) {
|
||||
if (_peripherals[idx].name == name) {
|
||||
|
|
|
@ -28,11 +28,11 @@ Serial::Serial(const serial_pinmap_t &static_pinmap, const char *name, int baud)
|
|||
{
|
||||
}
|
||||
|
||||
Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream(NULL)
|
||||
Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream()
|
||||
{
|
||||
}
|
||||
|
||||
Serial::Serial(const serial_pinmap_t &static_pinmap, int baud): SerialBase(static_pinmap, baud), Stream(NULL)
|
||||
Serial::Serial(const serial_pinmap_t &static_pinmap, int baud): SerialBase(static_pinmap, baud), Stream()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -34,21 +34,13 @@ SerialBase::SerialBase(PinName tx, PinName rx, int baud) :
|
|||
{
|
||||
// No lock needed in the constructor
|
||||
|
||||
for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
|
||||
_irq[i] = NULL;
|
||||
}
|
||||
|
||||
(this->*_init_func)();
|
||||
}
|
||||
|
||||
SerialBase::SerialBase(const serial_pinmap_t &static_pinmap, int baud) :
|
||||
#if DEVICE_SERIAL_ASYNCH
|
||||
_thunk_irq(this), _tx_usage(DMA_USAGE_NEVER),
|
||||
_rx_usage(DMA_USAGE_NEVER), _tx_callback(NULL),
|
||||
_rx_callback(NULL), _tx_asynch_set(false),
|
||||
_rx_asynch_set(false),
|
||||
_thunk_irq(this),
|
||||
#endif
|
||||
_serial(),
|
||||
_baud(baud),
|
||||
_tx_pin(static_pinmap.tx_pin),
|
||||
_rx_pin(static_pinmap.rx_pin),
|
||||
|
@ -57,10 +49,6 @@ SerialBase::SerialBase(const serial_pinmap_t &static_pinmap, int baud) :
|
|||
{
|
||||
// No lock needed in the constructor
|
||||
|
||||
for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
|
||||
_irq[i] = NULL;
|
||||
}
|
||||
|
||||
(this->*_init_func)();
|
||||
}
|
||||
|
||||
|
@ -118,7 +106,7 @@ void SerialBase::attach(Callback<void()> func, IrqType type)
|
|||
if (_irq[type]) {
|
||||
sleep_manager_unlock_deep_sleep();
|
||||
}
|
||||
_irq[type] = NULL;
|
||||
_irq[type] = nullptr;
|
||||
serial_irq_set(&_serial, (SerialIrq)type, 0);
|
||||
}
|
||||
core_util_critical_section_exit();
|
||||
|
@ -187,7 +175,7 @@ void SerialBase::enable_input(bool enable)
|
|||
core_util_critical_section_enter();
|
||||
if (enable) {
|
||||
// Enable rx IRQ and lock deep sleep if a rx handler is attached
|
||||
// (indicated by rx IRQ callback not NULL)
|
||||
// (indicated by rx IRQ callback not empty)
|
||||
if (_irq[RxIrq]) {
|
||||
_irq[RxIrq].call();
|
||||
sleep_manager_lock_deep_sleep();
|
||||
|
@ -197,7 +185,7 @@ void SerialBase::enable_input(bool enable)
|
|||
// Disable rx IRQ
|
||||
serial_irq_set(&_serial, (SerialIrq)RxIrq, 0);
|
||||
// Unlock deep sleep if a rx handler is attached
|
||||
// (indicated by rx IRQ callback not NULL)
|
||||
// (indicated by rx IRQ callback not empty)
|
||||
if (_irq[RxIrq]) {
|
||||
sleep_manager_unlock_deep_sleep();
|
||||
}
|
||||
|
@ -224,7 +212,7 @@ void SerialBase::enable_output(bool enable)
|
|||
core_util_critical_section_enter();
|
||||
if (enable) {
|
||||
// Enable tx IRQ and lock deep sleep if a tx handler is attached
|
||||
// (indicated by tx IRQ callback not NULL)
|
||||
// (indicated by tx IRQ callback not empty)
|
||||
if (_irq[TxIrq]) {
|
||||
_irq[TxIrq].call();
|
||||
sleep_manager_lock_deep_sleep();
|
||||
|
@ -234,7 +222,7 @@ void SerialBase::enable_output(bool enable)
|
|||
// Disable tx IRQ
|
||||
serial_irq_set(&_serial, (SerialIrq)TxIrq, 0);
|
||||
// Unlock deep sleep if a tx handler is attached
|
||||
// (indicated by tx IRQ callback not NULL)
|
||||
// (indicated by tx IRQ callback not empty)
|
||||
if (_irq[TxIrq]) {
|
||||
sleep_manager_unlock_deep_sleep();
|
||||
}
|
||||
|
@ -297,7 +285,7 @@ SerialBase::~SerialBase()
|
|||
|
||||
// Detaching interrupts releases the sleep lock if it was locked
|
||||
for (int irq = 0; irq < IrqCnt; irq++) {
|
||||
attach(NULL, (IrqType)irq);
|
||||
attach(nullptr, (IrqType)irq);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -389,7 +377,7 @@ void SerialBase::abort_write(void)
|
|||
lock();
|
||||
core_util_critical_section_enter();
|
||||
if (_tx_asynch_set) {
|
||||
_tx_callback = NULL;
|
||||
_tx_callback = nullptr;
|
||||
_tx_asynch_set = false;
|
||||
serial_tx_abort_asynch(&_serial);
|
||||
sleep_manager_unlock_deep_sleep();
|
||||
|
@ -403,7 +391,7 @@ void SerialBase::abort_read(void)
|
|||
lock();
|
||||
core_util_critical_section_enter();
|
||||
if (_rx_asynch_set) {
|
||||
_rx_callback = NULL;
|
||||
_rx_callback = nullptr;
|
||||
_rx_asynch_set = false;
|
||||
serial_rx_abort_asynch(&_serial);
|
||||
sleep_manager_unlock_deep_sleep();
|
||||
|
@ -475,7 +463,7 @@ void SerialBase::interrupt_handler_asynch(void)
|
|||
if (_rx_asynch_set && rx_event) {
|
||||
event_callback_t cb = _rx_callback;
|
||||
_rx_asynch_set = false;
|
||||
_rx_callback = NULL;
|
||||
_rx_callback = nullptr;
|
||||
if (cb) {
|
||||
cb.call(rx_event);
|
||||
}
|
||||
|
@ -486,7 +474,7 @@ void SerialBase::interrupt_handler_asynch(void)
|
|||
if (_tx_asynch_set && tx_event) {
|
||||
event_callback_t cb = _tx_callback;
|
||||
_tx_asynch_set = false;
|
||||
_tx_callback = NULL;
|
||||
_tx_callback = nullptr;
|
||||
if (cb) {
|
||||
cb.call(tx_event);
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
namespace mbed {
|
||||
|
||||
Ticker::Ticker() : TimerEvent(), _delay(0), _function(0), _lock_deepsleep(true)
|
||||
Ticker::Ticker() : TimerEvent(), _delay(0), _lock_deepsleep(true)
|
||||
{
|
||||
}
|
||||
|
||||
// When low power ticker is in use, then do not disable deep sleep.
|
||||
Ticker::Ticker(const ticker_data_t *data) : TimerEvent(data), _delay(0), _function(0), _lock_deepsleep(!data->interface->runs_in_deep_sleep)
|
||||
Ticker::Ticker(const ticker_data_t *data) : TimerEvent(data), _delay(0), _lock_deepsleep(!data->interface->runs_in_deep_sleep)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ void UARTSerial::set_baud(int baud)
|
|||
void UARTSerial::set_data_carrier_detect(PinName dcd_pin, bool active_high)
|
||||
{
|
||||
delete _dcd_irq;
|
||||
_dcd_irq = NULL;
|
||||
_dcd_irq = nullptr;
|
||||
|
||||
if (dcd_pin != NC) {
|
||||
_dcd_irq = new InterruptIn(dcd_pin);
|
||||
|
@ -361,7 +361,7 @@ void UARTSerial::enable_rx_irq()
|
|||
|
||||
void UARTSerial::disable_rx_irq()
|
||||
{
|
||||
SerialBase::attach(NULL, RxIrq);
|
||||
SerialBase::attach(nullptr, RxIrq);
|
||||
_rx_irq_enabled = false;
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,7 @@ void UARTSerial::enable_tx_irq()
|
|||
|
||||
void UARTSerial::disable_tx_irq()
|
||||
{
|
||||
SerialBase::attach(NULL, TxIrq);
|
||||
SerialBase::attach(nullptr, TxIrq);
|
||||
_tx_irq_enabled = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,9 +85,9 @@ void AsyncOp::complete()
|
|||
core_util_critical_section_enter();
|
||||
|
||||
mbed::Callback<void()> cb = _callback;
|
||||
_callback = NULL;
|
||||
_list = NULL;
|
||||
if (_wait != NULL) {
|
||||
_callback = nullptr;
|
||||
_list = nullptr;
|
||||
if (_wait != nullptr) {
|
||||
_wait->release();
|
||||
}
|
||||
|
||||
|
@ -115,11 +115,11 @@ void AsyncOp::_abort(bool timeout)
|
|||
core_util_critical_section_enter();
|
||||
OperationListBase *list = _list;
|
||||
if (list) {
|
||||
_callback = NULL;
|
||||
_callback = nullptr;
|
||||
_aborted = true;
|
||||
_wait = NULL;
|
||||
_wait = nullptr;
|
||||
_timeout = timeout;
|
||||
_list = NULL;
|
||||
_list = nullptr;
|
||||
}
|
||||
core_util_critical_section_exit();
|
||||
if (list) {
|
||||
|
|
|
@ -1177,7 +1177,7 @@ void USBDevice::endpoint_remove(usb_ep_t endpoint)
|
|||
_phy->endpoint_abort(endpoint);
|
||||
}
|
||||
|
||||
info->callback = NULL;
|
||||
info->callback = nullptr;
|
||||
info->flags = 0;
|
||||
info->pending = 0;
|
||||
info->max_packet_size = 0;
|
||||
|
|
|
@ -53,10 +53,10 @@ AT_CellularDevice::AT_CellularDevice(FileHandle *fh) : CellularDevice(fh),
|
|||
AT_CellularDevice::~AT_CellularDevice()
|
||||
{
|
||||
if (get_property(PROPERTY_AT_CGEREP)) {
|
||||
_at->set_urc_handler("+CGEV: NW DEACT", 0);
|
||||
_at->set_urc_handler("+CGEV: ME DEACT", 0);
|
||||
_at->set_urc_handler("+CGEV: NW PDN D", 0);
|
||||
_at->set_urc_handler("+CGEV: ME PDN D", 0);
|
||||
_at->set_urc_handler("+CGEV: NW DEACT", nullptr);
|
||||
_at->set_urc_handler("+CGEV: ME DEACT", nullptr);
|
||||
_at->set_urc_handler("+CGEV: NW PDN D", nullptr);
|
||||
_at->set_urc_handler("+CGEV: ME PDN D", nullptr);
|
||||
}
|
||||
|
||||
// make sure that all is deleted even if somewhere close was not called and reference counting is messed up.
|
||||
|
|
|
@ -72,7 +72,7 @@ static const char *const rat_str[AT_CellularNetwork::RAT_MAX] = {
|
|||
|
||||
|
||||
AT_CellularNetwork::AT_CellularNetwork(ATHandler &atHandler, AT_CellularDevice &device) :
|
||||
_connection_status_cb(NULL), _ciotopt_network_support_cb(NULL), _op_act(RAT_UNKNOWN),
|
||||
_connection_status_cb(), _ciotopt_network_support_cb(), _op_act(RAT_UNKNOWN),
|
||||
_connect_status(NSAPI_STATUS_DISCONNECTED), _supported_network_opt(CIOT_OPT_MAX),
|
||||
_at(atHandler), _device(device)
|
||||
{
|
||||
|
@ -101,15 +101,15 @@ AT_CellularNetwork::~AT_CellularNetwork()
|
|||
(void)set_packet_domain_event_reporting(false);
|
||||
for (int type = 0; type < CellularNetwork::C_MAX; type++) {
|
||||
if (_device.get_property((AT_CellularDevice::CellularProperty)type) != RegistrationModeDisable) {
|
||||
_at.set_urc_handler(at_reg[type].urc_prefix, 0);
|
||||
_at.set_urc_handler(at_reg[type].urc_prefix, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (_device.get_property(AT_CellularDevice::PROPERTY_AT_CGEREP)) {
|
||||
_at.set_urc_handler("+CGEV: ME DET", 0);
|
||||
_at.set_urc_handler("+CGEV: NW DET", 0);
|
||||
_at.set_urc_handler("+CGEV: ME DET", nullptr);
|
||||
_at.set_urc_handler("+CGEV: NW DET", nullptr);
|
||||
}
|
||||
_at.set_urc_handler("+CCIOTOPTI:", 0);
|
||||
_at.set_urc_handler("+CCIOTOPTI:", nullptr);
|
||||
}
|
||||
|
||||
void AT_CellularNetwork::urc_cgev()
|
||||
|
|
|
@ -177,7 +177,7 @@ static const unsigned char gsm_to_ascii[] = {
|
|||
|
||||
const int GSM_TO_ASCII_TABLE_SIZE = sizeof(gsm_to_ascii) / sizeof(gsm_to_ascii[0]);
|
||||
|
||||
AT_CellularSMS::AT_CellularSMS(ATHandler &at, AT_CellularDevice &device) : _cb(0), _mode(CellularSMSMmodeText),
|
||||
AT_CellularSMS::AT_CellularSMS(ATHandler &at, AT_CellularDevice &device) : _cb(), _mode(CellularSMSMmodeText),
|
||||
_use_8bit_encoding(false), _sim_wait_time(0), _sms_message_ref_number(1),
|
||||
_sms_info(NULL), _at(at), _device(device)
|
||||
{
|
||||
|
|
|
@ -291,7 +291,7 @@ void ATHandler::set_is_filehandle_usable(bool usable)
|
|||
_fileHandle->sigio(Callback<void()>(this, &ATHandler::event));
|
||||
} else {
|
||||
_fileHandle->set_blocking(true); // set back to default state
|
||||
_fileHandle->sigio(NULL);
|
||||
_fileHandle->sigio(nullptr);
|
||||
}
|
||||
_is_fh_usable = usable;
|
||||
}
|
||||
|
|
|
@ -59,12 +59,11 @@ MBED_WEAK CellularContext *CellularContext::get_default_nonip_instance()
|
|||
}
|
||||
|
||||
CellularContext::CellularContext() : _next(0), _stack(0), _pdp_type(DEFAULT_PDP_TYPE),
|
||||
_authentication_type(CellularContext::CHAP), _connect_status(NSAPI_STATUS_DISCONNECTED), _status_cb(0),
|
||||
_authentication_type(CellularContext::CHAP), _connect_status(NSAPI_STATUS_DISCONNECTED), _status_cb(),
|
||||
_cid(-1), _new_context_set(false), _is_context_active(false), _is_context_activated(false),
|
||||
_apn(0), _uname(0), _pwd(0), _dcd_pin(NC), _active_high(false), _cp_netif(0), _retry_array_length(0),
|
||||
_retry_count(0), _device(0), _nw(0), _is_blocking(true), _nonip_req(false), _cp_in_use(false)
|
||||
_apn(0), _uname(0), _pwd(0), _dcd_pin(NC), _active_high(false), _cp_netif(0), _retry_timeout_array(),
|
||||
_retry_array_length(0), _retry_count(0), _device(0), _nw(0), _is_blocking(true), _nonip_req(false), _cp_in_use(false)
|
||||
{
|
||||
memset(_retry_timeout_array, 0, sizeof(_retry_timeout_array));
|
||||
}
|
||||
|
||||
void CellularContext::cp_data_received()
|
||||
|
|
|
@ -40,7 +40,7 @@ CellularDevice::CellularDevice(FileHandle *fh) :
|
|||
_sms_ref_count(0),
|
||||
#endif //MBED_CONF_CELLULAR_USE_SMS
|
||||
_info_ref_count(0), _fh(fh), _queue(10 * EVENTS_EVENT_SIZE), _state_machine(0),
|
||||
_status_cb(0), _nw(0)
|
||||
_status_cb(), _nw(0)
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
, _queue_thread(osPriorityNormal, 2048, NULL, "cellular_queue")
|
||||
#endif // MBED_CONF_RTOS_PRESENT
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace mbed {
|
|||
|
||||
CellularStateMachine::CellularStateMachine(CellularDevice &device, events::EventQueue &queue, CellularNetwork &nw) :
|
||||
_cellularDevice(device), _state(STATE_INIT), _next_state(_state), _target_state(_state),
|
||||
_event_status_cb(0), _network(nw), _queue(queue), _sim_pin(0), _retry_count(0),
|
||||
_event_status_cb(), _network(nw), _queue(queue), _sim_pin(0), _retry_count(0),
|
||||
_event_timeout(-1), _event_id(-1), _plmn(0), _command_success(false),
|
||||
_is_retry(false), _cb_data(), _current_event(CellularDeviceReady), _status(0)
|
||||
{
|
||||
|
@ -345,7 +345,7 @@ bool CellularStateMachine::device_ready()
|
|||
#endif // MBED_CONF_CELLULAR_DEBUG_AT
|
||||
|
||||
send_event_cb(CellularDeviceReady);
|
||||
_cellularDevice.set_ready_cb(0);
|
||||
_cellularDevice.set_ready_cb(nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -35,9 +35,9 @@ GEMALTO_CINTERION_CellularStack::GEMALTO_CINTERION_CellularStack(ATHandler &atHa
|
|||
|
||||
GEMALTO_CINTERION_CellularStack::~GEMALTO_CINTERION_CellularStack()
|
||||
{
|
||||
_at.set_urc_handler("^SIS:", 0);
|
||||
_at.set_urc_handler("^SISW:", 0);
|
||||
_at.set_urc_handler("^SISR:", 0);
|
||||
_at.set_urc_handler("^SIS:", nullptr);
|
||||
_at.set_urc_handler("^SISW:", nullptr);
|
||||
_at.set_urc_handler("^SISR:", nullptr);
|
||||
}
|
||||
|
||||
void GEMALTO_CINTERION_CellularStack::urc_sis()
|
||||
|
|
|
@ -48,8 +48,8 @@ QUECTEL_BC95_CellularStack::~QUECTEL_BC95_CellularStack()
|
|||
_event_queue->cancel(_txfull_event_id);
|
||||
}
|
||||
|
||||
_at.set_urc_handler("+NSONMI:", NULL);
|
||||
_at.set_urc_handler("+NSOCLI:", NULL);
|
||||
_at.set_urc_handler("+NSONMI:", nullptr);
|
||||
_at.set_urc_handler("+NSOCLI:", nullptr);
|
||||
}
|
||||
|
||||
nsapi_error_t QUECTEL_BC95_CellularStack::socket_listen(nsapi_socket_t handle, int backlog)
|
||||
|
|
|
@ -39,7 +39,7 @@ QUECTEL_BG96_CellularContext::QUECTEL_BG96_CellularContext(ATHandler &at, Cellul
|
|||
QUECTEL_BG96_CellularContext::~QUECTEL_BG96_CellularContext()
|
||||
{
|
||||
if (_nonip_req) {
|
||||
_at.set_urc_handler("+QIND:", 0);
|
||||
_at.set_urc_handler("+QIND:", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,14 +39,14 @@ QUECTEL_M26_CellularStack::QUECTEL_M26_CellularStack(ATHandler &atHandler, int c
|
|||
|
||||
QUECTEL_M26_CellularStack::~QUECTEL_M26_CellularStack()
|
||||
{
|
||||
_at.set_urc_handler("5, CLOSED", NULL);
|
||||
_at.set_urc_handler("4, CLOSED", NULL);
|
||||
_at.set_urc_handler("3, CLOSED", NULL);
|
||||
_at.set_urc_handler("2, CLOSED", NULL);
|
||||
_at.set_urc_handler("1, CLOSED", NULL);
|
||||
_at.set_urc_handler("0, CLOSED", NULL);
|
||||
_at.set_urc_handler("5, CLOSED", nullptr);
|
||||
_at.set_urc_handler("4, CLOSED", nullptr);
|
||||
_at.set_urc_handler("3, CLOSED", nullptr);
|
||||
_at.set_urc_handler("2, CLOSED", nullptr);
|
||||
_at.set_urc_handler("1, CLOSED", nullptr);
|
||||
_at.set_urc_handler("0, CLOSED", nullptr);
|
||||
|
||||
_at.set_urc_handler("+QIRDI:", NULL);
|
||||
_at.set_urc_handler("+QIRDI:", nullptr);
|
||||
}
|
||||
|
||||
nsapi_error_t QUECTEL_M26_CellularStack::socket_listen(nsapi_socket_t handle, int backlog)
|
||||
|
|
|
@ -52,7 +52,7 @@ void UBLOX_N2XX::set_at_urcs_impl()
|
|||
|
||||
UBLOX_N2XX::~UBLOX_N2XX()
|
||||
{
|
||||
_at->set_urc_handler("+NPIN:", NULL);
|
||||
_at->set_urc_handler("+NPIN:", nullptr);
|
||||
}
|
||||
|
||||
// Callback for Sim Pin.
|
||||
|
|
|
@ -31,7 +31,7 @@ UBLOX_N2XX_CellularStack::UBLOX_N2XX_CellularStack(ATHandler &atHandler, int cid
|
|||
|
||||
UBLOX_N2XX_CellularStack::~UBLOX_N2XX_CellularStack()
|
||||
{
|
||||
_at.set_urc_handler("+NSONMI:", NULL);
|
||||
_at.set_urc_handler("+NSONMI:", nullptr);
|
||||
}
|
||||
|
||||
nsapi_error_t UBLOX_N2XX_CellularStack::socket_listen(nsapi_socket_t handle, int backlog)
|
||||
|
|
|
@ -47,7 +47,7 @@ nsapi_error_t nsapi_ppp_set_blocking(bool blocking);
|
|||
*
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
nsapi_error_t nsapi_ppp_connect(FileHandle *stream, Callback<void(nsapi_event_t, intptr_t)> status_cb = 0, const char *uname = 0, const char *pwd = 0, const nsapi_ip_stack_t stack = DEFAULT_STACK);
|
||||
nsapi_error_t nsapi_ppp_connect(FileHandle *stream, Callback<void(nsapi_event_t, intptr_t)> status_cb = nullptr, const char *uname = 0, const char *pwd = 0, const nsapi_ip_stack_t stack = DEFAULT_STACK);
|
||||
|
||||
/** Close a PPP connection
|
||||
*
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
Deferred &operator=(const Deferred &);
|
||||
|
||||
public:
|
||||
Deferred(T t, Callback<void(T)> ondefer = NULL)
|
||||
Deferred(T t, Callback<void(T)> ondefer = nullptr)
|
||||
: _t(t), _ondefer(ondefer)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -44,9 +44,9 @@ namespace mbed {
|
|||
* // Increase reference count
|
||||
* SharedPtr<MyStruct> ptr2( ptr );
|
||||
*
|
||||
* ptr = NULL; // Reference to the struct instance is still held by ptr2
|
||||
* ptr = nullptr; // Reference to the struct instance is still held by ptr2
|
||||
*
|
||||
* ptr2 = NULL; // The raw pointer is freed
|
||||
* ptr2 = nullptr; // The raw pointer is freed
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue