Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Opietooth2::OTHCISocket Class Reference

#include </home/clem/local/src/opie/noncore/settings/networksettings2/opietooth2/OTHCISocket.h>

Collaboration diagram for Opietooth2::OTHCISocket:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Error { ErrSocket = 1 }

Signals

void event (unsigned char eventCode, QByteArray buf)
void error (QString message)
void connectionClosed ()

Public Member Functions

 OTHCISocket (OTDriver *ConnectTo)
virtual ~OTHCISocket ()
virtual bool open ()
virtual void close ()
bool sendCommand (unsigned char ogf, unsigned short ocf, QByteArray buf)
bool readStatus (unsigned char ogf, unsigned short ocf, int *status, int timeout_ms=1000)
void readEvent (void)
int socket (void)
QSocketDevice & socketDevice ()
OTDriverdriver () const

Private Slots

void slotSocketActivated ()
void slotSocketError (int)
void slotConnectionClosed ()

Private Member Functions

void updateStatus (const QByteArray &data)

Private Attributes

QGuardedPtr< QSocketNotifier > HCIReadNotifier
QSocketDevice HCISocket
OTDriverDriver
bool BStatusSet
unsigned short LastStatusOcf
unsigned char LastStatusOgf
int LastStatus

Member Enumeration Documentation

enum Opietooth2::OTHCISocket::Error
 

Reads whole HCI packet.

Parameters:
packetType [out] The packet type. Should always be ...
eventCode [out] The event code.
buflen [in/out] The maximum size of the buffer / the number of bytes written into the buffer.
paramBuf pointer to a buffer for the HCI event packet
Returns:
true if successful
Enumeration values:
ErrSocket 

Definition at line 72 of file OTHCISocket.h.


Constructor & Destructor Documentation

OTHCISocket::OTHCISocket OTDriver ConnectTo  ) 
 

Definition at line 25 of file OTHCISocket.cpp.

References BStatusSet, Driver, and HCIReadNotifier.

OTHCISocket::~OTHCISocket  )  [virtual]
 

Definition at line 32 of file OTHCISocket.cpp.

References close().


Member Function Documentation

void OTHCISocket::close  )  [virtual]
 

Closes the HCI socket.

Definition at line 36 of file OTHCISocket.cpp.

References HCIReadNotifier, HCISocket, odebug, and oendl.

Referenced by open(), slotSocketError(), and ~OTHCISocket().

void Opietooth2::OTHCISocket::connectionClosed  )  [signal]
 

Referenced by slotConnectionClosed().

OTDriver* Opietooth2::OTHCISocket::driver void   )  const [inline]
 

Definition at line 83 of file OTHCISocket.h.

References Driver.

void Opietooth2::OTHCISocket::error QString  message  )  [signal]
 

Referenced by open(), and slotSocketError().

void Opietooth2::OTHCISocket::event unsigned char  eventCode,
QByteArray  buf
[signal]
 

Referenced by slotSocketActivated().

bool OTHCISocket::open  )  [virtual]
 

Opens a HCI socket for the given

Returns:
true if sucessfully opened, false otherwise

Definition at line 47 of file OTHCISocket.cpp.

References close(), Opietooth2::OTDriver::devId(), Opietooth2::OTDriver::devname(), Driver, error(), HCIReadNotifier, HCISocket, odebug, oendl, s, slotSocketActivated(), socket(), and tr.

void OTHCISocket::readEvent void   ) 
 

Forces reading the next event packet.

Definition at line 190 of file OTHCISocket.cpp.

References HCIReadNotifier, and slotSocketActivated().

bool OTHCISocket::readStatus unsigned char  ogf,
unsigned short  ocf,
int *  status,
int  timeout_ms = 1000
 

Definition at line 222 of file OTHCISocket.cpp.

References BStatusSet, HCISocket, LastStatus, LastStatusOcf, LastStatusOgf, odebug, oendl, and slotSocketActivated().

bool OTHCISocket::sendCommand unsigned char  ogf,
unsigned short  ocf,
QByteArray  buf
 

Definition at line 197 of file OTHCISocket.cpp.

References QBuffer::buffer(), QBuffer::close(), HCISocket, IO_WriteOnly, QDataStream::LittleEndian, QBuffer::open(), QDataStream::setByteOrder(), stream, and QDataStream::writeRawBytes().

void OTHCISocket::slotConnectionClosed  )  [private, slot]
 

Definition at line 185 of file OTHCISocket.cpp.

References connectionClosed(), odebug, and oendl.

Referenced by slotSocketActivated().

void OTHCISocket::slotSocketActivated  )  [private, slot]
 

Definition at line 124 of file OTHCISocket.cpp.

References buf, event(), HCISocket, len, odebug, oendl, slotConnectionClosed(), slotSocketError(), and updateStatus().

Referenced by open(), readEvent(), and readStatus().

void OTHCISocket::slotSocketError int   )  [private, slot]
 

Definition at line 114 of file OTHCISocket.cpp.

References close(), Opietooth2::OTDriver::devname(), Driver, error(), and tr.

Referenced by slotSocketActivated().

int OTHCISocket::socket void   ) 
 

Returns the internal socket

Definition at line 272 of file OTHCISocket.cpp.

References HCISocket.

Referenced by open().

QSocketDevice& Opietooth2::OTHCISocket::socketDevice  )  [inline]
 

Definition at line 80 of file OTHCISocket.h.

References HCISocket.

void OTHCISocket::updateStatus const QByteArray data  )  [private]
 

Definition at line 169 of file OTHCISocket.cpp.

References BStatusSet, IO_ReadOnly, LastStatus, LastStatusOcf, LastStatusOgf, QDataStream::LittleEndian, QDataStream::setByteOrder(), and stream.

Referenced by slotSocketActivated().


Member Data Documentation

bool Opietooth2::OTHCISocket::BStatusSet [private]
 

Definition at line 101 of file OTHCISocket.h.

Referenced by OTHCISocket(), readStatus(), and updateStatus().

OTDriver* Opietooth2::OTHCISocket::Driver [private]
 

Definition at line 99 of file OTHCISocket.h.

Referenced by driver(), open(), OTHCISocket(), and slotSocketError().

QGuardedPtr<QSocketNotifier> Opietooth2::OTHCISocket::HCIReadNotifier [private]
 

Definition at line 97 of file OTHCISocket.h.

Referenced by close(), open(), OTHCISocket(), and readEvent().

QSocketDevice Opietooth2::OTHCISocket::HCISocket [private]
 

Definition at line 98 of file OTHCISocket.h.

Referenced by close(), open(), readStatus(), sendCommand(), slotSocketActivated(), socket(), and socketDevice().

int Opietooth2::OTHCISocket::LastStatus [private]
 

Definition at line 104 of file OTHCISocket.h.

Referenced by readStatus(), and updateStatus().

unsigned short Opietooth2::OTHCISocket::LastStatusOcf [private]
 

Definition at line 102 of file OTHCISocket.h.

Referenced by readStatus(), and updateStatus().

unsigned char Opietooth2::OTHCISocket::LastStatusOgf [private]
 

Definition at line 103 of file OTHCISocket.h.

Referenced by readStatus(), and updateStatus().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:03:05 2005 for OPIE by  doxygen 1.4.2