当前位置: 首页>>代码示例>>C++>>正文


C++ DataContainer::setDeviceInformationServiceInstance方法代码示例

本文整理汇总了C++中DataContainer::setDeviceInformationServiceInstance方法的典型用法代码示例。如果您正苦于以下问题:C++ DataContainer::setDeviceInformationServiceInstance方法的具体用法?C++ DataContainer::setDeviceInformationServiceInstance怎么用?C++ DataContainer::setDeviceInformationServiceInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataContainer的用法示例。


在下文中一共展示了DataContainer::setDeviceInformationServiceInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
    }
}
开发者ID:26filip,项目名称:Cascades-Community-Samples,代码行数:33,代码来源:BluetoothHandler.cpp

示例2: gatt_service_disconnected

void gatt_service_disconnected(const char *bdaddr, const char *service, int instance, int reason, void *userData)
{

    Q_UNUSED(userData)
    Q_UNUSED(instance)
    Q_UNUSED(reason)

    QString bdaddr_str = QString(bdaddr);
    QString service_str = QString(service);
    qDebug() << QString("XXXX gatt_service_disconnected: bdaddr:%1 : %2 - %3").arg(bdaddr_str).arg(service_str).arg(parse_service_uuid(service));

    DataContainer *dc = DataContainer::getInstance();

    if (instance == dc->getDeviceInformationServiceInstance()) {
        qDebug() << "XXXX reacting to device information service disconnection";
        device_information_connected = false;
        dc->setDeviceInformationServiceInstance(0);
    }

}
开发者ID:26filip,项目名称:Cascades-Community-Samples,代码行数:20,代码来源:BluetoothHandler.cpp

示例3: gatt_service_connected

void gatt_service_connected(const char *bdaddr, const char *service, int instance, int err, uint16_t connInt, uint16_t latency, uint16_t superTimeout, void *userData)
{
    Q_UNUSED(superTimeout)
    Q_UNUSED(userData)
    Q_UNUSED(latency)
    Q_UNUSED(connInt)
    Q_UNUSED(err)

    qDebug() << "YYYY gatt_service_connected:" << service;

    if (strcmp(service, DEVICE_INFORMATION_SERVICE_UUID) == 0) {
        // we connected to the device information service so...
        device_information_connected = true;
        bt_remote_device_t *bt_device = bt_rdev_get_device(bdaddr);
        DataContainer *dc = DataContainer::getInstance();
        dc->setDeviceInformationServiceInstance(instance);
        qDebug() << "XXXX stored service instance value:" << instance;
        establishHandles(instance);
        readInfo();
        return;
    }

}
开发者ID:26filip,项目名称:Cascades-Community-Samples,代码行数:23,代码来源:BluetoothHandler.cpp


注:本文中的DataContainer::setDeviceInformationServiceInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。