2 #include <QApplication>
5 #include "bluez-bluetoothmanager.h"
6 #include "bluez-bluetoothinterface.h"
7 //#include "bluez-bluetoothremotedevice.h"
9 int main(int argc
, char **argv
)
12 QApplication
app(argc
, argv
);
13 BluezBluetoothManager
mgr(0, QStringList());
15 kDebug() << "Interfaces: " << mgr
.bluetoothInterfaces();
16 kDebug() << "Default Interface: " << mgr
.defaultInterface();
17 kDebug() << "Finding Interface hci0: " << mgr
.findInterface("hci0");
20 // kDebug() << "Bluetooth Input Devices: " << mgr.bluetoothInputDevices();
22 BluezBluetoothInterface
iface(mgr
.defaultInterface());
24 iface
.setProperty("Name","testNAME");
26 QMap
<QString
, QVariant
> props
= iface
.getProperties();
28 foreach(QString key
, props
.keys()) {
29 kDebug() << "Interface Property: " << key
<< " : " << props
[key
];
33 iface
.startDiscovery();
36 BluezBluetoothRemoteDevice
remote("/org/bluez/hci0/00:16:BC:15:A3:FF");
38 kDebug() << "Name: " << remote
.name();
39 kDebug() << "Company: " << remote
.company();
40 kDebug() << "Services: " << remote
.serviceClasses();
41 kDebug() << "Major Class: " << remote
.majorClass();
42 kDebug() << "Minor Class: " << remote
.minorClass();
44 if (remote
.hasBonding()) {
45 remote
.removeBonding();
48 remote
.createBonding();
51 kDebug() << mgr
.setupInputDevice("/org/bluez/hci0/00:04:61:81:75:FF");