00001 /*************************************************************************** 00002 * Copyright (C) 2009 by Benjamin Hadorn (b_hadorn@bluewin.ch) * 00003 *************************************************************************** 00004 * Projekt : Zeus Base Library 00005 * Module : BluetoothDevice 00006 * Package : Net.Bluetooth 00007 * Author : Benjamin Hadorn 00008 * Datum : $Date: 10.09.09 17:00 $ 00009 * Ablage : $File$ 00010 * System : Cell Computing Model 00011 *************************************************************************** 00012 * Licence: * 00013 * This library is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU Lesser General Public License as * 00015 * published by the Free Software Foundation; either version * 00016 * 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00026 ***************************************************************************/ 00027 00028 /*************************************************************************** 00029 Changes : 00030 $Log: /Development_F/StuderWIN/dev/Zeus/src/zeusbase/Net/Bluetooth/BluetoothDevice.h $ 00031 ** 00032 ** 2 10.09.09 17:00 Bha 00033 ** bluetooth for linux added 00034 ** 00035 ** 1 29.04.09 8:50 Bha 00036 ** created 00037 ***************************************************************************/ 00038 //--------------------------------------------------------------------------- 00039 00040 #ifndef BluetoothDeviceH 00041 #define BluetoothDeviceH 00042 //--------------------------------------------------------------------------- 00043 00044 #include <zeusbase/System/ZObject.h> 00045 #include <zeusbase/System/SingleLinkedList.hpp> 00046 #include <zeusbase/Net/Bluetooth/BTDefines.hpp> 00047 00048 BEGIN_NAMESPACE_Zeus 00049 00050 class TBTAddress; 00051 00052 /****************************************************************************/ 00055 /****************************************************************************/ 00056 zeusbase_class TBluetoothDevice : public TZObject 00057 { 00058 public: 00059 TBluetoothDevice(); 00060 00061 #ifdef ENABLE_WIN32_BLUETOOTH 00062 TBluetoothDevice(BLUETOOTH_RADIO_INFO& rRadioStruct, 00063 BLUETOOTH_DEVICE_INFO& rDeviceStruct); 00064 #endif 00065 00066 TString getName() const; 00067 TString getFormatedAddress() const; 00068 Retval getAddress(TBTAddress*& rpAddress) const; 00069 00070 bool isConnected() const; 00071 bool isAuthenticated() const; 00072 00073 static void findAllDevices(TSingleLinkedList<TBluetoothDevice*>& rList, Int iQueryTimeOut = 15); 00074 static Retval findNamedDevices(const TString& rName, TBluetoothDevice*& rpDevice, Int iQueryTimeOut = 15); 00075 00076 protected: 00077 virtual ~TBluetoothDevice(); 00078 00079 private: 00081 TString m_strRadioName; 00083 Uint64 m_uldRadioAddress; 00085 TString m_strDeviceName; 00087 Uint64 m_uldDeviceAddress; 00089 bool m_bAuthenticated; 00091 bool m_bConnected; 00092 00093 }; 00094 00095 /****************************************************************************/ 00098 /****************************************************************************/ 00099 inline TString TBluetoothDevice::getName() const 00100 { 00101 return m_strDeviceName; 00102 } 00103 00104 /****************************************************************************/ 00107 /****************************************************************************/ 00108 inline bool TBluetoothDevice::isConnected() const 00109 { 00110 return m_bConnected; 00111 } 00112 00113 /****************************************************************************/ 00116 /****************************************************************************/ 00117 inline bool TBluetoothDevice::isAuthenticated() const 00118 { 00119 return m_bAuthenticated; 00120 } 00121 00122 END_NAMESPACE_Zeus 00123 00124 #endif