| Top |
| void | devd_client_emit_notification () |
| void | devd_client_emit_service_added () |
| gchar ** | devd_client_get_services () |
| gboolean | devd_client_has_service () |
| guint | devd_client_get_timeout () |
| void | devd_client_set_timeout () |
| gchar * | devd_client_get_name () |
| gchar * | devd_client_get_arch () |
| gchar * | devd_client_get_kernel () |
| gchar * | devd_client_get_system () |
| DevdTriplet * | devd_client_get_triplet () |
| void | devd_client_connect_async () |
| gboolean | devd_client_connect_finish () |
| void | devd_client_disconnect_async () |
| gboolean | devd_client_disconnect_finish () |
| void | devd_client_call_async () |
| gboolean | devd_client_call_finish () |
| void | devd_client_list_apps_async () |
| GPtrArray * | devd_client_list_apps_finish () |
| void | devd_client_list_runtimes_async () |
| GPtrArray * | devd_client_list_runtimes_finish () |
| void | devd_client_list_files_async () |
| GPtrArray * | devd_client_list_files_finish () |
| void | devd_client_run_app_async () |
| gchar * | devd_client_run_app_finish () |
| void | devd_client_syncfs_async () |
| gboolean | devd_client_syncfs_finish () |
The DevdClient is a base-class that is used to communicate with devices. Network based devices (or USB) subclass this to provide a common API, despite different transport mediums.
void devd_client_emit_notification (DevdClient *self,const gchar *method,GVariant *params);
void devd_client_emit_service_added (DevdClient *self,const gchar *service);
gchar **
devd_client_get_services (DevdClient *self);
Gets the names of services currently supported by the client.
Since: 3.28
gchar *
devd_client_get_name (DevdClient *self);
Gets the name of the peer that this client is connected to.
This value is discovered when initializing a connection with the peer.
Since: 3.28
gchar *
devd_client_get_arch (DevdClient *self);
devd_client_get_arch has been deprecated since version 3.30 and should not be used in newly-written code.
Use devd_client_get_triplet() instead.
Gets the architecture of the device, such as "x86_64". Generally,
this is the machine value from uname().
Since: 3.28
gchar *
devd_client_get_kernel (DevdClient *self);
devd_client_get_kernel has been deprecated since version 3.30 and should not be used in newly-written code.
Use devd_client_get_triplet() instead.
Gets the kernel of the device, such as "linux". This is the kernel component of the familiar "target triplet".
Since: 3.28
gchar *
devd_client_get_system (DevdClient *self);
devd_client_get_system has been deprecated since version 3.30 and should not be used in newly-written code.
Use devd_client_get_triplet() instead.
Gets the system of the device, such as "gnu". This is the system component of the familiar "target triplet".
Since: 3.28
DevdTriplet *
devd_client_get_triplet (DevdClient *self);
Gets the DevdTriplet object holding information about the architecture triplet
Since: 3.30
void devd_client_connect_async (DevdClient *self,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously connects to the device for which the client was created.
callback
should complete the operation by calling devd_client_connect_finish().
self |
||
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback, or |
|
user_data |
closure data for |
Since: 3.28
gboolean devd_client_connect_finish (DevdClient *self,GAsyncResult *result,GError **error);
Completes an asynchronous connection to the device, initiated with
devd_client_connect_async().
Since: 3.28
void devd_client_disconnect_async (DevdClient *self,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
gboolean devd_client_disconnect_finish (DevdClient *self,GAsyncResult *result,GError **error);
void devd_client_call_async (DevdClient *self,const gchar *method,GVariant *params,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously calls an RPC on the device, if available.
Not all DevdClient implementations are guaranteed to support this interface, and therefore may fail.
self |
||
method |
the RPC method name |
|
params |
the parameters for the method. |
[transfer none][nullable] |
cancellable |
a GCancellable or |
[nullable] |
callback |
a callback to execute upon completion |
|
user_data |
closure data for |
Since: 3.28
gboolean devd_client_call_finish (DevdClient *self,GAsyncResult *result,GVariant **reply,GError **error);
Gets the result of the RPC call.
void devd_client_list_apps_async (DevdClient *self,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously requests a list of applications that are available to the peer that the DevdClient is connected to.
To complete the asynchronous request, callback
must call
devd_client_list_apps_finish() to obtain the result.
self |
||
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback |
|
user_data |
closure data for |
Since: 3.28
GPtrArray * devd_client_list_apps_finish (DevdClient *self,GAsyncResult *result,GError **error);
Completes an asynchronous request to devd_client_list_apps_async().
An array
of DevdClientAppInfo if successful; otherwise NULL and error
is set.
[transfer container][element-type Deviced.AppInfo]
Since: 3.28
void devd_client_list_runtimes_async (DevdClient *self,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously requests a list of runtimes that are available to the peer that the DevdClient is connected to.
To complete the asynchronous request, callback
must call
devd_client_list_runtimes_finish() to obtain the result.
self |
||
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback |
|
user_data |
closure data for |
Since: 3.28
GPtrArray * devd_client_list_runtimes_finish (DevdClient *self,GAsyncResult *result,GError **error);
Completes an asynchronous request to devd_client_list_runtimes_async().
An array
of DevdClientAppInfo if successful; otherwise NULL and error
is set.
[transfer container][element-type Deviced.AppInfo]
Since: 3.28
void devd_client_list_files_async (DevdClient *self,const gchar *path,const gchar *attributes,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Lists the files in a given path on the device.
Use attributes
to specify the file attributes to retrieve. These
follow the same convention as g_file_enumerate_children().
self |
||
path |
the path on the device |
|
attributes |
file attributes |
|
cancellable |
a GCancellable, or |
[nullable] |
callback |
a callback to execute up on completion |
|
user_data |
closure data for |
Since: 3.28
GPtrArray * devd_client_list_files_finish (DevdClient *self,GAsyncResult *result,GError **error);
Completes an asynchronous request to list files on the device.
a GPtrArray of GFileInfo retrieved from the device.
[transfer container][element-type Gio.FileInfo]
Since: 3.28
void devd_client_run_app_async (DevdClient *self,const gchar *provider,const gchar *app_id,const gchar *pty,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously runs an application on the connected DevdClient.
To complete the asynchronous request, callback
must call
devd_client_run_app_finish() to obtain the result.
self |
||
provider |
the app provider |
|
app_id |
the ID of the app to run |
|
pty |
a pty ID. |
[nullable] |
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback |
|
user_data |
closure data for |
Since: 3.28
gchar * devd_client_run_app_finish (DevdClient *self,GAsyncResult *result,GError **error);
Completes an asynchronous request to devd_client_run_app_async().
Since: 3.28
void devd_client_syncfs_async (DevdClient *self,const gchar *devices,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Requests that the device sync changes to the file-system to the underlying
storage devices specified, or all devices if devices
is NULL.
Note, currently, only syncing all file-systems is supported.
self |
||
devices |
a comma-separated list of devices, or |
[nullable] |
cancellable |
a GCancellable, or |
[nullable] |
callback |
a callback to execute upon completion |
|
user_data |
closure data for |
Since: 3.28
gboolean devd_client_syncfs_finish (DevdClient *self,GAsyncResult *result,GError **error);
Completes an asynchronous request to sync file-system changes to their underlying storage devices.
Since: 3.28
struct DevdClientClass {
GObjectClass parent_instance;
void (*notification) (DevdClient *self,
const gchar *method,
GVariant *params);
void (*service_added) (DevdClient *self,
const gchar *service);
void (*connect_async) (DevdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*connect_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
void (*disconnect_async) (DevdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*disconnect_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
gchar *(*get_name) (DevdClient *self);
gchar *(*get_arch) (DevdClient *self);
gchar *(*get_kernel) (DevdClient *self);
gchar *(*get_system) (DevdClient *self);
DevdTriplet *(*get_triplet) (DevdClient *self);
void (*call_async) (DevdClient *self,
const gchar *method,
GVariant *params,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*call_finish) (DevdClient *self,
GAsyncResult *result,
GVariant **reply,
GError **error);
void (*list_apps_async) (DevdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GPtrArray *(*list_runtimes_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
void (*list_runtimes_async) (DevdClient *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GPtrArray *(*list_apps_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
void (*list_files_async) (DevdClient *self,
const gchar *path,
const gchar *attributes,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GPtrArray *(*list_files_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
void (*run_app_async) (DevdClient *self,
const gchar *provider,
const gchar *app_id,
const gchar *pty,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gchar *(*run_app_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
void (*syncfs_async) (DevdClient *self,
const gchar *devices,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean (*syncfs_finish) (DevdClient *self,
GAsyncResult *result,
GError **error);
};
“arch” property “arch” char *
The architecture of the device, if provided.
Owner: DevdClient
Flags: Read
Default value: NULL
“kernel” property “kernel” char *
The kernel of the device, if provided.
Owner: DevdClient
Flags: Read
Default value: NULL
“name” property “name” char *
The name of the device, if any.
Owner: DevdClient
Flags: Read
Default value: NULL
“system” property “system” char *
The operating system of the device, if provided.
Owner: DevdClient
Flags: Read
Default value: NULL
“timeout” property “timeout” guint
The timeout for communication in seconds.
Owner: DevdClient
Flags: Read / Write
Default value: 0
“notification” signalvoid user_function (DevdClient *self, char *method, GVariant *params, gpointer user_data)
The "notification" signal is emitted when a client has received a notification from the peer.
Not all clients will support this, so it's specific for communicating with some clients and services.
self |
||
method |
the method name |
|
params |
the parameters for the notification |
|
user_data |
user data set when the signal handler was connected. |
Flags: Has Details
Since: 3.28
“service-added” signalvoid user_function (DevdClient *self, char *service, gpointer user_data)
The "service-added" signal is emitted when a new service is advertised by the client. This can happen when the device has enabled a new feature while you're connected.
If integrating with third-party libraries, this can be used to advertise that additional services are enabled on the connection.
self |
||
service |
the name of the service |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.28