UrfClient

UrfClient — Main client object for accessing the urfkill daemon

Functions

Types and Values

struct UrfClient
struct UrfClientClass

Includes

#include <urfkill.h>

Description

A helper GObject to use for accessing urfkill information, and to be notified when it is changed.

Functions

urf_client_enumerate_devices_sync ()

gboolean
urf_client_enumerate_devices_sync (UrfClient *client,
                                   GCancellable *cancellable,
                                   GError **error);

Enumerate the devices from the daemon.

Parameters

client

a UrfClient instance

 

cancellable

a GCancellable or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success, else FALSE and error is used

Since: 0.3.0


urf_client_get_daemon_version ()

const char *
urf_client_get_daemon_version (UrfClient *client);

Get urfkill daemon version

Parameters

client

a UrfClient instance

 

Returns

string containing the daemon version, e.g. 0.2.0

Since: 0.2.0


urf_client_get_devices ()

GList *
urf_client_get_devices (UrfClient *client);

Get a list of the device objects.

You must have called urf_client_enumerate_devices_sync before calling this function.

Parameters

client

a UrfClient instance

 

Returns

a list of UrfDevice objects.

[element-type UrfDevice][transfer none]

Since: 0.2.0


urf_client_inhibit ()

guint
urf_client_inhibit (UrfClient *client,
                    const char *reason,
                    GError **error);

Inhibit the rfkill key handling function for this session.

Parameters

client

a UrfClient instance

 

reason

the reason to inhibit the key control

 

error

a GError, or NULL

 

Returns

the cookie and error is used

Since: 0.2.0


urf_client_is_inhibited ()

gboolean
urf_client_is_inhibited (UrfClient *client,
                         GError **error);

Get whether the key control is inhibited or not,

Parameters

client

a UrfClient instance

 

error

a GError, or NULL

 

Returns

TRUE if the key control is inhibited

Since: 0.2.0


urf_client_new ()

UrfClient *
urf_client_new (void);

Creates a new UrfClient object.

Returns

a new UrfClient object.


urf_client_set_block ()

gboolean
urf_client_set_block (UrfClient *client,
                      UrfEnumType type,
                      const gboolean block,
                      GCancellable *cancellable,
                      GError **error);

Block or unblock the devices belonging to the type.

This function only changes soft block. Hard block is controlled by BIOS or the hardware and there is no way to change the state of hard block through kernel functions.

Parameters

client

a UrfClient instance

 

type

the type of the devices

 

block

TRUE to block the devices or FALSE to unblock

 

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_client_set_block_idx ()

gboolean
urf_client_set_block_idx (UrfClient *client,
                          const guint index,
                          const gboolean block,
                          GCancellable *cancellable,
                          GError **error);

Block or unblock the device by the index.

This function only changes soft block. Hard block is controlled by BIOS or the hardware and there is no way to change the state of hard block through kernel functions.

Parameters

client

a UrfClient instance

 

index

the index of the device

 

block

TRUE to block the device or FALSE to unblock

 

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_client_set_bluetooth_block ()

gboolean
urf_client_set_bluetooth_block (UrfClient *client,
                                const gboolean block);

Block or unblock the bluetooth devices. This is a convenient function and the underlying function is urf_client_set_block.

Parameters

client

a UrfClient instance

 

block

TRUE to block the bluetooth devices or FALSE to unblock

 

Returns

TRUE for success, else FALSE

Since: 0.2.0


urf_client_set_wlan_block ()

gboolean
urf_client_set_wlan_block (UrfClient *client,
                           const gboolean block);

Block or unblock the WLAN devices. This is a convenient function and the underlying function is urf_client_set_block.

Parameters

client

a UrfClient instance

 

block

TRUE to block the WLAN devices or FALSE to unblock

 

Returns

TRUE for success, else FALSE

Since: 0.2.0


urf_client_set_wwan_block ()

gboolean
urf_client_set_wwan_block (UrfClient *client,
                           const gboolean block);

Block or unblock the wireless WAN devices. This is a convenient function and the underlying function is urf_client_set_block.

Parameters

client

a UrfClient instance

 

block

TRUE to block the WWAN devices or FALSE to unblock

 

Returns

TRUE for success, else FALSE

Since: 0.2.0


urf_client_uninhibit ()

void
urf_client_uninhibit (UrfClient *client,
                      const guint cookie);

Cancel a previous call to urf_client_inhibit identified by the cookie.

Parameters

client

a UrfClient instance

 

cookie

the cookie

 

Since: 0.2.0

Types and Values

struct UrfClient

struct UrfClient {
};

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


struct UrfClientClass

struct UrfClientClass {
};

Class structure for UrfClient

See Also

UrfDevice