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

📄 btconnectionbase.h

📁 S60培训教材代码(连载)
💻 H
字号:
/* Copyright (c) 2002, Nokia Mobile Phones. All rights reserved */

#ifndef __BTCONNECTIONBASE_H__
#define __BTCONNECTIONBASE_H__

#include <e32base.h>
#include <es_sock.h>

class MLog;

/*! 
  @class CBTConnectionBase
  
  @discussion base class for host and client bluetooth connections
  */
class CBTConnectionBase : public CActive
    {
public:

/*!
  @enum
  
  @discussion The maximum length of any message that can be read
  */    
    enum { KMaximumMessageLength = 32 };

/*!
  @function ~CBTConnectionBase
  
  @discussion Destroy the object and release all memory objects. Close any open sockets
  */
    virtual ~CBTConnectionBase();
/*!
  @function WriteDataSyncL

  @discussion Sends data synchronously to the remote machine.
  */    
    void WriteDataSyncL(TDesC8& aData);

/*! 
  @function ReadDataL

  @discussion Request data from the client, this object is notified when data becomes
  available
  */
    void ReadDataL();
/*! 
  @function ReadDataL

  @discussion Request a specific length of data from the client
  */
    void ReadDataL(TInt aLength);

protected:    // from CActive
/*!
  @function DoCancel
  
  @discussion Cancel any outstanding requests - only implemented in dervied classes
  */
    void DoCancel() = 0;  

/*!
  @function RunL
  
  @discussion Respond to an event - only implemented in dervied classes
  */
    virtual void RunL() = 0;

protected:
/*!
  @function CBTConnectionBase

  @discussion Constructs this object
  */
    CBTConnectionBase(MLog& aLog);


protected:

    /*! @var iLog the log to send output to */
    MLog& iLog;

    /*! @var iSocketServer a connection to the socket server */
    RSocketServ iSocketServer;

    /*! @var iDataSocket a socket to connect with */
    RSocket iDataSocket;

    /*! @var iLen length of data read */
    TSockXfrLength iLen;

    /*! @var iBuffer the buffer to read data to */
    TBuf8<KMaximumMessageLength> iBuffer;

    };

#endif // __BTCONNECTIONBASE_H__

⌨️ 快捷键说明

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