oasys::BluetoothClient Class Reference

#include <BluetoothClient.h>

Inheritance diagram for oasys::BluetoothClient:

oasys::BluetoothSocket oasys::IOClient oasys::Logger oasys::IOHandlerBase oasys::IOHandlerBase oasys::RFCOMMClient List of all members.

Detailed Description

Base class that unifies the BluetoothSocket and IOClient interfaces.

Definition at line 15 of file BluetoothClient.h.

Public Member Functions

 BluetoothClient (int socktype, BluetoothSocket::proto_t proto, const char *logbase, Notifier *intr=0)
 BluetoothClient (int socktype, BluetoothSocket::proto_t proto, int fd, bdaddr_t remote_addr, u_int8_t remote_channel, const char *logbase, Notifier *intr=0)
virtual ~BluetoothClient ()
virtual int read (char *bp, size_t len)
 System call wrappers.
virtual int write (const char *bp, size_t len)
 System call wrappers.
virtual int readv (const struct iovec *iov, int iovcnt)
 System call wrappers.
virtual int writev (const struct iovec *iov, int iovcnt)
 System call wrappers.
virtual int readall (char *bp, size_t len)
 Read/write out the entire supplied buffer, potentially requiring multiple system calls.
virtual int writeall (const char *bp, size_t len)
 Read/write out the entire supplied buffer, potentially requiring multiple system calls.
virtual int readvall (const struct iovec *iov, int iovcnt)
 Read/write out the entire supplied buffer, potentially requiring multiple system calls.
virtual int writevall (const struct iovec *iov, int iovcnt)
 Read/write out the entire supplied buffer, potentially requiring multiple system calls.
virtual int timeout_read (char *bp, size_t len, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_readv (const struct iovec *iov, int iovcnt, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_readall (char *bp, size_t len, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_readvall (const struct iovec *iov, int iovcnt, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_write (const char *bp, size_t len, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_writev (const struct iovec *iov, int iovcnt, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_writeall (const char *bp, size_t len, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int timeout_writevall (const struct iovec *iov, int iovcnt, int timeout_ms)
 Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.
virtual int get_nonblocking (bool *nonblockingp)
 Set the file descriptor's nonblocking status.
virtual int set_nonblocking (bool nonblocking)


Constructor & Destructor Documentation

oasys::BluetoothClient::BluetoothClient ( int  socktype,
BluetoothSocket::proto_t  proto,
const char *  logbase,
Notifier intr = 0 
)

Definition at line 13 of file BluetoothClient.cc.

oasys::BluetoothClient::BluetoothClient ( int  socktype,
BluetoothSocket::proto_t  proto,
int  fd,
bdaddr_t  remote_addr,
u_int8_t  remote_channel,
const char *  logbase,
Notifier intr = 0 
)

Definition at line 20 of file BluetoothClient.cc.

oasys::BluetoothClient::~BluetoothClient (  )  [virtual]

Definition at line 30 of file BluetoothClient.cc.


Member Function Documentation

int oasys::BluetoothClient::read ( char *  bp,
size_t  len 
) [virtual]

System call wrappers.

Implements oasys::IOClient.

Definition at line 35 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::read().

Referenced by dtn::BluetoothConvergenceLayer::Connection::handle_reply().

int oasys::BluetoothClient::write ( const char *  bp,
size_t  len 
) [virtual]

System call wrappers.

Implements oasys::IOClient.

Definition at line 47 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::write().

Referenced by dtn::BluetoothConvergenceLayer::Connection::break_contact(), and dtn::BluetoothConvergenceLayer::Connection::send_keepalive().

int oasys::BluetoothClient::readv ( const struct iovec *  iov,
int  iovcnt 
) [virtual]

System call wrappers.

Implements oasys::IOClient.

Definition at line 41 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::readv().

int oasys::BluetoothClient::writev ( const struct iovec *  iov,
int  iovcnt 
) [virtual]

System call wrappers.

Implements oasys::IOClient.

Definition at line 53 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::writev().

int oasys::BluetoothClient::readall ( char *  bp,
size_t  len 
) [virtual]

Read/write out the entire supplied buffer, potentially requiring multiple system calls.

Returns:
the total number of bytes read/written, or -1 on error

Implements oasys::IOClient.

Definition at line 59 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::readall().

int oasys::BluetoothClient::writeall ( const char *  bp,
size_t  len 
) [virtual]

Read/write out the entire supplied buffer, potentially requiring multiple system calls.

Returns:
the total number of bytes read/written, or -1 on error

Implements oasys::IOClient.

Definition at line 65 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::writeall().

Referenced by dtn::BluetoothConvergenceLayer::Connection::send_bundle(), and dtn::BluetoothConvergenceLayer::Connection::send_contact_header().

int oasys::BluetoothClient::readvall ( const struct iovec *  iov,
int  iovcnt 
) [virtual]

Read/write out the entire supplied buffer, potentially requiring multiple system calls.

Returns:
the total number of bytes read/written, or -1 on error

Implements oasys::IOClient.

Definition at line 71 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::readvall().

int oasys::BluetoothClient::writevall ( const struct iovec *  iov,
int  iovcnt 
) [virtual]

Read/write out the entire supplied buffer, potentially requiring multiple system calls.

Returns:
the total number of bytes read/written, or -1 on error

Implements oasys::IOClient.

Definition at line 77 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::writevall().

Referenced by dtn::BluetoothConvergenceLayer::Connection::send_ack(), and dtn::BluetoothConvergenceLayer::Connection::send_bundle().

int oasys::BluetoothClient::timeout_read ( char *  bp,
size_t  len,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 83 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_read().

Referenced by dtn::BluetoothConvergenceLayer::Connection::recv_announce(), dtn::BluetoothConvergenceLayer::Connection::recv_bundle(), and dtn::BluetoothConvergenceLayer::Connection::recv_loop().

int oasys::BluetoothClient::timeout_readv ( const struct iovec *  iov,
int  iovcnt,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 90 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_readv().

int oasys::BluetoothClient::timeout_readall ( char *  bp,
size_t  len,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 99 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_readall().

Referenced by dtn::BluetoothConvergenceLayer::Connection::recv_contact_header().

int oasys::BluetoothClient::timeout_readvall ( const struct iovec *  iov,
int  iovcnt,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 106 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_readvall().

int oasys::BluetoothClient::timeout_write ( const char *  bp,
size_t  len,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 114 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_write().

int oasys::BluetoothClient::timeout_writev ( const struct iovec *  iov,
int  iovcnt,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 122 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_writev().

int oasys::BluetoothClient::timeout_writeall ( const char *  bp,
size_t  len,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 130 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_writeall().

int oasys::BluetoothClient::timeout_writevall ( const struct iovec *  iov,
int  iovcnt,
int  timeout_ms 
) [virtual]

Try to read/write the specified number of bytes, but don't block for more than timeout milliseconds.

Returns:
the number of bytes read/written or the appropriate IOTimeoutReturn_t code

Implements oasys::IOClient.

Definition at line 138 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::Logger::logpath_, and oasys::IO::timeout_writevall().

int oasys::BluetoothClient::get_nonblocking ( bool nonblockingp  )  [virtual]

Set the file descriptor's nonblocking status.

Implements oasys::IOClient.

Definition at line 146 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::IO::get_nonblocking(), and oasys::Logger::logpath_.

int oasys::BluetoothClient::set_nonblocking ( bool  nonblocking  )  [virtual]

Implements oasys::IOClient.

Definition at line 152 of file BluetoothClient.cc.

References oasys::BluetoothSocket::fd_, oasys::Logger::logpath_, and oasys::IO::set_nonblocking().

Referenced by dtn::BluetoothConvergenceLayer::Connection::break_contact().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:05 2006 for DTN Reference Implementation by  doxygen 1.5.1