![]() |
![]() |
![]() |
Buzztard Bt-Ic Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <libbtic/ic.h> struct BtIcDevice; void btic_device_add_control (const BtIcDevice *self
,const BtIcControl *control
); BtIcControl * btic_device_get_control_by_id (const BtIcDevice *self
,guint id
); gboolean btic_device_has_controls (const BtIcDevice *self
); gboolean btic_device_start (const BtIcDevice *self
); gboolean btic_device_stop (const BtIcDevice *self
); gboolean (*btic_device_virtual_start) (gconstpointer self
); gboolean (*btic_device_virtual_stop) (gconstpointer self
);
"controls" gpointer : Read "name" gchar* : Read / Write / Construct Only "udi" gchar* : Read / Write / Construct Only
Abstract base class for control devices. Subclasses will provide functionality to query capabilities and register BtIcControl instances. They will also read from the device and trigger the change events on their controls (via value property).
This baseclass manages the added controls. The can be queries by calling
btic_device_get_control_by_id()
or iterating the list in
BtIcDevice::controls.
void btic_device_add_control (const BtIcDevice *self
,const BtIcControl *control
);
Add the given control
to the list that the device manages. Takes ownership
of the control.
|
the device |
|
new control |
BtIcControl * btic_device_get_control_by_id (const BtIcDevice *self
,guint id
);
Look up a control by id
.
|
the device |
|
he control id |
Returns : |
the found instance or NULL . This does not increase the ref-count! |
Since 0.6
gboolean btic_device_has_controls (const BtIcDevice *self
);
Check if the device has controls. This is useful to check after device creation. One reason for not having any controls could also be missing read-permissions on the device node.
|
the device |
Since 0.6
gboolean btic_device_start (const BtIcDevice *self
);
Starts the io-loop for the device. This can be called multiple times and must
be paired by an equal amount of btic_device_stop()
calls.
|
the BtIcDevice instance to use |
Returns : |
TRUE for success |
gboolean btic_device_stop (const BtIcDevice *self
);
Stops the io-loop for the device. This must be called as often as the device
has been started using btic_device_start()
.
|
the BtIcDevice instance to use |
Returns : |
TRUE for success |
gboolean (*btic_device_virtual_start) (gconstpointer self
);
Subclasses will override this methods with a function that counts start calls and runs the device-io for starts>0.
|
device instance |
Returns : |
TRUE for success |