Maemo btcond specific implementation of MAbstractListner
Inheritance:
Public Methods
-
CMaemoBTListener(MAbstractStateConverter* aConverter)
- Constructor
-
~CMaemoBTListener()
- Destructor, closes connection to D-Bus.
-
bool Connect()
- Connects listener to D-Bus and registers signals to listen
-
void Disconnect()
- Disconnects the listener from D-Bus
-
void CheckInitialState()
- No implementation of this function
-
void CheckState()
- Checks the newest message from the D-Bus queue
-
const std::string& GetName()
- Returns the name of the listener
-
bool SetupConnection()
- Sets up the connection to D-Bus
-
bool RegisterSignals()
- Registers signals to listen
-
void HandleMessage(DBusMessage* message)
- Message handler, checks the type of the received message.
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.
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!
~CMaemoBTListener()
-
Closes the connection if it wasn't closed.
bool 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
void Disconnect()
-
Closes the connection to D-Bus if it hasn't been closed
earlier.
void CheckInitialState()
-
Not implemented - does nothing
void 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.
const std::string& GetName()
-
Returns the name set in the constructor.
- Returns:
- Name of the listener
bool 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.
bool 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
void 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++.