Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QIrLocalDevice Class Reference

The QIrLocalDevice class encapsulates a local Infrared (IrDA) device. More...

    #include <QIrLocalDevice>

Inherits QObject.

Public Functions

Public Slots

Signals

Static Public Members

Additional Inherited Members


Detailed Description

The QIrLocalDevice class encapsulates a local Infrared (IrDA) device.

The QIrLocalDevice class can be used to control the state of the local IrDA device and query for remote Infrared devices.

The user can control the state of the device by using the bringUp() and bringDown() functions. The isUp() function returns the state of the device.

The local infrared device can be used to discover remote infrared devices by calling the discoverRemoteDevices() function and hooking onto the remoteDeviceFound() or remoteDevicesFound() signals.

This class can also be used to query the remote IAS database.

See also QIrIasDatabase.


Member Function Documentation

QIrLocalDevice::QIrLocalDevice ( const QString & device )

Constructs a local device for the given device name device. The device is usually of the form irdaN, e.g. irda0.

See also devices().

QIrLocalDevice::~QIrLocalDevice ()

Destroys the device object.

bool QIrLocalDevice::bringDown ()

Tries to bring down the infrared device. Returns true if the device could be brought down successfully, and false otherwise.

NOTE: Under linux this function requires administrator privileges.

See also isUp() and bringUp().

bool QIrLocalDevice::bringUp ()

Tries to bring up the infrared device. Returns true if the device could be brought up successfully, and false otherwise.

NOTE: Under linux this function requires administrator privileges.

See also isUp() and bringDown().

const QString & QIrLocalDevice::deviceName () const

Returns the device name of the infrared device. E.g. irda0.

QStringList QIrLocalDevice::devices ()   [static]

Returns all the infrared devices found on this system. The contents of the list could be passed to the QIrLocalDevice constructor.

bool QIrLocalDevice::discoverRemoteDevices ( QIr::DeviceClasses classes = QIr::All )   [slot]

Starts a discovery of remote infrared devices. The classes parameter specifies a filtering set. Thus a client can request that only remote devices which have at least one device class present in the filter set be discovered.

The clients can subscribe to the discovery information in one of two ways. If the client wants to receive information about a device as it is received, they should subscribe to the remoteDeviceFound() signal. If the clients wish to receive the information wholesale, they should subscribe to the remoteDevicesFound() signal.

Returns true if the discovery could be started successfully, and false otherwise.

See also discoveryStarted() and discoveryCompleted().

void QIrLocalDevice::discoveryCompleted ()   [signal]

This signal is emitted whenever a discovery of remote infrared devices has completed.

See also discoveryStarted().

void QIrLocalDevice::discoveryStarted ()   [signal]

This signal is emitted whenever a discovery of remote infrared devices is started.

See also discoveryCompleted().

bool QIrLocalDevice::isUp () const

Returns true if the infrared device is up and running.

See also bringUp() and bringDown().

QVariant QIrLocalDevice::queryRemoteAttribute ( const QIrRemoteDevice & remote, const QString & className, const QString & attribName )

Tries to query the remote device given by remote for an IAS Database entry with class name given by className and attribute name given by attribName. Returns a valid attribute if the device has an attribute specified, returns false if the device could not be contacted or the attribute does not exist.

    QIrIasAttribute ret =
            dev.queryRemoteAttribute(remote, "OBEX", "IrDA:TinyTP:LsapSel");

The above code would attempt to query the remote device given by remote for whether it supports the OBEX service.

See also QIrIasDatabase.

void QIrLocalDevice::remoteDeviceFound ( const QIrRemoteDevice & device )   [signal]

This signal is emitted during the discovery procedure. The device parameter holds the remote device found. Clients can subscribe to this signal if they wish to receive information about one device at a time. The can subscribe to the remoteDevicesFound() signal if they wish to receive all the devices wholesale.

See also discoveryStarted(), discoveryCompleted(), and remoteDevicesFound().

void QIrLocalDevice::remoteDevicesFound ( const QList<QIrRemoteDevice> & devices )   [signal]

This signal is emitted during the discovery procedure. The devices parameter holds the list of remote devices found. Clients can subscribe to this signal if they wish to receive information about all devices at once. They could subscribe to the remoteDeviceFound() signal if they wished to receive the information piecemeal.

See also discoveryStarted(), discoveryCompleted(), and remoteDeviceFound().


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3