00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _BT_DISCOVERY_H_
00018 #define _BT_DISCOVERY_H_
00019
00020 #ifndef DTN_CONFIG_STATE
00021 #error "MUST INCLUDE dtn-config.h before including this file"
00022 #endif
00023
00024 #ifdef OASYS_BLUETOOTH_ENABLED
00025 #include <bluetooth/bluetooth.h>
00026
00027 #include <oasys/thread/Thread.h>
00028 #include <oasys/thread/Notifier.h>
00029
00030 #include "Discovery.h"
00031
00032 namespace dtn {
00033
00037 class BluetoothDiscovery : public Discovery,
00038 public oasys::Thread
00039 {
00040 public:
00041 void shutdown();
00042
00043 virtual ~BluetoothDiscovery() { shutdown(); }
00044 protected:
00045 friend class Discovery;
00046
00047 BluetoothDiscovery(const std::string& name);
00048 bool configure(int argc, const char* argv[]);
00049 void run();
00050
00054 void handle_announce() { notifier_.notify(); }
00055
00056 volatile bool shutdown_;
00057 bdaddr_t local_addr_;
00058 oasys::Notifier notifier_;
00059 };
00060
00061 }
00062
00063 #endif // OASYS_BLUETOOTH_ENABLED
00064 #endif // _BT_DISCOVERY_H_