00001 /* 00002 * Copyright 2006 Baylor University 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef _BT_DISCOVERY_H_ 00018 #define _BT_DISCOVERY_H_ 00019 00020 #include <config.h> 00021 00022 #ifdef OASYS_BLUETOOTH_ENABLED 00023 #include <bluetooth/bluetooth.h> 00024 00025 #include <oasys/thread/Thread.h> 00026 #include <oasys/thread/Notifier.h> 00027 00028 #include "Discovery.h" 00029 00030 namespace dtn { 00031 00035 class BluetoothDiscovery : public Discovery, 00036 public oasys::Thread 00037 { 00038 public: 00039 void shutdown(); 00040 00041 virtual ~BluetoothDiscovery() { shutdown(); } 00042 protected: 00043 friend class Discovery; 00044 00045 BluetoothDiscovery(const std::string& name); 00046 bool configure(int argc, const char* argv[]); 00047 void run(); 00048 00049 volatile bool shutdown_; 00050 bdaddr_t local_addr_; 00051 oasys::Notifier notifier_; 00052 }; 00053 00054 } // dtn 00055 00056 #endif // OASYS_BLUETOOTH_ENABLED 00057 #endif // _BT_DISCOVERY_H_