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

OpieTooth::Manager Class Reference

#include </home/clem/local/src/opie/noncore/net/opietooth/lib/manager.h>

Collaboration diagram for OpieTooth::Manager:

Collaboration graph
[legend]
List of all members.

Signals

void available (const QString &device, bool connected)
void addedService (const QString &service, bool added)
void removedService (const QString &service, bool removed)
void foundServices (const QString &device, Services::ValueList)
void foundDevices (const QString &device, RemoteDevice::ValueList)
void connections (ConnectionState::ValueList)
void signalStrength (const QString &mac, const QString &strengh)

Public Member Functions

 Manager (const QString &device)
 Manager (Device *dev)
 Manager ()
 ~Manager ()
void setDevice (const QString &device)
void setDevice (Device *dev)
void isAvailable (const QString &device=QString::null)
void isAvailable (Device *dev)
void searchDevices (const QString &device=QString::null)
void searchDevices (Device *d)
void addService (const QString &name)
void addServices (const QStringList &names)
void removeService (const QString &name)
void removeServices (const QStringList &)
void searchServices (const QString &remDevice)
void searchServices (const RemoteDevice &)
void connectTo (const QString &)
void searchConnections ()
void signalStrength (const QString &mac)
QString toDevice (const QString &mac)
QString toMac (const QString &device)

Private Slots

void slotProcessExited (Opie::Core::OProcess *)
void slotSDPExited (Opie::Core::OProcess *)
void slotSDPOut (Opie::Core::OProcess *, char *, int)
void slotHCIExited (Opie::Core::OProcess *)
void slotHCIOut (Opie::Core::OProcess *, char *, int)
void slotConnectionExited (Opie::Core::OProcess *)
void slotConnectionOutput (Opie::Core::OProcess *, char *, int)
void slotSignalStrengthOutput (Opie::Core::OProcess *, char *, int)
void slotSignalStrengthExited (Opie::Core::OProcess *)

Private Member Functions

Services::ValueList parseSDPOutput (const QString &)
RemoteDevice::ValueList parseHCIOutput (const QString &)
ConnectionState::ValueList parseConnections (const QString &)

Private Attributes

Opie::Core::OProcessm_hcitool
Opie::Core::OProcessm_sdp
QString m_device
QMap< QString, int > m_signalStrength
QMap< QString, QStringm_out
QMap< QString, QStringm_devices
QMap< Opie::Core::OProcess *,
QString
m_signalMac
QString m_hcitoolCon

Detailed Description

Manager manages a blueZ device (hci0 for example) without Manager you can control the things you could do from command line in a OO and asynchronus way.

Definition at line 22 of file manager.h.


Constructor & Destructor Documentation

Manager::Manager const QString device  ) 
 

c'tor whichs create a new Manager

Parameters:
device is the device to use. Either a mac or blueZ device name

Definition at line 13 of file manager.cc.

References m_device, m_hcitool, m_sdp, odebug, and oendl.

Manager::Manager Device dev  ) 
 

c'tor

Parameters:
dev The Device to be managed We don't care of Device so you need to delete it

Definition at line 21 of file manager.cc.

References m_hcitool, and m_sdp.

Manager::Manager  ) 
 

c'tor

Definition at line 27 of file manager.cc.

References m_hcitool, and m_sdp.

Manager::~Manager  ) 
 

Definition at line 33 of file manager.cc.

References m_hcitool, and m_sdp.


Member Function Documentation

void OpieTooth::Manager::addedService const QString service,
bool  added
[signal]
 

Referenced by addService().

void Manager::addService const QString name  ) 
 

This will add the service

Parameters:
name to the sdpd daemon It will start the daemon if necessary

Definition at line 81 of file manager.cc.

References addedService(), OProcess::DontCare, and Opie::Core::OProcess::start().

Referenced by addServices().

void Manager::addServices const QStringList names  ) 
 

This will add the services

Parameters:
names to the sdpd daemon It will start the daemon if necessary

Definition at line 89 of file manager.cc.

References addService(), QValueList< T >::begin(), and QValueList< T >::end().

void OpieTooth::Manager::available const QString device,
bool  connected
[signal]
 

Referenced by isAvailable(), and slotProcessExited().

void OpieTooth::Manager::connections ConnectionState::ValueList   )  [signal]
 

Referenced by searchConnections(), and slotConnectionExited().

void Manager::connectTo const QString  ) 
 

Starts to connect to the device in

Parameters:
 

Definition at line 237 of file manager.cc.

References OProcess::DontCare, and Opie::Core::OProcess::start().

void OpieTooth::Manager::foundDevices const QString device,
RemoteDevice::ValueList 
[signal]
 

Referenced by searchDevices(), and slotHCIExited().

void OpieTooth::Manager::foundServices const QString device,
Services::ValueList 
[signal]
 

Referenced by searchServices(), and slotSDPExited().

void Manager::isAvailable Device dev  ) 
 

same as above

Definition at line 56 of file manager.cc.

void Manager::isAvailable const QString device = QString::null  ) 
 

Wether or not a device is connected. The function is asynchron If device is empty it will take the currently managed device and see if it's up for Remote devices it will ping and see.

Parameters:
either mac or hciX

Definition at line 43 of file manager.cc.

References available(), QString::latin1(), OProcess, slotProcessExited(), and Opie::Core::OProcess::start().

Referenced by OpieTooth::BlueBase::deviceActive().

ConnectionState::ValueList Manager::parseConnections const QString  )  [private]
 

Definition at line 275 of file manager.cc.

References QValueList< T >::append(), QValueList< T >::begin(), OpieTooth::Client, QValueList< T >::end(), QString::fromLatin1(), OpieTooth::Incoming, list, OpieTooth::Master, odebug, oendl, OpieTooth::Outgoing, QValueList< T >::remove(), row, OpieTooth::ConnectionState::setConnectionMode(), OpieTooth::ConnectionState::setDirection(), OpieTooth::ConnectionState::setHandle(), OpieTooth::ConnectionState::setLinkMode(), OpieTooth::ConnectionState::setMac(), OpieTooth::ConnectionState::setState(), and QStringList::split().

Referenced by slotConnectionExited().

RemoteDevice::ValueList Manager::parseHCIOutput const QString  )  [private]
 

Definition at line 208 of file manager.cc.

References QValueList< T >::append(), QValueList< T >::begin(), QValueList< T >::end(), QString::findRev(), QString::latin1(), QString::left(), list, odebug, oendl, pos, rem, QString::remove(), QStringList::split(), str, and QString::stripWhiteSpace().

Referenced by slotHCIExited().

Services::ValueList Manager::parseSDPOutput const QString  )  [private]
 

Definition at line 170 of file manager.cc.

References list, odebug, oendl, parser, and OpieTooth::Parser::services().

Referenced by slotSDPExited().

void OpieTooth::Manager::removedService const QString service,
bool  removed
[signal]
 

Referenced by removeService().

void Manager::removeService const QString name  ) 
 

This removes a service from the sdps

Definition at line 94 of file manager.cc.

References OProcess::DontCare, removedService(), and Opie::Core::OProcess::start().

Referenced by removeServices().

void Manager::removeServices const QStringList  ) 
 

Removes a list from the sdpd

Definition at line 102 of file manager.cc.

References QValueList< T >::begin(), QValueList< T >::end(), and removeService().

void Manager::searchConnections  ) 
 

Searches for active connections the result is emitted with the connections signal

Definition at line 246 of file manager.cc.

References OProcess::AllOutput, connections(), list, m_hcitoolCon, OProcess::NotifyOnExit, QString::null, odebug, oendl, OProcess, slotConnectionExited(), slotConnectionOutput(), and Opie::Core::OProcess::start().

Referenced by OpieTooth::BlueBase::addConnectedDevices().

void Manager::searchDevices Device d  ) 
 

same as above

Definition at line 77 of file manager.cc.

void Manager::searchDevices const QString device = QString::null  ) 
 

this searchs for devices reachable from the currently managed device or from device if

Parameters:
device is not empty

Definition at line 60 of file manager.cc.

References OProcess::AllOutput, foundDevices(), QString::isEmpty(), QString::latin1(), list, OProcess::NotifyOnExit, odebug, oendl, OProcess, slotHCIExited(), slotHCIOut(), and Opie::Core::OProcess::start().

Referenced by OpieTooth::BluezApplet::slotMessage(), and OpieTooth::ScanDialog::startSearch().

void Manager::searchServices const RemoteDevice  ) 
 

search for services on a remote device

Definition at line 123 of file manager.cc.

References OpieTooth::RemoteDevice::mac(), and searchServices().

void Manager::searchServices const QString remDevice  ) 
 

search for services on a remote device

Definition at line 107 of file manager.cc.

References OProcess::AllOutput, foundServices(), list, m_sdp, OProcess::NotifyOnExit, odebug, oendl, OProcess, slotSDPExited(), slotSDPOut(), and Opie::Core::OProcess::start().

Referenced by OpieTooth::BlueBase::addServicesToDevice(), and searchServices().

void Manager::setDevice Device dev  ) 
 

Convience functions for setting a new device

Definition at line 40 of file manager.cc.

void Manager::setDevice const QString device  ) 
 

Set the manager to control a new device

Parameters:
device the new device to control (hci0 )

Definition at line 37 of file manager.cc.

References m_device.

void OpieTooth::Manager::signalStrength const QString mac,
const QString strengh
[signal]
 

void Manager::signalStrength const QString mac  ) 
 

Definition at line 306 of file manager.cc.

References OProcess::AllOutput, OProcess::NotifyOnExit, OProcess, slotSignalStrengthExited(), slotSignalStrengthOutput(), and Opie::Core::OProcess::start().

Referenced by OpieTooth::BlueBase::addSignalStrength(), and slotSignalStrengthOutput().

void Manager::slotConnectionExited Opie::Core::OProcess  )  [private, slot]
 

Definition at line 264 of file manager.cc.

References connections(), list, m_hcitoolCon, and parseConnections().

Referenced by searchConnections().

void Manager::slotConnectionOutput Opie::Core::OProcess ,
char *  ,
int 
[private, slot]
 

Definition at line 270 of file manager.cc.

References QString::append(), m_hcitoolCon, and str.

Referenced by searchConnections().

void Manager::slotHCIExited Opie::Core::OProcess  )  [private, slot]
 

Definition at line 178 of file manager.cc.

References QMap< Key, T >::end(), QMap< Key, T >::find(), foundDevices(), list, m_devices, Opie::Core::OProcess::normalExit(), odebug, oendl, parseHCIOutput(), and QMap< Key, T >::remove().

Referenced by searchDevices().

void Manager::slotHCIOut Opie::Core::OProcess ,
char *  ,
int 
[private, slot]
 

Definition at line 193 of file manager.cc.

References QString::append(), QMap< Key, T >::end(), QMap< Key, T >::find(), m_devices, odebug, oendl, QMap< Key, T >::replace(), str, and Opie::Internal::string().

Referenced by searchDevices().

void Manager::slotProcessExited Opie::Core::OProcess  )  [private, slot]
 

Definition at line 132 of file manager.cc.

References available(), conn, Opie::Core::OProcess::exitStatus(), QString::fromLatin1(), name, and Opie::Core::OProcess::normalExit().

Referenced by isAvailable().

void Manager::slotSDPExited Opie::Core::OProcess  )  [private, slot]
 

Definition at line 155 of file manager.cc.

References QMap< Key, T >::end(), QMap< Key, T >::find(), foundServices(), list, m_out, odebug, oendl, parseSDPOutput(), and QMap< Key, T >::remove().

Referenced by searchServices().

void Manager::slotSDPOut Opie::Core::OProcess ,
char *  ,
int 
[private, slot]
 

Definition at line 141 of file manager.cc.

References QString::append(), QMap< Key, T >::end(), QMap< Key, T >::find(), m_out, odebug, oendl, QMap< Key, T >::replace(), str, and Opie::Internal::string().

Referenced by searchServices().

void Manager::slotSignalStrengthExited Opie::Core::OProcess  )  [private, slot]
 

Definition at line 334 of file manager.cc.

Referenced by signalStrength().

void Manager::slotSignalStrengthOutput Opie::Core::OProcess ,
char *  ,
int 
[private, slot]
 

Definition at line 326 of file manager.cc.

References signalStrength(), QStringList::split(), and str.

Referenced by signalStrength().

QString Manager::toDevice const QString mac  ) 
 

Definition at line 126 of file manager.cc.

References QString::null.

QString Manager::toMac const QString device  ) 
 

Definition at line 129 of file manager.cc.

References QString::null.


Member Data Documentation

QString OpieTooth::Manager::m_device [private]
 

Definition at line 164 of file manager.h.

Referenced by Manager(), and setDevice().

QMap<QString, QString> OpieTooth::Manager::m_devices [private]
 

Definition at line 167 of file manager.h.

Referenced by slotHCIExited(), and slotHCIOut().

Opie::Core::OProcess* OpieTooth::Manager::m_hcitool [private]
 

Definition at line 162 of file manager.h.

Referenced by Manager(), and ~Manager().

QString OpieTooth::Manager::m_hcitoolCon [private]
 

Definition at line 169 of file manager.h.

Referenced by searchConnections(), slotConnectionExited(), and slotConnectionOutput().

QMap<QString, QString> OpieTooth::Manager::m_out [private]
 

Definition at line 166 of file manager.h.

Referenced by slotSDPExited(), and slotSDPOut().

Opie::Core::OProcess* OpieTooth::Manager::m_sdp [private]
 

Definition at line 163 of file manager.h.

Referenced by Manager(), searchServices(), and ~Manager().

QMap<Opie::Core::OProcess*, QString> OpieTooth::Manager::m_signalMac [private]
 

Definition at line 168 of file manager.h.

QMap<QString, int> OpieTooth::Manager::m_signalStrength [private]
 

Definition at line 165 of file manager.h.


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