2 * Copyright 2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com
3 * All rights reserved. Distributed under the terms of the MIT License.
9 #include <bluetooth/LocalDevice.h>
10 #include <bluetooth/bdaddrUtils.h>
14 DumpInfo(LocalDevice
* device
)
16 printf("[LocalDevice] %s\t%s\n", (device
->GetFriendlyName()).String(),
17 bdaddrUtils::ToString(device
->GetBluetoothAddress()));
20 DeviceClass cod
= device
->GetDeviceClass();
22 cod
.GetServiceClass(classString
);
24 cod
.GetMajorDeviceClass(classString
);
26 cod
.GetMinorDeviceClass(classString
);
27 printf("\t\t%s: \n", classString
.String());
33 LocalDeviceError(status_t status
)
35 fprintf(stderr
,"No Device/s found");
42 main(int argc
, char *argv
[])
46 LocalDevice
* ld
= LocalDevice::GetLocalDevice(atoi(argv
[0]));
48 return LocalDeviceError(ENODEV
);
52 } else if (argc
== 1) {
54 LocalDevice
* ld
= NULL
;
56 printf("Listing %ld Bluetooth Local Devices ...\n",
57 LocalDevice::GetLocalDeviceCount());
58 for (uint32 index
= 0 ; index
< LocalDevice::GetLocalDeviceCount() ; index
++) {
60 ld
= LocalDevice::GetLocalDevice();
62 return LocalDeviceError(ENODEV
);
69 fprintf(stderr
,"Usage: bt_dev_info [device]\n");