本文整理汇总了C++中DataContainer::setDeviceConnected方法的典型用法代码示例。如果您正苦于以下问题:C++ DataContainer::setDeviceConnected方法的具体用法?C++ DataContainer::setDeviceConnected怎么用?C++ DataContainer::setDeviceConnected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataContainer
的用法示例。
在下文中一共展示了DataContainer::setDeviceConnected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: btEvent
void btEvent(const int event, const char *bt_addr, const char *event_data)
{
Q_UNUSED(bt_addr)
QString event_name = btEventName(event);
qDebug() << "XXXX bluetooth event:" << event_name;
if (event_data != NULL) {
QString event_data_str = QString(*event_data);
qDebug() << "XXXX BT event_data=" << event_data_str;
} else {
qDebug() << "XXXX BT event_data=NULL";
}
if (event == BT_EVT_LE_DEVICE_CONNECTED) {
_handler->emitSignalInfoMessage("Device has connected");
DataContainer *dc = DataContainer::getInstance();
dc->setDeviceConnected(true);
_handler->emitSignalLinkEstablished();
return;
}
if (event == BT_EVT_LE_DEVICE_DISCONNECTED) {
_handler->emitSignalInfoMessage("Device has disconnected");
device_information_connected = false;
DataContainer *dc = DataContainer::getInstance();
dc->setDeviceConnected(false);
dc->setDeviceInformationServiceInstance(0);
_handler->emitSignalLostLink();
return;
}
}
示例2: btEvent
void btEvent(const int event, const char *bt_addr, const char *event_data)
{
Q_UNUSED(bt_addr)
QString event_name = btEventName(event);
qDebug() << "XXXX bluetooth event:" << event_name;
if (event_data != NULL) {
QString event_data_str = QString(*event_data);
qDebug() << "XXXX BT event_data=" << event_data_str;
} else {
qDebug() << "XXXX BT event_data=NULL";
}
if (event == BT_EVT_LE_DEVICE_CONNECTED) {
_handler->emitSignalSetMessage("Chicken sensor has connected");
DataContainer *dc = DataContainer::getInstance();
dc->setDeviceConnected(true);
_handler->emitSignalLinkEstablished();
return;
}
if (event == BT_EVT_LE_DEVICE_DISCONNECTED) {
immediate_alert_connected = false;
link_loss_connected = false;
tx_power_connected = false;
rssi_polling_required = false;
DataContainer *dc = DataContainer::getInstance();
dc->setDeviceConnected(false);
dc->setAlertServiceInstance(0);
dc->setLinkLossServiceInstance(0);
dc->setTxPowerServiceInstance(0);
_handler->emitSignalSetMessage("Chicken sensor has disconnected");
_handler->emitSignalDisableProximityVisualisation();
return;
}
}