UrfDevice

UrfDevice — Client object for accessing information about rfkill devices

Synopsis

#include <urfkill.h>

enum                UrfDeviceType;
                    UrfDevice;
                    UrfDeviceClass;
UrfDevice *         urf_device_new                      (void);
gboolean            urf_device_set_object_path_sync     (UrfDevice *device,
                                                         const char *object_path,
                                                         GCancellable *cancellable,
                                                         GError **error);
const char *        urf_device_get_object_path          (UrfDevice *device);

Object Hierarchy

  GObject
   +----UrfDevice

Properties

  "hard"                     gboolean              : Read
  "index"                    guint                 : Read
  "name"                     gchar*                : Read
  "soft"                     gboolean              : Read
  "type"                     guint                 : Read

Description

A helper GObject for accessing rfkill devices

Details

enum UrfDeviceType

typedef enum {
        URFDEVICE_TYPE_ALL = 0,
        URFDEVICE_TYPE_WLAN,
        URFDEVICE_TYPE_BLUETOOTH,
        URFDEVICE_TYPE_UWB,
        URFDEVICE_TYPE_WIMAX,
        URFDEVICE_TYPE_WWAN,
        URFDEVICE_TYPE_GPS,
        URFDEVICE_TYPE_FM,
        NUM_URFDEVICE_TYPES,
} UrfDeviceType;

The type of the rfkill device following the definition in <linux/rfkill.h>

URFDEVICE_TYPE_ALL

toggles all switches (requests only - not a switch type)

URFDEVICE_TYPE_WLAN

switch is on a 802.11 wireless network device.

URFDEVICE_TYPE_BLUETOOTH

switch is on a bluetooth device.

URFDEVICE_TYPE_UWB

switch is on a ultra wideband device.

URFDEVICE_TYPE_WIMAX

switch is on a WiMAX device.

URFDEVICE_TYPE_WWAN

switch is on a wireless WAN device.

URFDEVICE_TYPE_GPS

switch is on a GPS device.

URFDEVICE_TYPE_FM

switch is on a FM radio device.

NUM_URFDEVICE_TYPES

number of defined rfkill types

UrfDevice

typedef struct _UrfDevice UrfDevice;

The UrfDevice struct contains only private fields and should not be directly accessed.


UrfDeviceClass

typedef struct {
} UrfDeviceClass;

Class structure for UrfDevice


urf_device_new ()

UrfDevice *         urf_device_new                      (void);

Creates a new UrfDevice object.

Returns :

a new UrfDevice object.

Since 0.2.0


urf_device_set_object_path_sync ()

gboolean            urf_device_set_object_path_sync     (UrfDevice *device,
                                                         const char *object_path,
                                                         GCancellable *cancellable,
                                                         GError **error);

Set the object path of the object and fill up the intial properties.

device :

a UrfDevice instance

object_path :

the UrfDevice object path

cancellable :

a GCancellable or NULL

error :

a GError, or NULL

Returns :

TRUE for success, else FALSE and error is used

Since 0.2.0


urf_device_get_object_path ()

const char *        urf_device_get_object_path          (UrfDevice *device);

Get the object path for the device.

device :

a UrfDevice instance

Returns :

the object path, or NULL

Since 0.2.0

Property Details

The "hard" property

  "hard"                     gboolean              : Read

This property indicates whether the hard block of the rfkill device is on or not.

Default value: FALSE

Since 0.2.0


The "index" property

  "index"                    guint                 : Read

The index of the rfkill device assigned by the kernel rfkill subsystem

Default value: 0

Since 0.2.0


The "name" property

  "name"                     gchar*                : Read

The name of the rfkill device defined by the driver

Default value: NULL

Since 0.2.0


The "soft" property

  "soft"                     gboolean              : Read

This property indicates whether the soft block of the rfkill device is on or not.

Default value: FALSE

Since 0.2.0


The "type" property

  "type"                     guint                 : Read

The type of the rfkill device. See UrfDeviceType.

Allowed values: <= 7

Default value: 0

Since 0.2.0

See Also

UrfClient