コード例 #1
0
void QuteMessenger::newSerialServiceFound(const QBtDevice& dev, const QBtService& serv)
{
    QString exprectedServiceName("Messenger Protocol ");
    exprectedServiceName += dev.getName();

    qDebug() << exprectedServiceName;
    qDebug() << serv.getName();

    if (QString::compare(exprectedServiceName, serv.getName()) == 0)
    {
        serviceDisc->stopDiscovery();
        selectedService = serv;

        QChatWidgetClient* tmpChat;
        tmpChat = new QChatWidgetClient(this);
        tmpChat->SetName(deviceQueriedForServices.getName());

        ui.tabWidget->addTab(tmpChat, deviceQueriedForServices.getName());
        chatTabs.append((QChatWidget*) tmpChat);

        connect(this, SIGNAL(serialParamRetreived(QBtDevice, QBtService)),
                tmpChat, SLOT(setParameters(QBtDevice, QBtService)));

        emit serialParamRetreived(dev, serv);
    }
}
コード例 #2
0
void QuteMessenger::newServiceFound(const QBtDevice& dev, const QBtService& serv)
{
    //since we need only the first available service with the given ClassID
    //when the first service is reported, the service discovery stops
    disconnect(serviceDisc, SIGNAL(newServiceFound(const QBtDevice&, const QBtService&)), this,
               SLOT(newServiceFound(const QBtDevice&, const QBtService&)));

    qDebug() << "Service to connect: " << serv.getName();
    qDebug() << "UUID: " << serv.getClass().get();
    qDebug() << "Dev: " << dev.getName();
    qDebug() << "Dev Addr: " << dev.getAddress().toString();

    if(obexClient)
    {
        delete obexClient;
        obexClient = NULL;
    }

    obexClient = new QBtObjectExchangeClient(this);

    connect(obexClient, SIGNAL(connectedToServer()), this, SLOT(connectedToRemoteOBEXServer()));
    connect(obexClient, SIGNAL(objectSent()), this, SLOT(fileSent()));
    connect(obexClient, SIGNAL(error (QBtObjectExchangeClient::ErrorCode)),
            this, SLOT(reportObexError(QBtObjectExchangeClient::ErrorCode)) );

    selectedService = serv;

    obexClient->connectToServer(deviceQueriedForServices, selectedService);
}
コード例 #3
0
void QuteMessenger::populateDeviceList(QBtDevice newDevice)
{
    ui.deviceListWidget->addItem(newDevice.getName());
    foundDevices.append(newDevice);
}
コード例 #4
0
void QBtSingleDeviceSelectorUIPrivate::populateDeviceList(const QBtDevice& device)
{
    QBtDevice* newDev = new QBtDevice(device);
    _devicesFound.append(*newDev);
    _devList->addItem(device.getName());
}