Diffstat (limited to 'examples/opiebluez/oblueztest') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/opiebluez/oblueztest/main.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/examples/opiebluez/oblueztest/main.cpp b/examples/opiebluez/oblueztest/main.cpp index 361dbd8..6c2ca75 100644 --- a/examples/opiebluez/oblueztest/main.cpp +++ b/examples/opiebluez/oblueztest/main.cpp | |||
@@ -4,20 +4,31 @@ | |||
4 | using namespace Opie::Core; | 4 | using namespace Opie::Core; |
5 | using namespace Opie::Bluez; | 5 | using namespace Opie::Bluez; |
6 | 6 | ||
7 | int main( int argc, char** argv ) | 7 | int main( int argc, char** argv ) |
8 | { | 8 | { |
9 | OBluetooth* sys = OBluetooth::instance(); | 9 | OBluetooth* sys = OBluetooth::instance(); |
10 | |||
11 | OBluetooth::InterfaceIterator it = sys->iterator(); | 10 | OBluetooth::InterfaceIterator it = sys->iterator(); |
12 | 11 | ||
13 | while( it.current() ) | 12 | while( it.current() ) |
14 | { | 13 | { |
15 | odebug << "APP: Bluetooth host controller interface '" << it.current()->name() << "' has MAC '" << it.current()->macAddress() << "'" << oendl; | 14 | odebug << "APP: Bluetooth host controller interface '" << it.current()->name() << "' has MAC '" << it.current()->macAddress() << "'" << oendl; |
16 | odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << ". Trying to toggle state..." << oendl; | ||
17 | it.current()->setUp( !it.current()->isUp() ); | ||
18 | odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << "." << oendl; | 15 | odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << "." << oendl; |
16 | //odebug << "APP: Trying to toggle state..." << oendl; | ||
17 | //it.current()->setUp( !it.current()->isUp() ); | ||
18 | //odebug << "APP: Interface is " << ( it.current()->isUp() ? "UP" : "DOWN" ) << "." << oendl; | ||
19 | |||
20 | odebug << "APP: scanning..." << oendl; | ||
21 | |||
22 | OBluetoothInterface::DeviceIterator devit = it.current()->neighbourhood(); | ||
23 | while( devit.current() ) | ||
24 | { | ||
25 | odebug << "APP: Neighbourhood '" << devit.current()->name() << "' has MAC '" << devit.current()->macAddress() << "'" << oendl; | ||
26 | odebug << "APP: Neighbourhood '" << devit.current()->name() << "' has class '" << devit.current()->deviceClass() << "'" << oendl; | ||
27 | ++devit; | ||
28 | } | ||
29 | |||
19 | ++it; | 30 | ++it; |
20 | } | 31 | } |
21 | return 0; | 32 | return 0; |
22 | } | 33 | } |
23 | 34 | ||