DevdDevice

DevdDevice — represents a discovered Deviced device

Functions

Properties

char * icon-name Read / Write
char * id Read / Write / Construct Only
DevdDeviceKind kind Read / Write
char * machine-id Read / Write
char * name Read / Write

Types and Values

Object Hierarchy

    GEnum
    ╰── DevdDeviceKind
    GObject
    ╰── DevdDevice
        ╰── DevdNetworkDevice

Description

The DevdDevice represents a Deviced device that has been discovered.

Functions

devd_device_get_id ()

const gchar *
devd_device_get_id (DevdDevice *self);

Gets the identifier for the device.

Parameters

self

a DevdDevice

 

Returns

a string identifying the device

Since: 3.28


devd_device_create_client ()

DevdClient *
devd_device_create_client (DevdDevice *self);

Creates a new DevdClient that can be used to connect to the device in question.

Not all devices are guaranteed to support multiple connections. For example, a USB device connection over serial may require exclusive access to the serial port and therefore, fail to connect if you try to use multiple client simultaneously.

See devd_client_connect_async() to establish a connection.

Parameters

self

a DevdDevice

 

Returns

a newly created DevdClient.

[transfer full]

Since: 3.28


devd_device_get_icon_name ()

const gchar *
devd_device_get_icon_name (DevdDevice *self);

Gets the “icon-name” property.

Parameters

self

a DevdDevice

 

Returns

the icon-name, or NULL.

[nullable]

Since: 3.28


devd_device_set_icon_name ()

void
devd_device_set_icon_name (DevdDevice *self,
                           const gchar *icon_name);

This set the icon-name for the local DevdDevice instance. It does not change the icon on the remove device. To interact with the remove device use devd_device_create_client().

Parameters

self

a DevdDevice

 

icon_name

the icon name for the device

 

Since: 3.28


devd_device_get_kind ()

DevdDeviceKind
devd_device_get_kind (DevdDevice *self);

devd_device_set_kind ()

void
devd_device_set_kind (DevdDevice *self,
                      DevdDeviceKind kind);

devd_device_get_machine_id ()

const gchar *
devd_device_get_machine_id (DevdDevice *self);

Gets the machine-id property, if specified

Parameters

self

a DevdDevice

 

Returns

a machine-id, or NULL.

[nullable]

Since: 3.28


devd_device_set_machine_id ()

void
devd_device_set_machine_id (DevdDevice *self,
                            const gchar *machine_id);

Sets the “machine-id” for the local object instance.

Parameters

self

a DevdDevice

 

machine_id

the identifier of the machine, if known

 

Since: 3.28


devd_device_get_name ()

const gchar *
devd_device_get_name (DevdDevice *self);

Gets the "name" property of the device, if there is one.

Parameters

self

a DevdDevice

 

Returns

the device name

Since: 3.28


devd_device_set_name ()

void
devd_device_set_name (DevdDevice *self,
                      const gchar *name);

Sets the name of the device.

This only changes the local representation of the device name. It does not change the name on the remove device. To interact with the remote device, use devd_device_create_client() to create a DevdClient.

Parameters

self

a DevdDevice

 

name

the name for the device

 

Since: 3.28

Types and Values

enum DevdDeviceKind

Members

DEVD_DEVICE_KIND_COMPUTER

   

DEVD_DEVICE_KIND_TABLET

   

DEVD_DEVICE_KIND_PHONE

   

DEVD_DEVICE_KIND_MICRO_CONTROLLER

   

DEVD_TYPE_DEVICE

#define DEVD_TYPE_DEVICE (devd_device_get_type())

struct DevdDeviceClass

struct DevdDeviceClass {
  GObjectClass parent_class;

  DevdClient *(*create_client) (DevdDevice *self);
};

DevdDevice

typedef struct _DevdDevice DevdDevice;

Property Details

The “icon-name” property

  “icon-name”                char *

The icon-name for the device.

Owner: DevdDevice

Flags: Read / Write

Default value: NULL


The “id” property

  “id”                       char *

The identifier for the device.

Owner: DevdDevice

Flags: Read / Write / Construct Only

Default value: NULL


The “kind” property

  “kind”                     DevdDeviceKind

The device kind.

Owner: DevdDevice

Flags: Read / Write

Default value: DEVD_DEVICE_KIND_COMPUTER


The “machine-id” property

  “machine-id”               char *

The machine-id of the device.

Owner: DevdDevice

Flags: Read / Write

Default value: NULL


The “name” property

  “name”                     char *

The name of the device.

Owner: DevdDevice

Flags: Read / Write

Default value: NULL