00001 #include <opie2/odebug.h>
00002 #include <opie2/obluetooth.h>
00003
00004 using namespace Opie::Core;
00005 using namespace Opie::Bluez;
00006
00007 int main( int argc, char** argv )
00008 {
00009 OBluetooth* sys = OBluetooth::instance();
00010 OBluetooth::InterfaceIterator it = sys->iterator();
00011
00012 while( it.current() )
00013 {
00014 odebug << "APP: Bluetooth host controller interface '" << it.current()->name() << "' has MAC '" << it.current()->macAddress() << "'" << oendl;
00015 odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << "." << oendl;
00016
00017
00018
00019
00020 odebug << "APP: scanning..." << oendl;
00021
00022 OBluetoothInterface::DeviceIterator devit = it.current()->neighbourhood();
00023 while( devit.current() )
00024 {
00025 odebug << "APP: Neighbourhood '" << devit.current()->name() << "' has MAC '" << devit.current()->macAddress() << "'" << oendl;
00026 odebug << "APP: Neighbourhood '" << devit.current()->name() << "' has class '" << devit.current()->deviceClass() << "'" << oendl;
00027 ++devit;
00028 }
00029
00030 ++it;
00031 }
00032 return 0;
00033 }
00034