bluetoothadvertiser.h

来自「series60 应用程序开发的源代码 series60 应用程序开发的源代码」· C头文件 代码 · 共 66 行

H
66
字号
#ifndef __BLUETOOTHADVERTISER_H__
#define __BLUETOOTHADVERTISER_H__

#include <btsdp.h>

// 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__






⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?