fwupd/libfwupdplugin/fu-bluez-device.h
Ricardo Cañuelo 3ed91d52a4 Support for GATT characteristic signals/notifications
NOTE that currently this is implemented for GATT characteristics only,
but can be extended to other types of objects.

Listening for property changes in a bluez characteristic requires a
long-lived connection or proxy, so this also refactors bluez device
UUIDs into a simple object that keeps the path, the proxy and the signal
id in case a callback is registered for this UUID.

An additional advantage of this is that fwupd no longer creates a
throwaway proxy object for every read and write UUID operation.
2021-02-26 18:19:06 +01:00

36 lines
977 B
C

/*
* Copyright (C) 2021 Ricardo Cañuelo <ricardo.canuelo@collabora.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include "fu-device.h"
#define FU_TYPE_BLUEZ_DEVICE (fu_bluez_device_get_type ())
G_DECLARE_DERIVABLE_TYPE (FuBluezDevice, fu_bluez_device, FU, BLUEZ_DEVICE, FuDevice)
struct _FuBluezDeviceClass
{
FuDeviceClass parent_class;
gpointer __reserved[31];
};
GByteArray *fu_bluez_device_read (FuBluezDevice *self,
const gchar *uuid,
GError **error);
gchar *fu_bluez_device_read_string (FuBluezDevice *self,
const gchar *uuid,
GError **error);
gboolean fu_bluez_device_write (FuBluezDevice *self,
const gchar *uuid,
GByteArray *buf,
GError **error);
gboolean fu_bluez_device_notify_start (FuBluezDevice *self,
const gchar *uuid,
GError **error);
gboolean fu_bluez_device_notify_stop (FuBluezDevice *self,
const gchar *uuid,
GError **error);