btserviceadvertiser.h

来自「S60培训教材代码(连载)」· C头文件 代码 · 共 81 行

H
81
字号
#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 + =
减小字号Ctrl + -
显示快捷键?