⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 btserviceadvertiser.h

📁 S60培训教材代码(连载)
💻 H
字号:
#ifndef __CBTSERVICE_ADVERTISER__
#define __CBTSERVICE_ADVERTISER__

#include <e32base.h>
#include <btsdp.h>
#include <btmanclient.h>

/*! 
  @class CBTServiceAdvertiser
  
  @discussion Advertises a service in the SDP database.
  */
class CBTServiceAdvertiser : public CBase
    {
public:
/*!
  @function CBTServiceAdvertiser
  
  @discussion Construct this object 
  */
    CBTServiceAdvertiser(TUint aAppUID);


/*!
  @function ~CBTServiceAdvertiser
  
  @discussion Destroy the object, close all open handles and remove the advertised service.
  */
    ~CBTServiceAdvertiser();

/*!
  @function StartAdvertisingL

  @discussion Start the advertising of this service
  @param aPort the port being used by the service 
  */
    void StartAdvertisingL(TInt aPort);

/*!
  @function StopAdvertisingL

  @discussion Stop advertising this service. Remove the record from the sdp database
  */
    void StopAdvertisingL();

/*!
  @function IsAdvertising

  @discussion Does the SDP database contain a record for this service
  @result ETRUE whether the service is being advertised
  */
    TBool IsAdvertising();



private:
/*!
  @function ConnectL
  
  @discussion Connect to the SDP database
  */    
    void ConnectL();

private:
    TUint iAppUID;

    /*! @var iSdpSession Handle to the SDP session */
    RSdp iSdpSession;

    /*! @var iSdpDatabase a connection to the SDP database */
    RSdpDatabase iSdpDatabase;

    /*! @var iRecord the record handle of the service record for this server */
    TSdpServRecordHandle iRecord;

    /*! @var iIsConnected has a connection been made to the SDP Database */
    TBool iIsConnected;
    };

#endif // __CBTSERVICE_ADVERTISER__

⌨️ 快捷键说明

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