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

Opietooth2::OTGateway Class Reference

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

Collaboration diagram for Opietooth2::OTGateway:

Collaboration graph
[legend]
List of all members.

Public Slots

void SLOT_SetEnabled (bool)
void SLOT_Enable ()
void SLOT_Disable ()
void SLOT_ShowError (const QString &)
void SLOT_Enabled (int, bool)
void SLOT_DriverDisappeared (OTDriver *)
void SLOT_PeerDetected (OTPeer *, bool)
void SLOT_FinishedDetecting ()

Signals

void error (const QString &)
void stateChange (OTDriver *D, bool State)
void driverListChanged ()
void deviceEnabled (bool)
void detectedPeer (OTPeer *, bool)
void finishedDetecting ()

Public Member Functions

 OTGateway (void)
 ~OTGateway (void)
OTDevicegetOTDevice ()
bool needsEnabling ()
bool isEnabled ()
void setRefreshTimer (int MilleSecs)
int getSocket ()
OTDriverListgetDriverList ()
OTDriverdriver (int nr)
void updateDrivers ()
PANNetworkSetupVector getPANNetworkSetups ()
void scanNeighbourhood (OTDriver *D=0)
void stopScanOfNeighbourhood (void)
void setScanWith (OTDriver *D=0)
OTDriverscanWith (void)
const PeerVectorpeers (void)
bool isPeerUp (const OTDeviceAddress &PAddr, int timeoutInSec=1, int timeoutInUSec=0, int retry=1)
OTPeerfindPeer (const OTDeviceAddress &Addr)
void removePeer (OTPeer *P)
void addPeer (OTPeer *P)
OTDriverfindDriver (const OTDeviceAddress &Addr)
const LinkKeyArraygetLinkKeys () const
bool removeLinkKey (unsigned int index)
int connectedToRFCommChannel (const OTDeviceAddress &Addr, int channel)
int getFreeRFCommDevice (void)
int releaseRFCommDevice (int DevNr)

Static Public Member Functions

static OTGatewaygetOTGateway (void)
static void releaseOTGateway (void)
static const char * deviceTypeToName (int Cls)

Protected Member Functions

void connectNotify (const char *Signal)
void disconnectNotify (const char *Signal)
void timerEvent (QTimerEvent *)

Private Member Functions

void loadActiveNetworkSetups (void)
void loadKnownPeers (void)
void saveKnownPeers (void)
bool isConnectedTo (int devid, const OTDeviceAddress &Address)
void readLinkKeys ()

Private Attributes

OTDriverScanWith
OTDriverList AllDrivers
OTDeviceTheOTDevice
int HciCtl
int ErrorConnectCount
int RefreshTimer
OTInquiryScanning
bool AllPeersModified
PeerVector AllPeers
LinkKeyArray AllKeys

Static Private Attributes

static OTGatewaySingleGateway = 0
static int UseCount = 0

Constructor & Destructor Documentation

OTGateway::OTGateway void   ) 
 

Definition at line 44 of file OTGateway.cpp.

References AllPeers, AllPeersModified, ErrorConnectCount, HciCtl, loadActiveNetworkSetups(), loadKnownPeers(), readLinkKeys(), RefreshTimer, Scanning, setRefreshTimer(), SLOT_ShowError(), TheOTDevice, timerEvent(), tr, TRUE, and updateDrivers().

Referenced by getOTGateway().

OTGateway::~OTGateway void   ) 
 

Definition at line 79 of file OTGateway.cpp.

References AllPeersModified, HciCtl, saveKnownPeers(), Scanning, and TheOTDevice.


Member Function Documentation

void OTGateway::addPeer OTPeer P  ) 
 

Definition at line 329 of file OTGateway.cpp.

References AllPeers, and AllPeersModified.

Referenced by loadActiveNetworkSetups(), loadKnownPeers(), and SLOT_PeerDetected().

int OTGateway::connectedToRFCommChannel const OTDeviceAddress Addr,
int  channel
 

Definition at line 631 of file OTGateway.cpp.

References error(), i, s, and tr.

Referenced by BluetoothRFCOMMRun::deviceNrOfNetworkSetup().

void OTGateway::connectNotify const char *  Signal  )  [protected]
 

Definition at line 171 of file OTGateway.cpp.

References ErrorConnectCount.

void Opietooth2::OTGateway::detectedPeer OTPeer ,
bool 
[signal]
 

Referenced by SLOT_PeerDetected().

void Opietooth2::OTGateway::deviceEnabled bool   )  [signal]
 

Referenced by SLOT_Enabled().

const char * OTGateway::deviceTypeToName int  Cls  )  [static]
 

Definition at line 355 of file OTGateway.cpp.

Referenced by Opietooth2::OTScan::SLOT_NewPeer().

void OTGateway::disconnectNotify const char *  Signal  )  [protected]
 

Definition at line 177 of file OTGateway.cpp.

References ErrorConnectCount.

OTDriver* Opietooth2::OTGateway::driver int  nr  )  [inline]
 

Definition at line 91 of file OTGateway.h.

References AllDrivers.

Referenced by Opietooth2::OTScan::getDevice(), isEnabled(), and Opietooth2::OTMain::SLOT_Scan().

void Opietooth2::OTGateway::driverListChanged  )  [signal]
 

Referenced by updateDrivers().

void Opietooth2::OTGateway::error const QString  )  [signal]
 

Referenced by connectedToRFCommChannel(), getFreeRFCommDevice(), getOTDevice(), loadActiveNetworkSetups(), readLinkKeys(), releaseRFCommDevice(), removeLinkKey(), SLOT_ShowError(), and updateDrivers().

OTDriver * OTGateway::findDriver const OTDeviceAddress Addr  ) 
 

Definition at line 309 of file OTGateway.cpp.

References AllDrivers, and i.

Referenced by Opietooth2::OTPairing::OTPairing().

OTPeer * OTGateway::findPeer const OTDeviceAddress Addr  ) 
 

Definition at line 300 of file OTGateway.cpp.

References AllPeers, and i.

Referenced by loadActiveNetworkSetups(), and Opietooth2::OTPairing::OTPairing().

void Opietooth2::OTGateway::finishedDetecting  )  [signal]
 

Referenced by SLOT_FinishedDetecting().

OTDriverList& Opietooth2::OTGateway::getDriverList  )  [inline]
 

Definition at line 89 of file OTGateway.h.

References AllDrivers.

Referenced by Opietooth2::OTScan::getDevice(), Opietooth2::OTMain::SLOT_DriverListChanged(), Opietooth2::OTManage::SLOT_DriverListChanged(), and Opietooth2::OTMain::SLOT_Scan().

int OTGateway::getFreeRFCommDevice void   ) 
 

Definition at line 680 of file OTGateway.cpp.

References byID(), error(), i, s, and tr.

Referenced by BluetoothRFCOMMRun::setMyState().

const LinkKeyArray& Opietooth2::OTGateway::getLinkKeys  )  const [inline]
 

Definition at line 120 of file OTGateway.h.

References AllKeys.

Referenced by Opietooth2::OTPairing::OTPairing(), Opietooth2::OTScan::SLOT_CleanupOld(), and Opietooth2::OTScan::SLOT_Show().

OTDevice * OTGateway::getOTDevice  ) 
 

Definition at line 106 of file OTGateway.cpp.

References error(), isEnabled(), SLOT_Enabled(), SLOT_ShowError(), and TheOTDevice.

Referenced by BluetoothRFCOMMRun::deviceFile(), isEnabled(), needsEnabling(), SLOT_Disable(), and SLOT_Enable().

OTGateway * OTGateway::getOTGateway void   )  [static]
 

Definition at line 26 of file OTGateway.cpp.

References OTGateway(), SingleGateway, and UseCount.

Referenced by Opietooth2::Opietooth2Applet::Opietooth2Applet(), Opietooth2::OTMain::OTMain(), Opietooth2::OTManage::OTManage(), Opietooth2::OTPairing::OTPairing(), Opietooth2::OTScan::OTScan(), and Opietooth2::OTSniffing::OTSniffing().

PANNetworkSetupVector OTGateway::getPANNetworkSetups  ) 
 

Definition at line 378 of file OTGateway.cpp.

References device, i, odebug, oendl, and TRUE.

Referenced by BluetoothBNEPRun::hasFreePANNetworkSetup().

int Opietooth2::OTGateway::getSocket  )  [inline]
 

Definition at line 86 of file OTGateway.h.

References HciCtl.

Referenced by Opietooth2::OTDriver::currentState(), loadActiveNetworkSetups(), and Opietooth2::OTDriverList::update().

bool Opietooth2::OTGateway::isConnectedTo int  devid,
const OTDeviceAddress Address
[private]
 

bool OTGateway::isEnabled  ) 
 

Definition at line 146 of file OTGateway.cpp.

References AllDrivers, driver(), getOTDevice(), and TRUE.

Referenced by BluetoothRFCOMMRun::detectState(), BluetoothBNEPRun::detectState(), Opietooth2::OTScan::getDevice(), getOTDevice(), Opietooth2::Opietooth2Applet::mousePressEvent(), Opietooth2::OTMain::OTMain(), Opietooth2::OTPairing::OTPairing(), and Opietooth2::Opietooth2Applet::paintEvent().

bool Opietooth2::OTGateway::isPeerUp const OTDeviceAddress PAddr,
int  timeoutInSec = 1,
int  timeoutInUSec = 0,
int  retry = 1
 

void OTGateway::loadActiveNetworkSetups void   )  [private]
 

Definition at line 513 of file OTGateway.cpp.

References addPeer(), AllDrivers, error(), findPeer(), getSocket(), i, MAXCONNECTIONS, P, Opietooth2::OTPeer::Peer_Up, Opietooth2::OTPeer::setAddress(), Opietooth2::OTDeviceAddress::setBDAddr(), Opietooth2::OTPeer::setConnectedTo(), Opietooth2::OTPeer::setName(), Opietooth2::OTPeer::setState(), and tr.

Referenced by OTGateway().

void OTGateway::loadKnownPeers void   )  [private]
 

Definition at line 570 of file OTGateway.cpp.

References addPeer(), AllPeersModified, QDir::cd(), QDir::exists(), F(), QDir::home(), IO_ReadOnly, QFile::open(), QDir::path(), and QTextStream::readLine().

Referenced by OTGateway().

bool OTGateway::needsEnabling  ) 
 

Definition at line 142 of file OTGateway.cpp.

References getOTDevice().

Referenced by Opietooth2::OTMain::OTMain().

const PeerVector& Opietooth2::OTGateway::peers void   )  [inline]
 

Definition at line 107 of file OTGateway.h.

References AllPeers.

Referenced by Opietooth2::OTScan::OTScan().

void OTGateway::readLinkKeys  )  [private]
 

Definition at line 423 of file OTGateway.cpp.

References AllKeys, error(), F(), IO_ReadOnly, QFile::open(), QFile::readBlock(), and tr.

Referenced by OTGateway().

void OTGateway::releaseOTGateway void   )  [static]
 

Definition at line 35 of file OTGateway.cpp.

References SingleGateway, and UseCount.

Referenced by Opietooth2::Opietooth2Applet::~Opietooth2Applet(), Opietooth2::OTMain::~OTMain(), Opietooth2::OTManage::~OTManage(), Opietooth2::OTPairing::~OTPairing(), and Opietooth2::OTScan::~OTScan().

int OTGateway::releaseRFCommDevice int  DevNr  ) 
 

Definition at line 727 of file OTGateway.cpp.

References error(), i, s, and tr.

Referenced by BluetoothRFCOMMRun::setMyState().

bool OTGateway::removeLinkKey unsigned int  index  ) 
 

Definition at line 453 of file OTGateway.cpp.

References AllKeys, error(), F(), Opietooth2::OTLinkKey::from(), IO_ReadOnly, IO_Truncate, IO_WriteOnly, QFile::open(), QFile::readBlock(), QDir::remove(), QDir::rename(), Opietooth2::OTLinkKey::to(), tr, and QFile::writeBlock().

Referenced by Opietooth2::OTPairing::SLOT_Unpair().

void OTGateway::removePeer OTPeer P  ) 
 

Definition at line 335 of file OTGateway.cpp.

References AllPeers, AllPeersModified, and i.

Referenced by Opietooth2::OTScan::SLOT_CleanupOld().

void OTGateway::saveKnownPeers void   )  [private]
 

Definition at line 600 of file OTGateway.cpp.

References AllPeers, AllPeersModified, QDir::cd(), Opie::Core::endl(), QDir::exists(), F(), QDir::home(), i, IO_Truncate, IO_WriteOnly, QDir::mkdir(), QFile::open(), QDir::path(), and S.

Referenced by ~OTGateway().

void OTGateway::scanNeighbourhood OTDriver D = 0  ) 
 

Definition at line 273 of file OTGateway.cpp.

References Opietooth2::OTInquiry::inquire(), Scanning, scanWith(), setScanWith(), SLOT_FinishedDetecting(), SLOT_PeerDetected(), and stopScanOfNeighbourhood().

Referenced by Opietooth2::OTScan::SLOT_DoScan().

OTDriver* Opietooth2::OTGateway::scanWith void   )  [inline]
 

Definition at line 103 of file OTGateway.h.

References ScanWith.

Referenced by scanNeighbourhood(), Opietooth2::OTMain::SLOT_DriverListChanged(), and Opietooth2::OTSniffing::SLOT_Trace().

void OTGateway::setRefreshTimer int  MilleSecs  ) 
 

Definition at line 96 of file OTGateway.cpp.

References RefreshTimer.

Referenced by OTGateway(), and Opietooth2::OTManage::SLOT_SetRefreshTimer().

void Opietooth2::OTGateway::setScanWith OTDriver D = 0  )  [inline]
 

Definition at line 100 of file OTGateway.h.

References AllDrivers, and ScanWith.

Referenced by Opietooth2::OTScan::getDevice(), scanNeighbourhood(), Opietooth2::OTMain::SLOT_Scan(), and updateDrivers().

void OTGateway::SLOT_Disable  )  [slot]
 

Definition at line 138 of file OTGateway.cpp.

References getOTDevice().

Referenced by SLOT_SetEnabled().

void OTGateway::SLOT_DriverDisappeared OTDriver  )  [slot]
 

Definition at line 268 of file OTGateway.cpp.

References Opietooth2::OTDriver::devname(), odebug, oendl, and updateDrivers().

Referenced by updateDrivers().

void OTGateway::SLOT_Enable  )  [slot]
 

Definition at line 134 of file OTGateway.cpp.

References getOTDevice().

Referenced by SLOT_SetEnabled().

void OTGateway::SLOT_Enabled int  ,
bool 
[slot]
 

Definition at line 213 of file OTGateway.cpp.

References AllDrivers, deviceEnabled(), odebug, oendl, and updateDrivers().

Referenced by getOTDevice().

void OTGateway::SLOT_FinishedDetecting  )  [slot]
 

Definition at line 350 of file OTGateway.cpp.

References finishedDetecting(), and stopScanOfNeighbourhood().

Referenced by scanNeighbourhood().

void OTGateway::SLOT_PeerDetected OTPeer ,
bool 
[slot]
 

Definition at line 318 of file OTGateway.cpp.

References addPeer(), detectedPeer(), Opietooth2::OTPeer::name(), odebug, and oendl.

Referenced by scanNeighbourhood().

void OTGateway::SLOT_SetEnabled bool   )  [slot]
 

Definition at line 126 of file OTGateway.cpp.

References SLOT_Disable(), and SLOT_Enable().

Referenced by Opietooth2::Opietooth2Applet::mousePressEvent(), and Opietooth2::OTMain::SLOT_EnableBluetooth().

void OTGateway::SLOT_ShowError const QString  )  [slot]
 

Definition at line 156 of file OTGateway.cpp.

References error(), ErrorConnectCount, odebug, oendl, tr, and warning().

Referenced by getOTDevice(), OTGateway(), and updateDrivers().

void Opietooth2::OTGateway::stateChange OTDriver D,
bool  State
[signal]
 

Referenced by timerEvent(), and updateDrivers().

void OTGateway::stopScanOfNeighbourhood void   ) 
 

Definition at line 343 of file OTGateway.cpp.

References Scanning.

Referenced by scanNeighbourhood(), Opietooth2::OTScan::SLOT_DoScan(), and SLOT_FinishedDetecting().

void OTGateway::timerEvent QTimerEvent *   )  [protected]
 

Definition at line 183 of file OTGateway.cpp.

References AllDrivers, Opietooth2::OTDriver::currentState(), i, Opietooth2::OTDriver::isUp(), stateChange(), Opietooth2::OTDriverList::update(), and updateDrivers().

Referenced by OTGateway().

void OTGateway::updateDrivers  ) 
 

Definition at line 226 of file OTGateway.cpp.

References AllDrivers, Opietooth2::OTDevice::checkAttach(), driverListChanged(), error(), i, odebug, oendl, setScanWith(), SLOT_DriverDisappeared(), SLOT_ShowError(), stateChange(), TheOTDevice, and Opietooth2::OTDriverList::update().

Referenced by OTGateway(), SLOT_DriverDisappeared(), SLOT_Enabled(), and timerEvent().


Member Data Documentation

OTDriverList Opietooth2::OTGateway::AllDrivers [private]
 

Definition at line 188 of file OTGateway.h.

Referenced by driver(), findDriver(), getDriverList(), isEnabled(), loadActiveNetworkSetups(), setScanWith(), SLOT_Enabled(), timerEvent(), and updateDrivers().

LinkKeyArray Opietooth2::OTGateway::AllKeys [private]
 

Definition at line 196 of file OTGateway.h.

Referenced by getLinkKeys(), readLinkKeys(), and removeLinkKey().

PeerVector Opietooth2::OTGateway::AllPeers [private]
 

Definition at line 195 of file OTGateway.h.

Referenced by addPeer(), findPeer(), OTGateway(), peers(), removePeer(), and saveKnownPeers().

bool Opietooth2::OTGateway::AllPeersModified [private]
 

Definition at line 194 of file OTGateway.h.

Referenced by addPeer(), loadKnownPeers(), OTGateway(), removePeer(), saveKnownPeers(), and ~OTGateway().

int Opietooth2::OTGateway::ErrorConnectCount [private]
 

Definition at line 191 of file OTGateway.h.

Referenced by connectNotify(), disconnectNotify(), OTGateway(), and SLOT_ShowError().

int Opietooth2::OTGateway::HciCtl [private]
 

Definition at line 190 of file OTGateway.h.

Referenced by getSocket(), OTGateway(), and ~OTGateway().

int Opietooth2::OTGateway::RefreshTimer [private]
 

Definition at line 192 of file OTGateway.h.

Referenced by OTGateway(), and setRefreshTimer().

OTInquiry* Opietooth2::OTGateway::Scanning [private]
 

Definition at line 193 of file OTGateway.h.

Referenced by OTGateway(), scanNeighbourhood(), stopScanOfNeighbourhood(), and ~OTGateway().

OTDriver* Opietooth2::OTGateway::ScanWith [private]
 

Definition at line 187 of file OTGateway.h.

Referenced by scanWith(), and setScanWith().

OTGateway * OTGateway::SingleGateway = 0 [static, private]
 

Definition at line 23 of file OTGateway.cpp.

Referenced by getOTGateway(), and releaseOTGateway().

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

Definition at line 189 of file OTGateway.h.

Referenced by getOTDevice(), OTGateway(), updateDrivers(), and ~OTGateway().

int OTGateway::UseCount = 0 [static, private]
 

Definition at line 24 of file OTGateway.cpp.

Referenced by getOTGateway(), and releaseOTGateway().


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