www.pudn.com > Example_BluetoothChat.rar > BluetoothAdvertiser.h
#ifndef __BLUETOOTHADVERTISER_H__ #define __BLUETOOTHADVERTISER_H__ #include// CLASS DECLARATION /** * * @class CBluetoothAdviser BluetoothAdviser.h * @brief This class contains all the functionality for advertising Bluetooth Services on remote devices via the * Bluetooth Service Discovery Database * * It requires a Port to advertise a service on. * * Copyright (c) EMCC Software Ltd 2003 * @version 1.0 * */ class CBluetoothAdvertiser : public CBase { public: // Constructors static CBluetoothAdvertiser* NewL(); static CBluetoothAdvertiser* NewLC(); ~CBluetoothAdvertiser(); private: // Constructors - Symbian 2nd Stage CBluetoothAdvertiser(); void ConstructL(); public: // Functionaility void StartAdvertisingL(TInt aPort); void StopAdvertisingL(); public: // Getters & Setters inline TBool IsAdvertising(); void UpdateAvailabilityL(TBool aAvailability); private: void BuildProtocolDescriptionL(CSdpAttrValueDES* aProtocolDescriptor, TInt aPort); void ConnectL(); private: // Data RSdp iSdpSession; RSdpDatabase iSdpDatabase; TSdpServRecordHandle iRecord; TInt iRecordState; TBool iIsConnected; }; // Inline function definition inline TBool CBluetoothAdvertiser::IsAdvertising() { return iRecord != 0; } #endif // __BLUETOOTHADVERTISER_H__