XFcBtClientWin class Reference

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcBtClientWin Class Reference

Holds bluetooth client data that is used to keep up data flow from/to server. More...

Inheritance diagram for XFcBtClientWin:

[legend]
Collaboration diagram for XFcBtClientWin:

[legend]
List of all members.

## Public Member Functions

virtual XFCIMPORT | ~XFcBtClientWin ()
| Virtual destructor.
XFCIMPORT INT | openClient ()
| Opens client connection to address given by create. Connection open is a asynchronous.
XFCIMPORT INT | openClient (XFcSocket &aSocket, XFcAsyncCallBack *aCallBack)
| Opens connection to client (listening mode). Connection open is a asynchronous.
XFCIMPORT void | acceptConnection (INT aEnable)
| Accepts this connection.
XFCIMPORT void | closeClient ()
| Close client connection.
virtual XFCIMPORT INT32 | incoming (XFcObjectPacketBase &mRecvBuffer)
| Receives packet buffer from server.
virtual XFCIMPORT INT32 | outgoing (XFcObjectPacketBase &mSendBuffer)
| Sends packet to server.
virtual XFCIMPORT XFcObjectDataFrame * | getPacketFrame (INT aSlot)
| Gets packet frame for sendable data.
virtual XFCIMPORT XFcObjectDataFrame * | getRecentStateFrame (INT32 aRecentId)
| Gets recent state frame for sendable data.
virtual XFCIMPORT void | removeRecentStateFrame (INT32 aRecentId)
| Removes recent state frame.
virtual XFCIMPORT void | setAddress (const XFcAddress &aAddress)
| Sets address.
virtual XFCIMPORT INT | isClientActive ()
| Gets client status.
virtual XFCIMPORT INT | testAddress (const XFcAddress &aAddress)
| Tests address.
virtual XFCIMPORT INT | bandwidthCheck ()
| Checks if we are able to send any data.
virtual XFCIMPORT void | initializeClient ()
| Runtime initialize.
virtual XFCIMPORT void | deinitializeClient ()
| Runtime deinitialize.

## Static Public Member Functions

XFCIMPORT XFcBtClientWin * | create (const XFcAddress *aAddress, INT32 aGranularity=XFCNET_QUEUE_BUFFER_COUNT, INT32 aBufferMaxSize=XFCNET_QUEUE_BUFFER_SIZE)
| Static constructor.

## Protected Member Functions

XFCIMPORT INT | init (const XFcAddress *aAddress, INT32 aGranularity, INT32 aBufferMaxSize)
| Initializes XFcBtClientWin.
XFCIMPORT | XFcBtClientWin ()
| Protected constructor.
virtual XFCIMPORT void | actionFailed (INT32 aStatus=0)
| Bt action failed.
virtual XFCIMPORT void | actionReady (INT32 aStatus=0)
| Bt action ready.
virtual XFCIMPORT void | actionCancel (INT32 aStatus=0)
| Bt action canceled.
virtual XFCIMPORT void | actionReceive (const CHAR8 *, INT32)
| Not needed.
virtual XFCIMPORT void | actionSend (INT32)
| Not needed.

## Private Attributes

XFcRFCOMMSocket * | mSocket
| Holds communication socket.
XFcObjectDataQueue * | mPriorityQueue
| Object data priority queue.
XFcPacketCreator * | mPacketCreator
| Current packet creator.
INT | mLineStatus
| Holds client ativity status.

## Detailed Description

Holds bluetooth client data that is used to keep up data flow from/to server.

XFcBtClientWin is used to hide connected RFCOMM socket behavior to work as connectionless socket. It can be created to listen or to connection mode. If it's created to connection mode it will try to make connection to a "server" device. In listen mode it starts to wait if someone binds connection to it.

  After connection is established there's no difference between connected or bound client while sending or receiving data. Every bound connection must be accepted or rejected with acceptConnection(), otherwise connection is unusable.

  Object holds priority queue which is used to hold sendable data to other device. It also stores data until it is sent and data has reached it's destination (only XFCNET_GUARANTEED and XFCNET_QUICKGUARANTEED are hold). XFcPacketCreator implements how data is going to be sent. Data can be sent in one big packet frame when it will copy as much data it can to one sendable packet, or data can be sent in single packet frames.

## Constructor & Destructor Documentation

XFCIMPORT XFcBtClientWin::XFcBtClientWin | ( |  | ) | `[protected]`

| Protected constructor.

virtual XFCIMPORT XFcBtClientWin::~XFcBtClientWin | ( |  | ) | `[virtual]`

| Virtual destructor.

## Member Function Documentation

XFCIMPORT void XFcBtClientWin::acceptConnection | ( | INT | aEnable | ) |

| Accepts this connection.

virtual XFCIMPORT void XFcBtClientWin::actionCancel | ( | INT32 | aStatus = 0 | ) | `[protected, virtual]`

| Bt action canceled. Implements XFcAsyncCallBack.

virtual XFCIMPORT void XFcBtClientWin::actionFailed | ( | INT32 | aStatus = 0 | ) | `[protected, virtual]`

Bt action failed.

Note:
  Inherited from XFcAsyncCallBack.

Implements XFcAsyncCallBack.

virtual XFCIMPORT void XFcBtClientWin::actionReady | ( | INT32 | aStatus = 0 | ) | `[protected, virtual]`

| Bt action ready. Implements XFcAsyncCallBack.

virtual XFCIMPORT void XFcBtClientWin::actionReceive | ( | const CHAR8 * | ,
|  | INT32 |
| ) | `[inline, protected, virtual]`

| Not needed. Implements XFcAsyncCallBack.

virtual XFCIMPORT void XFcBtClientWin::actionSend | ( | INT32 |  | ) | `[inline, protected, virtual]`

| Not needed. Implements XFcAsyncCallBack.

virtual XFCIMPORT INT XFcBtClientWin::bandwidthCheck | ( |  | ) | `[virtual]`

| Checks if we are able to send any data. Implements XFcClientCommWin.

XFCIMPORT void XFcBtClientWin::closeClient | ( |  | ) |

| Close client connection.

XFCIMPORT XFcBtClientWin* XFcBtClientWin::create | ( | const XFcAddress * | aAddress,
|  | INT32 | aGranularity = XFCNET_QUEUE_BUFFER_COUNT,
|  | INT32 | aBufferMaxSize = XFCNET_QUEUE_BUFFER_SIZE
| ) | `[static]`

Static constructor.

Parameters:

  aAddress | where client is going to connect, can be set to NULL.
  aGranularity | packet list granularity. Max size for packet list.
  aBufferMaxSize | max size for buffer.

Returns:
  new object if successful, or NULL if unsuccessful.

virtual XFCIMPORT void XFcBtClientWin::deinitializeClient | ( |  | ) | `[virtual]`

| Runtime deinitialize. Reimplemented from XFcClientCommWin.

virtual XFCIMPORT XFcObjectDataFrame* XFcBtClientWin::getPacketFrame | ( | INT | aSlot | ) | `[virtual]`

Gets packet frame for sendable data.

Parameters:

  aSlot | packet slot id.

Returns:
  data frame.

Implements XFcClientCommWin.

virtual XFCIMPORT XFcObjectDataFrame* XFcBtClientWin::getRecentStateFrame | ( | INT32 | aRecentId | ) | `[virtual]`

Gets recent state frame for sendable data.

Parameters:

  aRecentId | recent state id.

Returns:
  recent state frame.

Implements XFcClientCommWin.

virtual XFCIMPORT INT32 XFcBtClientWin::incoming | ( | XFcObjectPacketBase & | mRecvBuffer | ) | `[virtual]`

Receives packet buffer from server.

Note:
  Inherited from XFcClientCommWin.

Implements XFcClientCommWin.

XFCIMPORT INT XFcBtClientWin::init | ( | const XFcAddress * | aAddress,
|  | INT32 | aGranularity,
|  | INT32 | aBufferMaxSize
| ) | `[protected]`

Initializes XFcBtClientWin.

Parameters:

  aAddress | server address where to connect.
  aGranularity | packet list granularity. Max size for packet list.
  aBufferMaxSize | max size for buffer.

Returns:
  1 if succesful, or 0 otherwise.

virtual XFCIMPORT void XFcBtClientWin::initializeClient | ( |  | ) | `[virtual]`

| Runtime initialize.

virtual XFCIMPORT INT XFcBtClientWin::isClientActive | ( |  | ) | `[virtual]`

| Gets client status. Implements XFcClientCommWin.

XFCIMPORT INT XFcBtClientWin::openClient | ( | XFcSocket & | aSocket,
|  | XFcAsyncCallBack * | aCallBack
| ) |

| Opens connection to client (listening mode). Connection open is a asynchronous.

XFCIMPORT INT XFcBtClientWin::openClient | ( |  | ) |

| Opens client connection to address given by create. Connection open is a asynchronous.

virtual XFCIMPORT INT32 XFcBtClientWin::outgoing | ( | XFcObjectPacketBase & | mSendBuffer | ) | `[virtual]`

| Sends packet to server. Implements XFcClientCommWin.

virtual XFCIMPORT void XFcBtClientWin::removeRecentStateFrame | ( | INT32 | aRecentId | ) | `[virtual]`

Removes recent state frame.

Parameters:

  aRecentId | recent state id.

Implements XFcClientCommWin.

virtual XFCIMPORT void XFcBtClientWin::setAddress | ( | const XFcAddress & | aAddress | ) | `[virtual]`

Sets address.

Parameters:

  aAddress | address where to connect.

Implements XFcClientCommWin.

virtual XFCIMPORT INT XFcBtClientWin::testAddress | ( | const XFcAddress & | aAddress | ) | `[virtual]`

Tests address.

Parameters:

  aAddress | address to test.

Returns:
  1 if address is same, or 0 otherwise.

Implements XFcClientCommWin.

## Member Data Documentation

INT XFcBtClientWin::mLineStatus`[private]`

| Holds client ativity status.

XFcPacketCreator* XFcBtClientWin::mPacketCreator`[private]`

| Current packet creator.

XFcObjectDataQueue* XFcBtClientWin::mPriorityQueue`[private]`

| Object data priority queue.

XFcRFCOMMSocket* XFcBtClientWin::mSocket`[private]`

| Holds communication socket.

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch