dtn::BluetoothConvergenceLayer::Connection Class Reference

#include <BluetoothConvergenceLayer.h>

List of all members.


Detailed Description

Helper class (and thread) that manages an established connection with a peer daemon.

Definition at line 124 of file BluetoothConvergenceLayer.h.


Public Member Functions

 Connection (BluetoothConvergenceLayer *cl, BluetoothLinkParams *params)
 Constructor for the active connect side of a connection.
 Connection (BluetoothConvergenceLayer *cl, BluetoothLinkParams *params, int fd, bdaddr_t addr, u_int8_t channel)
 Constructor for passive accept side of a connection.
virtual ~Connection ()

Protected Member Functions

void recv_data ()
bool recv_contact_header (int timeout)
bool send_bundle (Bundle *bundle)
bool recv_bundle ()
bool handle_reply ()
int handle_ack ()
bool send_ack (u_int32_t bundle_id, size_t acked_len)
bool send_keepalive ()
BluetoothLinkParamsbt_lparams ()
 Utility function to downcast the params_ pointer that's stored in the CLConnection parent class.
virtual void connect ()
 Virtual from CLConnection.
virtual void accept ()
 Virtual from CLConnection.
virtual void disconnect ()
 Virtual from CLConnection.
virtual void initialize_pollfds ()
 Virtual from CLConnection.
virtual void handle_poll_activity ()
 Virtual from CLConnection.
void send_data ()
 virtual from StreamConvergenceLayer::Connection

Protected Attributes

oasys::RFCOMMClientsock_
 The socket.
struct pollfd * sock_pollfd_
 Poll structure for the socket.

Constructor & Destructor Documentation

dtn::BluetoothConvergenceLayer::Connection::Connection ( BluetoothConvergenceLayer cl,
BluetoothLinkParams params 
)

Constructor for the active connect side of a connection.

Definition at line 308 of file BluetoothConvergenceLayer.cc.

References bd2str, dtn::BluetoothConvergenceLayer::BluetoothLinkParams::channel_, oasys::BluetoothSocket::init_socket(), dtn::BluetoothConvergenceLayer::BluetoothLinkParams::local_addr_, oasys::Logger::logpath(), oasys::Logger::logpath_, oasys::Logger::logpathf(), dtn::BluetoothConvergenceLayer::BluetoothLinkParams::remote_addr_, oasys::BluetoothSocket::set_channel(), oasys::BluetoothSocket::set_local_addr(), oasys::BluetoothSocket::set_logfd(), oasys::BluetoothSocket::set_remote_addr(), and sock_.

dtn::BluetoothConvergenceLayer::Connection::Connection ( BluetoothConvergenceLayer cl,
BluetoothLinkParams params,
int  fd,
bdaddr_t  addr,
u_int8_t  channel 
)

Constructor for passive accept side of a connection.

Definition at line 331 of file BluetoothConvergenceLayer.cc.

References bd2str, oasys::Logger::logpath(), oasys::Logger::logpath_, oasys::Logger::logpathf(), dtn::BluetoothConvergenceLayer::BluetoothLinkParams::remote_addr_, oasys::BluetoothSocket::set_logfd(), oasys::BluetoothClient::set_nonblocking(), and sock_.

dtn::BluetoothConvergenceLayer::Connection::~Connection (  )  [virtual]

Definition at line 354 of file BluetoothConvergenceLayer.cc.

References sock_.


Member Function Documentation

void dtn::BluetoothConvergenceLayer::Connection::connect (  )  [protected, virtual]

Virtual from CLConnection.

Definition at line 388 of file BluetoothConvergenceLayer.cc.

References ASSERT, bd2str, dtn::ContactEvent::BROKEN, oasys::BluetoothSocket::channel(), oasys::BluetoothSocket::connect(), errno, oasys::BluetoothSocket::ESTABLISHED, log_debug, log_info, oasys::BluetoothSocket::remote_addr(), oasys::BluetoothClient::set_nonblocking(), sock_, and oasys::BluetoothSocket::state().

void dtn::BluetoothConvergenceLayer::Connection::accept (  )  [protected, virtual]

Virtual from CLConnection.

Definition at line 421 of file BluetoothConvergenceLayer.cc.

References ASSERT, bd2str, oasys::BluetoothSocket::ESTABLISHED, log_debug, oasys::BluetoothSocket::remote_addr(), sock_, and oasys::BluetoothSocket::state().

void dtn::BluetoothConvergenceLayer::Connection::disconnect (  )  [protected, virtual]

Virtual from CLConnection.

Definition at line 433 of file BluetoothConvergenceLayer.cc.

References oasys::BluetoothSocket::close(), oasys::BluetoothSocket::CLOSED, sock_, and oasys::BluetoothSocket::state().

void dtn::BluetoothConvergenceLayer::Connection::initialize_pollfds (  )  [protected, virtual]

Virtual from CLConnection.

Definition at line 361 of file BluetoothConvergenceLayer.cc.

References ASSERT, dtn::ContactEvent::BROKEN, oasys::BluetoothSocket::fd(), log_err, sock_, and sock_pollfd_.

void dtn::BluetoothConvergenceLayer::Connection::handle_poll_activity (  )  [protected, virtual]

Virtual from CLConnection.

Definition at line 442 of file BluetoothConvergenceLayer.cc.

References dtn::ContactEvent::BROKEN, log_debug, log_err, log_info, recv_data(), send_data(), and sock_pollfd_.

void dtn::BluetoothConvergenceLayer::Connection::send_data (  )  [protected]

virtual from StreamConvergenceLayer::Connection

Definition at line 517 of file BluetoothConvergenceLayer.cc.

References ASSERT, dtn::ContactEvent::BROKEN, errno, log_debug, log_info, sock_, sock_pollfd_, and oasys::BluetoothClient::write().

Referenced by handle_poll_activity().

void dtn::BluetoothConvergenceLayer::Connection::recv_data (  )  [protected]

Definition at line 563 of file BluetoothConvergenceLayer.cc.

References ASSERT, dtn::ContactEvent::BROKEN, errno, log_debug, log_err, log_info, oasys::BluetoothClient::read(), and sock_.

Referenced by handle_poll_activity().

bool dtn::BluetoothConvergenceLayer::Connection::recv_contact_header ( int  timeout  )  [protected]

bool dtn::BluetoothConvergenceLayer::Connection::send_bundle ( Bundle bundle  )  [protected]

bool dtn::BluetoothConvergenceLayer::Connection::recv_bundle (  )  [protected]

bool dtn::BluetoothConvergenceLayer::Connection::handle_reply (  )  [protected]

int dtn::BluetoothConvergenceLayer::Connection::handle_ack (  )  [protected]

bool dtn::BluetoothConvergenceLayer::Connection::send_ack ( u_int32_t  bundle_id,
size_t  acked_len 
) [protected]

bool dtn::BluetoothConvergenceLayer::Connection::send_keepalive (  )  [protected]

BluetoothLinkParams* dtn::BluetoothConvergenceLayer::Connection::bt_lparams (  )  [inline, protected]

Utility function to downcast the params_ pointer that's stored in the CLConnection parent class.

Definition at line 168 of file BluetoothConvergenceLayer.h.

References ASSERT.


Member Data Documentation

oasys::RFCOMMClient* dtn::BluetoothConvergenceLayer::Connection::sock_ [protected]

The socket.

Definition at line 176 of file BluetoothConvergenceLayer.h.

Referenced by accept(), connect(), Connection(), disconnect(), initialize_pollfds(), recv_data(), send_data(), and ~Connection().

struct pollfd* dtn::BluetoothConvergenceLayer::Connection::sock_pollfd_ [read, protected]

Poll structure for the socket.

Definition at line 177 of file BluetoothConvergenceLayer.h.

Referenced by handle_poll_activity(), initialize_pollfds(), and send_data().


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