3 * meego handset bluetooth
4 * Copyright © 2010, Intel Corporation.
6 * This program is licensed under the terms and conditions of the
7 * Apache License, version 2.0. The full text of the Apache License is at
8 * http://www.apache.org/licenses/LICENSE-2.0
12 #include "bluetoothbaseagent.h"
14 #include "agentadaptor.h"
15 #include "bluemanager.h"
16 #include "blueadapter.h"
19 BluetoothBaseAgent::BluetoothBaseAgent(QString path, QObject *parent):QObject(parent),requestAccepted(false)
21 new AgentAdaptor(this);
22 QDBusConnection::systemBus().registerObject(path,this);
24 OrgBluezManagerInterface manager(
26 "/", QDBusConnection::systemBus());
28 QDBusObjectPath adapterpath = manager.DefaultAdapter();
30 OrgBluezAdapterInterface adapter(
33 QDBusConnection::systemBus());
35 adapter.RegisterAgent(QDBusObjectPath(path),"");
37 qDebug()<<"last error: "<<adapter.lastError().message();
41 void BluetoothBaseAgent::authorize(OrgBluezDeviceInterface &device, QString uuid)
48 void BluetoothBaseAgent::confirmModeChange(QString mode)
50 qDebug()<<"mode changed "<<mode;
53 void BluetoothBaseAgent::displayPasskey(OrgBluezDeviceInterface &device, uint key)
55 qDebug()<<"display key "<<device.path()<<" "<<key;
58 void BluetoothBaseAgent::release()
60 qDebug("release called");
63 void BluetoothBaseAgent::requestConfirmation(OrgBluezDeviceInterface &device, uint key)
65 QVariantMap props = device.GetProperties();
67 QString alias = props["Alias"].toString();
69 qDebug()<<"Pairing with "<< alias << " with key: "+QString::number(key);
72 uint BluetoothBaseAgent::requestPasskey(OrgBluezDeviceInterface &device)
79 QString BluetoothBaseAgent::requestPidCode(OrgBluezDeviceInterface &device)