oasys::BluetoothServer Class Reference

#include <BluetoothServer.h>

Inheritance diagram for oasys::BluetoothServer:

oasys::BluetoothSocket oasys::Logger oasys::IOHandlerBase oasys::BluetoothServerThread oasys::RFCOMMServer oasys::RFCOMMServerThread dtn::BluetoothConvergenceLayer::Listener

List of all members.


Detailed Description

Wrapper class for a bluetooth server socket.

Definition at line 33 of file BluetoothServer.h.


Public Member Functions

 BluetoothServer (int socktype, BluetoothSocket::proto_t proto, char *logbase="/btserver")
int timeout_accept (int *fd, bdaddr_t *addr, u_int8_t *channel, int timeout_ms)
int listen ()
 System call wrapper.
int accept (int *fd, bdaddr_t *addr, u_int8_t *channel)
 System call wrapper.

Constructor & Destructor Documentation

oasys::BluetoothServer::BluetoothServer ( int  socktype,
BluetoothSocket::proto_t  proto,
char *  logbase = "/btserver" 
)

Definition at line 31 of file BluetoothServer.cc.


Member Function Documentation

int oasys::BluetoothServer::listen (  ) 

System call wrapper.

Definition at line 39 of file BluetoothServer.cc.

References ASSERT, errno, oasys::BluetoothSocket::fd_, oasys::BluetoothSocket::LISTENING, oasys::LOG_DEBUG, oasys::LOG_ERR, oasys::Logger::logf(), and oasys::BluetoothSocket::set_state().

Referenced by oasys::BluetoothServerThread::bind_listen_start(), and dtn::BluetoothConvergenceLayer::interface_up().

int oasys::BluetoothServer::accept ( int *  fd,
bdaddr_t *  addr,
u_int8_t *  channel 
)

System call wrapper.

Definition at line 58 of file BluetoothServer.cc.

References oasys::IO::ACCEPT, errno, oasys::BluetoothSocket::fd_, oasys::BluetoothSocket::LISTENING, oasys::LOG_ERR, oasys::Logger::logf(), oasys::IOHandlerBase::monitor(), oasys::BluetoothSocket::proto_, oasys::BluetoothSocket::prototoa(), oasys::BluetoothSocket::rc_, oasys::BluetoothSocket::RFCOMM, oasys::BluetoothSocket::state_, and oasys::BluetoothSocket::statetoa().

Referenced by oasys::BluetoothServerThread::run(), and timeout_accept().

int oasys::BluetoothServer::timeout_accept ( int *  fd,
bdaddr_t *  addr,
u_int8_t *  channel,
int  timeout_ms 
)

Try to accept a new connection, but don't block for more than the timeout milliseconds.

Returns:
0 on timeout, 1 on success, -1 on error

Definition at line 92 of file BluetoothServer.cc.

References oasys::IO::ACCEPT, accept(), ASSERT, oasys::IOERROR, oasys::IOHandlerBase::monitor(), and oasys::BluetoothSocket::poll_sockfd().

Referenced by oasys::BluetoothServerThread::run().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:50 2007 for DTN Reference Implementation by  doxygen 1.5.3