Barry::Socket Class Reference

#include <socket.h>

List of all members.


Detailed Description

Encapsulates a "logical socket" in the Blackberry USB protocol.

By default, provides raw send/receive access, as well as packet writing on socket 0, which is always open.

There are Open and Close members to open data sockets which are used to transfer data to and from the device.

The destructor will close any non-0 open sockets automatically.

Requires an active Usb::Device object to work on.

Definition at line 119 of file socket.h.

Public Member Functions

 ~Socket ()
uint16_t GetSocket () const
uint8_t GetCloseFlag () const
void Close ()
void Send (Data &send, int timeout=-1)
 Sends 'send' data to device, no receive.
void Send (Data &send, Data &receive, int timeout=-1)
 Sends 'send' data to device, and waits for response.
void Send (Barry::Packet &packet, int timeout=-1)
void Receive (Data &receive, int timeout=-1)
void Packet (Data &send, Data &receive, int timeout=-1)
void Packet (Barry::Packet &packet, int timeout=-1)
void NextRecord (Data &receive)
void RegisterInterest (SocketRoutingQueue::SocketDataHandler handler, void *context)
void UnregisterInterest ()

Protected Member Functions

void CheckSequence (const Data &seq)
void ForceClosed ()
 Socket (SocketZero &zero, uint16_t socket, uint8_t closeFlag)

Friends

class SocketZero


Member Function Documentation

void Barry::Socket::Send ( Data send,
int  timeout = -1 
)

Sends 'send' data to device, no receive.

Returns:
void
Exceptions:
Usb::Error on underlying bus errors.

Definition at line 633 of file socket.cc.

References Barry::Data::GetBuffer(), Barry::Data::GetSize(), htobs, MAKE_PACKETPTR_BUF, Barry::SocketZero::RawSend(), and SB_PACKET_HEADER_SIZE.

Referenced by Packet(), and Send().

void Barry::Socket::Send ( Data send,
Data receive,
int  timeout = -1 
)

Sends 'send' data to device, and waits for response.

Returns:
void
Exceptions:
Usb::Error on underlying bus errors.

Definition at line 652 of file socket.cc.

References Receive(), and Send().


The documentation for this class was generated from the following files:
Generated on Wed Sep 24 21:27:33 2008 for Barry by  doxygen 1.5.1