diff --git a/src/device.c b/src/device.c
index 271c14c..4ffc124 100644
--- a/src/device.c
+++ b/src/device.c
g_free(path);
}
+
+void device_set_class(struct btd_device *device, uint32_t value)
+{
+ DBusConnection *conn = get_dbus_connection();
+
+ emit_property_changed(conn, device->path, DEVICE_INTERFACE, "Class",
+ DBUS_TYPE_UINT32, &value);
+}
diff --git a/src/device.h b/src/device.h
index d59b8eb..ad7350a 100644
--- a/src/device.h
+++ b/src/device.h
disconnect_watch watch, void *user_data,
GDestroyNotify destroy);
void device_remove_disconnect_watch(struct btd_device *device, guint id);
+void device_set_class(struct btd_device *device, uint32_t value);
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )
diff --git a/src/event.c b/src/event.c
index 2643a87..6be7ea2 100644
--- a/src/event.c
+++ b/src/event.c
void btd_event_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class)
{
- uint32_t old_class = 0;
struct btd_adapter *adapter;
struct btd_device *device;
- const gchar *dev_path;
- DBusConnection *conn = get_dbus_connection();
+ uint32_t old_class = 0;
read_remote_class(local, peer, &old_class);
if (!device)
return;
- dev_path = device_get_path(device);
-
- emit_property_changed(conn, dev_path, DEVICE_INTERFACE, "Class",
- DBUS_TYPE_UINT32, &class);
+ device_set_class(device, class);
}
void btd_event_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,