class CMaemoBTListener

Maemo btcond specific implementation of MAbstractListner

Inheritance:


Public Methods

[more] CMaemoBTListener(MAbstractStateConverter* aConverter)
Constructor
[more] ~CMaemoBTListener()
Destructor, closes connection to D-Bus.
[more]bool Connect()
Connects listener to D-Bus and registers signals to listen
[more]void Disconnect()
Disconnects the listener from D-Bus
[more]void CheckInitialState()
No implementation of this function
[more]void CheckState()
Checks the newest message from the D-Bus queue
[more]const std::string& GetName()
Returns the name of the listener
[more]bool SetupConnection()
Sets up the connection to D-Bus
[more]bool RegisterSignals()
Registers signals to listen
[more]void HandleMessage(DBusMessage* message)
Message handler, checks the type of the received message.


Inherited from MAbstractListener:


Documentation

Listens signals emitted by btcond in Maemo. Changes the activity state of the owner component. Used by the owner component only. When created listener automatically registers to given component. Currently listens only device up & down signals from btcond. Uses private connection to D-Bus. Initial state checking is not implemented - btcond doesn't support initial check of the device, only changes in device state are sent as signals. To check the initial state use BluezBTListener.

o CMaemoBTListener(MAbstractStateConverter* aConverter)
Use this constructor to create instances of this class. A reference to the component that will own the instance will have to be given as a parameter. Created component will be registered into that component.

Parameters:
Reference - to component that owns the instance. CANNOT BE NULL!

o ~CMaemoBTListener()
Closes the connection if it wasn't closed.

obool Connect()
Connects the listener to D-Bus using private connection. Register signals to listen via D-Bus, registers itself to listen signals emitted by btcond (signal interface). Use this only once.

Returns:
bool, true if connection attempt was success

ovoid Disconnect()
Closes the connection to D-Bus if it hasn't been closed earlier.

ovoid CheckInitialState()
Not implemented - does nothing

ovoid CheckState()
Pops the first message from the queue and processes it, message is passed to handler function (HandleMessage) that checks the message type. If the queue is empty nothing will be done.

oconst std::string& GetName()
Returns the name set in the constructor.

Returns:
Name of the listener

obool SetupConnection()
Sets up the private connection to D-Bus. Should be called only once, used in Connect()-function. False is returned also when connection has already been created.

Returns:
bool, true if success.

obool RegisterSignals()
Registers this listener to listen the signal interface of btcond in Maemo. Returns false if there is no connection. Listener receives messages only from this interface.

Returns:
bool, true if success

ovoid HandleMessage(DBusMessage* message)
Checks the received message type. If the signal is correct (incidating the device up/down state) the state of the owner component will be changed with SetState(). Currently uses hci0 device as hardcoded value.

Parameters:
message - Message to be handled


This class has no child classes.
See Also:
MAbstractListener
MAbstractStateConverter
BluezBTListener

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.