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

Opietooth2::OTDevice Class Reference

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

Collaboration diagram for Opietooth2::OTDevice:

Collaboration graph
[legend]
List of all members.

Signals

void error (const QString &mesg)
void isEnabled (int devnr, bool)

Public Member Functions

 OTDevice (OTGateway *_OT)
 ~OTDevice ()
OTGatewaygateway () const
bool needsAttach (void) const
int deviceNr () const
bool attach ()
bool detach ()
bool isAttached () const
bool checkAttach ()
QString getRFCommDevicePattern ()

Private Slots

void slotStdOut (Opie::Core::OProcess *, char *, int)
void slotStdErr (Opie::Core::OProcess *, char *, int)

Private Member Functions

void detectDeviceType (QString &Device, QString &Mode, unsigned long &Speed)
pid_t getPidOfHCIAttach (void)

Private Attributes

Opie::Core::OProcessm_hciattach
int m_deviceNr
pid_t m_hciattachPid
OTGatewayOT
bool NeedsAttach

Detailed Description

Device takes care of attaching serial devices to the blueZ stack. After attaching it hciconfig ups it

Definition at line 29 of file OTDevice.h.


Constructor & Destructor Documentation

OTDevice::OTDevice OTGateway _OT  ) 
 

Brings up the device. will detech which device is needed Usage example: new Device(/dev/ttySB0, csr)

Definition at line 17 of file OTDevice.cpp.

References detectDeviceType(), getPidOfHCIAttach(), m_deviceNr, m_hciattach, m_hciattachPid, needsAttach(), and OT.

OTDevice::~OTDevice  ) 
 

unloads the device

Definition at line 48 of file OTDevice.cpp.

References Opie::Core::OProcess::detach(), m_hciattach, and needsAttach().


Member Function Documentation

bool OTDevice::attach  ) 
 

attach the device

Returns:
bool which is TRUE if command started sucessfully

Definition at line 56 of file OTDevice.cpp.

References OProcess::AllOutput, detectDeviceType(), OProcess::DontCare, error(), FALSE, m_hciattach, m_hciattachPid, needsAttach(), OProcess, slotStdErr(), slotStdOut(), tr, and TRUE.

bool OTDevice::checkAttach  ) 
 

Definition at line 122 of file OTDevice.cpp.

References QDir::exists(), getPidOfHCIAttach(), isEnabled(), m_deviceNr, m_hciattachPid, needsAttach(), S, QString::setNum(), and TRUE.

Referenced by Opietooth2::OTGateway::updateDrivers().

bool OTDevice::detach  ) 
 

detach the device

Returns:
bool which is TRUE if command started sucessfully

Definition at line 97 of file OTDevice.cpp.

References error(), FALSE, isEnabled(), m_deviceNr, m_hciattach, m_hciattachPid, needsAttach(), odebug, oendl, tr, and TRUE.

void OTDevice::detectDeviceType QString Device,
QString Mode,
unsigned long &  Speed
[private]
 

Definition at line 209 of file OTDevice.cpp.

References model, Opie::Core::Model_GenuineIntel, Opie::Core::Model_iPAQ_H39xx, Opie::Core::Model_iPAQ_H5xxx, NeedsAttach, odebug, and oendl.

Referenced by attach(), and OTDevice().

int Opietooth2::OTDevice::deviceNr  )  const [inline]
 

Definition at line 54 of file OTDevice.h.

References m_deviceNr.

void Opietooth2::OTDevice::error const QString mesg  )  [signal]
 

Signals if the attach/detach of the device produced errors

Parameters:
Mesg contains an error message

Referenced by attach(), and detach().

OTGateway* Opietooth2::OTDevice::gateway  )  const [inline]
 

Definition at line 48 of file OTDevice.h.

References OT.

pid_t OTDevice::getPidOfHCIAttach void   )  [private]
 

Definition at line 175 of file OTDevice.cpp.

References QValueList< T >::begin(), QDir::Dirs, QValueList< T >::end(), QDir::entryList(), QRegExp::match(), needsAttach(), QDir::path(), QFileInfo::readLink(), and QFileInfo::setFile().

Referenced by checkAttach(), and OTDevice().

QString OTDevice::getRFCommDevicePattern  ) 
 

Definition at line 246 of file OTDevice.cpp.

References QDir::exists().

Referenced by BluetoothRFCOMMRun::deviceFile().

bool OTDevice::isAttached  )  const
 

Is the device loaded?

Returns:
bool, if the device is loaded

Definition at line 118 of file OTDevice.cpp.

References m_hciattachPid, and needsAttach().

void Opietooth2::OTDevice::isEnabled int  devnr,
bool 
[signal]
 

Referenced by checkAttach(), detach(), and slotStdOut().

bool Opietooth2::OTDevice::needsAttach void   )  const [inline]
 

Definition at line 51 of file OTDevice.h.

References NeedsAttach.

Referenced by attach(), checkAttach(), detach(), getPidOfHCIAttach(), isAttached(), OTDevice(), and ~OTDevice().

void OTDevice::slotStdErr Opie::Core::OProcess ,
char *  ,
int 
[private, slot]
 

Definition at line 164 of file OTDevice.cpp.

References QString::append(), m_hciattach, odebug, oendl, and Opie::Internal::string().

Referenced by attach().

void OTDevice::slotStdOut Opie::Core::OProcess ,
char *  ,
int 
[private, slot]
 

Definition at line 150 of file OTDevice.cpp.

References Opie::Core::OProcess::detach(), isEnabled(), m_deviceNr, and m_hciattach.

Referenced by attach().


Member Data Documentation

int Opietooth2::OTDevice::m_deviceNr [private]
 

Definition at line 107 of file OTDevice.h.

Referenced by checkAttach(), detach(), deviceNr(), OTDevice(), and slotStdOut().

Opie::Core::OProcess* Opietooth2::OTDevice::m_hciattach [private]
 

Definition at line 105 of file OTDevice.h.

Referenced by attach(), detach(), OTDevice(), slotStdErr(), slotStdOut(), and ~OTDevice().

pid_t Opietooth2::OTDevice::m_hciattachPid [private]
 

Definition at line 108 of file OTDevice.h.

Referenced by attach(), checkAttach(), detach(), isAttached(), and OTDevice().

bool Opietooth2::OTDevice::NeedsAttach [private]
 

Definition at line 112 of file OTDevice.h.

Referenced by detectDeviceType(), and needsAttach().

OTGateway* Opietooth2::OTDevice::OT [private]
 

Definition at line 111 of file OTDevice.h.

Referenced by gateway(), and OTDevice().


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