XFcRFCOMMSocket class Reference

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

# XFcRFCOMMSocket Class Reference

RFCOMM socket holds connection creation to other bt socket. More...

Inheritance diagram for XFcRFCOMMSocket:

[legend]
Collaboration diagram for XFcRFCOMMSocket:

[legend]
List of all members.

## Public Member Functions

XFCIMPORT INT | open (const XFcAddress &aAddress, XFcAsyncCallBack *aCallBack=NULL)
| Opens connection to destination address.
XFCIMPORT INT | open (XFcSocket &aSocket, XFcAsyncCallBack *aCallBack=NULL)
| Listens connection from other device.
XFCIMPORT INT | bind (XFcAddress &aAddress)
| Binds the socket if used as server.
XFCIMPORT INT | listen (INT aListen)
| Sets up a socket to listen for incoming connections.
XFCIMPORT INT | recv (CHAR8 *aData, INT32 aLen, INT aFlags)
| Receives data from socket, not supported if socket is in listen mode.
XFCIMPORT INT | send (const CHAR8 *aData, INT32 aLen, INT aFlags)
| Sends data to socket, not supported if socket is in listen mode.
virtual XFCIMPORT | ~XFcRFCOMMSocket ()
| Virtual destructor.

## Static Public Member Functions

XFCIMPORT XFcRFCOMMSocket * | create (INT aPlank=0)
| Creates RFCOMM Socket.

## Protected Member Functions

| XFcRFCOMMSocket ()
| Protected constructor.
INT | init (INT aPlank)
| Initializes XFcL2CAPSocket.

## Detailed Description

RFCOMM socket holds connection creation to other bt socket.

One is able to create RFCOMM server socket or client socket. If socket is changed to asynchronous, XFcAsyncCallBack interface pointer must be given. Default socket is created to blocking mode.

## Constructor & Destructor Documentation

XFcRFCOMMSocket::XFcRFCOMMSocket | ( |  | ) | `[protected]`

| Protected constructor.

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

| Virtual destructor.

## Member Function Documentation

XFCIMPORT INT XFcRFCOMMSocket::bind | ( | XFcAddress & | aAddress | ) |

Binds the socket if used as server.

Parameters:

  aAddress | address where to bind (only port is needed).

Returns:
  0 if successful, or -1 if unsuccessful.

XFCIMPORT XFcRFCOMMSocket* XFcRFCOMMSocket::create | ( | INT | aPlank = 0 | ) | `[static]`

Creates RFCOMM Socket.

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

INT XFcRFCOMMSocket::init | ( | INT | aPlank | ) | `[protected]`

Initializes XFcL2CAPSocket.

Returns:
  1 if success else 0

XFCIMPORT INT XFcRFCOMMSocket::listen | ( | INT | aListen | ) |

| Sets up a socket to listen for incoming connections. Creates backbuffer for incoming connection.

XFCIMPORT INT XFcRFCOMMSocket::open | ( | XFcSocket & | aSocket,
|  | XFcAsyncCallBack * | aCallBack = NULL
| ) |

Listens connection from other device.

Parameters:

  aSocket | listen socket.
  aCallBack | callback object.

Returns:
  0 if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcRFCOMMSocket::open | ( | const XFcAddress & | aAddress,
|  | XFcAsyncCallBack * | aCallBack = NULL
| ) |

Opens connection to destination address.

Parameters:

  aAddress | address where to connect.
  aCallBack | callback object.

Returns:
  0 if successful, or -1 if unsuccesful.

XFCIMPORT INT XFcRFCOMMSocket::recv | ( | CHAR8 * | aData,
|  | INT32 | aLen,
|  | INT | aFlags
| ) |

Receives data from socket, not supported if socket is in listen mode.

Parameters:

  aData | buffer for the incoming data.
  aLen | length of buffer.
  aFlags | read flags.

Returns:
  length of read data if successful, or -1 if unsuccessful.

XFCIMPORT INT XFcRFCOMMSocket::send | ( | const CHAR8 * | aData,
|  | INT32 | aLen,
|  | INT | aFlags
| ) |

Sends data to socket, not supported if socket is in listen mode.

Parameters:

  aData | buffer for outgoing data.
  aLen | length of buffer.
  aFlags | send flags.

Returns:
  length of sent data if successful, or -1 if unsuccessful.

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