diff options
-rw-r--r-- | api/tinyb/BluetoothGattCharacteristic.hpp | 3 | ||||
-rw-r--r-- | api/tinyb/BluetoothGattDescriptor.hpp | 4 | ||||
-rw-r--r-- | include/generated-code.h | 76 | ||||
-rw-r--r-- | src/BluetoothGattCharacteristic.cpp | 25 | ||||
-rw-r--r-- | src/BluetoothGattDescriptor.cpp | 23 | ||||
-rw-r--r-- | src/generated-code.c | 132 | ||||
-rw-r--r-- | src/org.bluez.xml | 4 |
7 files changed, 233 insertions, 34 deletions
diff --git a/api/tinyb/BluetoothGattCharacteristic.hpp b/api/tinyb/BluetoothGattCharacteristic.hpp index 20fcb945..9e3c2697 100644 --- a/api/tinyb/BluetoothGattCharacteristic.hpp +++ b/api/tinyb/BluetoothGattCharacteristic.hpp @@ -97,6 +97,7 @@ public: * @return A std::vector<unsgined char> containing the value of this characteristic. */ std::vector<unsigned char> read_value ( + uint16_t offset = 0 ); /** Writes the value of this characteristic. @@ -104,7 +105,7 @@ public: * to be written packed in a GBytes struct * @return TRUE if value was written succesfully */ - bool write_value (const std::vector<unsigned char> &arg_value); + bool write_value (const std::vector<unsigned char> &arg_value, uint16_t offset = 0); /** * Enables notifications (including at BLE level) for changes of the diff --git a/api/tinyb/BluetoothGattDescriptor.hpp b/api/tinyb/BluetoothGattDescriptor.hpp index 7b2ac187..eadaad62 100644 --- a/api/tinyb/BluetoothGattDescriptor.hpp +++ b/api/tinyb/BluetoothGattDescriptor.hpp @@ -80,6 +80,7 @@ public: * @return A vector<uchar> containing data from this descriptor */ std::vector<unsigned char> read_value ( + uint16_t offset = 0 ); /** Writes the value of this descriptor. @@ -88,7 +89,8 @@ public: * @return TRUE if value was written succesfully */ bool write_value ( - const std::vector<unsigned char> &arg_value + const std::vector<unsigned char> &arg_value, + uint16_t offset = 0 ); /** diff --git a/include/generated-code.h b/include/generated-code.h index 00054ec7..c7363c01 100644 --- a/include/generated-code.h +++ b/include/generated-code.h @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.45.4. DO NOT EDIT. + * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ @@ -212,6 +212,10 @@ struct _Adapter1ProxyClass GType adapter1_proxy_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (Adapter1Proxy, g_object_unref) +#endif + void adapter1_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, @@ -278,6 +282,10 @@ struct _Adapter1SkeletonClass GType adapter1_skeleton_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (Adapter1Skeleton, g_object_unref) +#endif + Adapter1 *adapter1_skeleton_new (void); @@ -573,6 +581,10 @@ struct _Device1ProxyClass GType device1_proxy_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (Device1Proxy, g_object_unref) +#endif + void device1_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, @@ -639,6 +651,10 @@ struct _Device1SkeletonClass GType device1_skeleton_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (Device1Skeleton, g_object_unref) +#endif + Device1 *device1_skeleton_new (void); @@ -718,6 +734,10 @@ struct _GattService1ProxyClass GType gatt_service1_proxy_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GattService1Proxy, g_object_unref) +#endif + void gatt_service1_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, @@ -784,6 +804,10 @@ struct _GattService1SkeletonClass GType gatt_service1_skeleton_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GattService1Skeleton, g_object_unref) +#endif + GattService1 *gatt_service1_skeleton_new (void); @@ -806,7 +830,8 @@ struct _GattCharacteristic1Iface gboolean (*handle_read_value) ( GattCharacteristic1 *object, - GDBusMethodInvocation *invocation); + GDBusMethodInvocation *invocation, + GVariant *arg_options); gboolean (*handle_start_notify) ( GattCharacteristic1 *object, @@ -819,7 +844,8 @@ struct _GattCharacteristic1Iface gboolean (*handle_write_value) ( GattCharacteristic1 *object, GDBusMethodInvocation *invocation, - const gchar *arg_value); + const GBytes *arg_value, + GVariant *arg_options); const gchar *const * (*get_descriptors) (GattCharacteristic1 *object); @@ -864,6 +890,7 @@ void gatt_characteristic1_complete_stop_notify ( /* D-Bus method calls: */ void gatt_characteristic1_call_read_value ( GattCharacteristic1 *proxy, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -877,12 +904,14 @@ gboolean gatt_characteristic1_call_read_value_finish ( gboolean gatt_characteristic1_call_read_value_sync ( GattCharacteristic1 *proxy, GBytes **out_value, + GVariant *arg_options, GCancellable *cancellable, GError **error); void gatt_characteristic1_call_write_value ( GattCharacteristic1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -895,6 +924,7 @@ gboolean gatt_characteristic1_call_write_value_finish ( gboolean gatt_characteristic1_call_write_value_sync ( GattCharacteristic1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GError **error); @@ -984,6 +1014,10 @@ struct _GattCharacteristic1ProxyClass GType gatt_characteristic1_proxy_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GattCharacteristic1Proxy, g_object_unref) +#endif + void gatt_characteristic1_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, @@ -1050,6 +1084,10 @@ struct _GattCharacteristic1SkeletonClass GType gatt_characteristic1_skeleton_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GattCharacteristic1Skeleton, g_object_unref) +#endif + GattCharacteristic1 *gatt_characteristic1_skeleton_new (void); @@ -1072,12 +1110,14 @@ struct _GattDescriptor1Iface gboolean (*handle_read_value) ( GattDescriptor1 *object, - GDBusMethodInvocation *invocation); + GDBusMethodInvocation *invocation, + GVariant *arg_options); gboolean (*handle_write_value) ( GattDescriptor1 *object, GDBusMethodInvocation *invocation, - const gchar *arg_value); + const GBytes *arg_value, + GVariant *arg_options); const gchar * (*get_characteristic) (GattDescriptor1 *object); @@ -1108,6 +1148,7 @@ void gatt_descriptor1_complete_write_value ( /* D-Bus method calls: */ void gatt_descriptor1_call_read_value ( GattDescriptor1 *proxy, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -1121,12 +1162,14 @@ gboolean gatt_descriptor1_call_read_value_finish ( gboolean gatt_descriptor1_call_read_value_sync ( GattDescriptor1 *proxy, GBytes **out_value, + GVariant *arg_options, GCancellable *cancellable, GError **error); void gatt_descriptor1_call_write_value ( GattDescriptor1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -1139,6 +1182,7 @@ gboolean gatt_descriptor1_call_write_value_finish ( gboolean gatt_descriptor1_call_write_value_sync ( GattDescriptor1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GError **error); @@ -1185,6 +1229,10 @@ struct _GattDescriptor1ProxyClass GType gatt_descriptor1_proxy_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GattDescriptor1Proxy, g_object_unref) +#endif + void gatt_descriptor1_proxy_new ( GDBusConnection *connection, GDBusProxyFlags flags, @@ -1251,6 +1299,10 @@ struct _GattDescriptor1SkeletonClass GType gatt_descriptor1_skeleton_get_type (void) G_GNUC_CONST; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (GattDescriptor1Skeleton, g_object_unref) +#endif + GattDescriptor1 *gatt_descriptor1_skeleton_new (void); @@ -1307,6 +1359,11 @@ struct _ObjectProxyClass }; GType object_proxy_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ObjectProxy, g_object_unref) +#endif + ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path); #define TYPE_OBJECT_SKELETON (object_skeleton_get_type ()) @@ -1333,6 +1390,11 @@ struct _ObjectSkeletonClass }; GType object_skeleton_get_type (void) G_GNUC_CONST; + +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ObjectSkeleton, g_object_unref) +#endif + ObjectSkeleton *object_skeleton_new (const gchar *object_path); void object_skeleton_set_adapter1 (ObjectSkeleton *object, Adapter1 *interface_); void object_skeleton_set_device1 (ObjectSkeleton *object, Device1 *interface_); @@ -1365,6 +1427,10 @@ struct _ObjectManagerClientClass GDBusObjectManagerClientClass parent_class; }; +#if GLIB_CHECK_VERSION(2, 44, 0) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ObjectManagerClient, g_object_unref) +#endif + GType object_manager_client_get_type (void) G_GNUC_CONST; GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data); diff --git a/src/BluetoothGattCharacteristic.cpp b/src/BluetoothGattCharacteristic.cpp index d947ad72..6a88a414 100644 --- a/src/BluetoothGattCharacteristic.cpp +++ b/src/BluetoothGattCharacteristic.cpp @@ -120,16 +120,27 @@ std::unique_ptr<BluetoothGattCharacteristic> BluetoothGattCharacteristic::make( } /* D-Bus method calls: */ -std::vector<unsigned char> BluetoothGattCharacteristic::read_value () +std::vector<unsigned char> BluetoothGattCharacteristic::read_value (uint16_t offset) { GError *error = NULL; GBytes *result_gbytes; + + GVariantDict dict; + g_variant_dict_init(&dict, NULL); + + if (offset != 0) + g_variant_dict_insert_value(&dict, "offset", g_variant_new_uint16(offset)); + + GVariant *variant = g_variant_dict_end(&dict); + gatt_characteristic1_call_read_value_sync( object, &result_gbytes, + variant, NULL, &error ); + handle_error(error); std::vector<unsigned char> result = from_gbytes_to_vector(result_gbytes); @@ -141,19 +152,29 @@ std::vector<unsigned char> BluetoothGattCharacteristic::read_value () } bool BluetoothGattCharacteristic::write_value ( - const std::vector<unsigned char> &arg_value) + const std::vector<unsigned char> &arg_value, uint16_t offset) { GError *error = NULL; bool result = true; GBytes *arg_value_gbytes = from_vector_to_gbytes(arg_value); + GVariantDict dict; + g_variant_dict_init(&dict, NULL); + + if (offset != 0) + g_variant_dict_insert_value(&dict, "offset", g_variant_new_uint16(offset)); + + GVariant *variant = g_variant_dict_end(&dict); + result = gatt_characteristic1_call_write_value_sync( object, arg_value_gbytes, + variant, NULL, &error ); + handle_error(error); /* freeing the GBytes allocated inside from_vector_to_gbytes function */ diff --git a/src/BluetoothGattDescriptor.cpp b/src/BluetoothGattDescriptor.cpp index bd210347..9095c87b 100644 --- a/src/BluetoothGattDescriptor.cpp +++ b/src/BluetoothGattDescriptor.cpp @@ -124,13 +124,23 @@ BluetoothGattDescriptor *BluetoothGattDescriptor::clone() const } /* D-Bus method calls: */ -std::vector<unsigned char> BluetoothGattDescriptor::read_value () +std::vector<unsigned char> BluetoothGattDescriptor::read_value (uint16_t offset) { GError *error = NULL; GBytes *result_gbytes; + + GVariantDict dict; + g_variant_dict_init(&dict, NULL); + + if (offset != 0) + g_variant_dict_insert_value(&dict, "offset", g_variant_new_uint16(offset)); + + GVariant *variant = g_variant_dict_end(&dict); + gatt_descriptor1_call_read_value_sync( object, &result_gbytes, + variant, NULL, &error ); @@ -145,16 +155,25 @@ std::vector<unsigned char> BluetoothGattDescriptor::read_value () } bool BluetoothGattDescriptor::write_value ( - const std::vector<unsigned char> &arg_value) + const std::vector<unsigned char> &arg_value, uint16_t offset) { GError *error = NULL; bool result; GBytes *arg_value_gbytes = from_vector_to_gbytes(arg_value); + GVariantDict dict; + g_variant_dict_init(&dict, NULL); + + if (offset != 0) + g_variant_dict_insert_value(&dict, "offset", g_variant_new_uint16(offset)); + + GVariant *variant = g_variant_dict_end(&dict); + result = gatt_descriptor1_call_write_value_sync( object, arg_value_gbytes, + variant, NULL, &error ); diff --git a/src/generated-code.c b/src/generated-code.c index 45f1e891..52010714 100644 --- a/src/generated-code.c +++ b/src/generated-code.c @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.45.4. DO NOT EDIT. + * Generated by gdbus-codegen 2.48.1. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ @@ -7318,6 +7318,23 @@ gatt_service1_skeleton_new (void) /* ---- Introspection data for org.bluez.GattCharacteristic1 ---- */ +static const _ExtendedGDBusArgInfo _gatt_characteristic1_method_info_read_value_IN_ARG_options = +{ + { + -1, + (gchar *) "options", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gatt_characteristic1_method_info_read_value_IN_ARG_pointers[] = +{ + &_gatt_characteristic1_method_info_read_value_IN_ARG_options, + NULL +}; + static const _ExtendedGDBusArgInfo _gatt_characteristic1_method_info_read_value_OUT_ARG_value = { { @@ -7340,7 +7357,7 @@ static const _ExtendedGDBusMethodInfo _gatt_characteristic1_method_info_read_val { -1, (gchar *) "ReadValue", - NULL, + (GDBusArgInfo **) &_gatt_characteristic1_method_info_read_value_IN_ARG_pointers, (GDBusArgInfo **) &_gatt_characteristic1_method_info_read_value_OUT_ARG_pointers, NULL }, @@ -7359,9 +7376,21 @@ static const _ExtendedGDBusArgInfo _gatt_characteristic1_method_info_write_value FALSE }; +static const _ExtendedGDBusArgInfo _gatt_characteristic1_method_info_write_value_IN_ARG_options = +{ + { + -1, + (gchar *) "options", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + static const _ExtendedGDBusArgInfo * const _gatt_characteristic1_method_info_write_value_IN_ARG_pointers[] = { &_gatt_characteristic1_method_info_write_value_IN_ARG_value, + &_gatt_characteristic1_method_info_write_value_IN_ARG_options, NULL }; @@ -7587,6 +7616,7 @@ gatt_characteristic1_default_init (GattCharacteristic1Iface *iface) * GattCharacteristic1::handle-read-value: * @object: A #GattCharacteristic1. * @invocation: A #GDBusMethodInvocation. + * @arg_options: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-GattCharacteristic1.ReadValue">ReadValue()</link> D-Bus method. * @@ -7602,14 +7632,15 @@ gatt_characteristic1_default_init (GattCharacteristic1Iface *iface) NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 1, - G_TYPE_DBUS_METHOD_INVOCATION); + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); /** * GattCharacteristic1::handle-write-value: * @object: A #GattCharacteristic1. * @invocation: A #GDBusMethodInvocation. * @arg_value: Argument passed by remote caller. + * @arg_options: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-GattCharacteristic1.WriteValue">WriteValue()</link> D-Bus method. * @@ -7625,8 +7656,8 @@ gatt_characteristic1_default_init (GattCharacteristic1Iface *iface) NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT); /** * GattCharacteristic1::handle-start-notify: @@ -8018,6 +8049,7 @@ gatt_characteristic1_set_descriptors (GattCharacteristic1 *object, const gchar * /** * gatt_characteristic1_call_read_value: * @proxy: A #GattCharacteristic1Proxy. + * @arg_options: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. @@ -8031,13 +8063,15 @@ gatt_characteristic1_set_descriptors (GattCharacteristic1 *object, const gchar * void gatt_characteristic1_call_read_value ( GattCharacteristic1 *proxy, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "ReadValue", - g_variant_new ("()"), + g_variant_new ("(@a{sv})", + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -8094,6 +8128,7 @@ _out: /** * gatt_characteristic1_call_read_value_sync: * @proxy: A #GattCharacteristic1Proxy. + * @arg_options: Argument to pass with the method invocation. * @out_value: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. @@ -8108,6 +8143,7 @@ gboolean gatt_characteristic1_call_read_value_sync ( GattCharacteristic1 *proxy, GBytes **out_value, + GVariant *arg_options, GCancellable *cancellable, GError **error) { @@ -8119,7 +8155,8 @@ gatt_characteristic1_call_read_value_sync ( _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "ReadValue", - g_variant_new ("()"), + g_variant_new ("(@a{sv})", + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -8148,6 +8185,7 @@ _out: * gatt_characteristic1_call_write_value: * @proxy: A #GattCharacteristic1Proxy. * @arg_value: Argument to pass with the method invocation. + * @arg_options: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. @@ -8162,6 +8200,7 @@ void gatt_characteristic1_call_write_value ( GattCharacteristic1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -8178,8 +8217,9 @@ gatt_characteristic1_call_write_value ( g_dbus_proxy_call (G_DBUS_PROXY (proxy), "WriteValue", - g_variant_new ("(ay)", - builder), + g_variant_new ("(ay@a{sv})", + builder, + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -8220,6 +8260,7 @@ _out: * gatt_characteristic1_call_write_value_sync: * @proxy: A #GattCharacteristic1Proxy. * @arg_value: Argument to pass with the method invocation. + * @arg_options: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * @@ -8233,6 +8274,7 @@ gboolean gatt_characteristic1_call_write_value_sync ( GattCharacteristic1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GError **error) { @@ -8249,8 +8291,9 @@ gatt_characteristic1_call_write_value_sync ( _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "WriteValue", - g_variant_new ("(ay)", - builder), + g_variant_new ("(ay@a{sv})", + builder, + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -9576,6 +9619,23 @@ gatt_characteristic1_skeleton_new (void) /* ---- Introspection data for org.bluez.GattDescriptor1 ---- */ +static const _ExtendedGDBusArgInfo _gatt_descriptor1_method_info_read_value_IN_ARG_options = +{ + { + -1, + (gchar *) "options", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + +static const _ExtendedGDBusArgInfo * const _gatt_descriptor1_method_info_read_value_IN_ARG_pointers[] = +{ + &_gatt_descriptor1_method_info_read_value_IN_ARG_options, + NULL +}; + static const _ExtendedGDBusArgInfo _gatt_descriptor1_method_info_read_value_OUT_ARG_value = { { @@ -9598,7 +9658,7 @@ static const _ExtendedGDBusMethodInfo _gatt_descriptor1_method_info_read_value = { -1, (gchar *) "ReadValue", - NULL, + (GDBusArgInfo **) &_gatt_descriptor1_method_info_read_value_IN_ARG_pointers, (GDBusArgInfo **) &_gatt_descriptor1_method_info_read_value_OUT_ARG_pointers, NULL }, @@ -9617,9 +9677,21 @@ static const _ExtendedGDBusArgInfo _gatt_descriptor1_method_info_write_value_IN_ FALSE }; +static const _ExtendedGDBusArgInfo _gatt_descriptor1_method_info_write_value_IN_ARG_options = +{ + { + -1, + (gchar *) "options", + (gchar *) "a{sv}", + NULL + }, + FALSE +}; + static const _ExtendedGDBusArgInfo * const _gatt_descriptor1_method_info_write_value_IN_ARG_pointers[] = { &_gatt_descriptor1_method_info_write_value_IN_ARG_value, + &_gatt_descriptor1_method_info_write_value_IN_ARG_options, NULL }; @@ -9767,6 +9839,7 @@ gatt_descriptor1_default_init (GattDescriptor1Iface *iface) * GattDescriptor1::handle-read-value: * @object: A #GattDescriptor1. * @invocation: A #GDBusMethodInvocation. + * @arg_options: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-GattDescriptor1.ReadValue">ReadValue()</link> D-Bus method. * @@ -9782,14 +9855,15 @@ gatt_descriptor1_default_init (GattDescriptor1Iface *iface) NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 1, - G_TYPE_DBUS_METHOD_INVOCATION); + 2, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT); /** * GattDescriptor1::handle-write-value: * @object: A #GattDescriptor1. * @invocation: A #GDBusMethodInvocation. * @arg_value: Argument passed by remote caller. + * @arg_options: Argument passed by remote caller. * * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-GattDescriptor1.WriteValue">WriteValue()</link> D-Bus method. * @@ -9805,8 +9879,8 @@ gatt_descriptor1_default_init (GattDescriptor1Iface *iface) NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 2, - G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING); + 3, + G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT); /* GObject properties for D-Bus properties: */ /** @@ -9994,6 +10068,7 @@ gatt_descriptor1_set_value (GattDescriptor1 *object, const GBytes *value) /** * gatt_descriptor1_call_read_value: * @proxy: A #GattDescriptor1Proxy. + * @arg_options: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. @@ -10007,13 +10082,15 @@ gatt_descriptor1_set_value (GattDescriptor1 *object, const GBytes *value) void gatt_descriptor1_call_read_value ( GattDescriptor1 *proxy, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_dbus_proxy_call (G_DBUS_PROXY (proxy), "ReadValue", - g_variant_new ("()"), + g_variant_new ("(@a{sv})", + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -10065,6 +10142,7 @@ _out: /** * gatt_descriptor1_call_read_value_sync: * @proxy: A #GattDescriptor1Proxy. + * @arg_options: Argument to pass with the method invocation. * @out_value: (out): Return location for return parameter or %NULL to ignore. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. @@ -10079,6 +10157,7 @@ gboolean gatt_descriptor1_call_read_value_sync ( GattDescriptor1 *proxy, GBytes **out_value, + GVariant *arg_options, GCancellable *cancellable, GError **error) { @@ -10090,7 +10169,8 @@ gatt_descriptor1_call_read_value_sync ( _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "ReadValue", - g_variant_new ("()"), + g_variant_new ("(@a{sv})", + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -10115,6 +10195,7 @@ _out: * gatt_descriptor1_call_write_value: * @proxy: A #GattDescriptor1Proxy. * @arg_value: Argument to pass with the method invocation. + * @arg_options: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. * @user_data: User data to pass to @callback. @@ -10129,6 +10210,7 @@ void gatt_descriptor1_call_write_value ( GattDescriptor1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -10145,8 +10227,9 @@ gatt_descriptor1_call_write_value ( g_dbus_proxy_call (G_DBUS_PROXY (proxy), "WriteValue", - g_variant_new ("(ay)", - builder), + g_variant_new ("(ay@a{sv})", + builder, + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, @@ -10187,6 +10270,7 @@ _out: * gatt_descriptor1_call_write_value_sync: * @proxy: A #GattDescriptor1Proxy. * @arg_value: Argument to pass with the method invocation. + * @arg_options: Argument to pass with the method invocation. * @cancellable: (allow-none): A #GCancellable or %NULL. * @error: Return location for error or %NULL. * @@ -10200,6 +10284,7 @@ gboolean gatt_descriptor1_call_write_value_sync ( GattDescriptor1 *proxy, GBytes *arg_value, + GVariant *arg_options, GCancellable *cancellable, GError **error) { @@ -10216,8 +10301,9 @@ gatt_descriptor1_call_write_value_sync ( _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy), "WriteValue", - g_variant_new ("(ay)", - builder), + g_variant_new ("(ay@a{sv})", + builder, + arg_options), G_DBUS_CALL_FLAGS_NONE, -1, cancellable, diff --git a/src/org.bluez.xml b/src/org.bluez.xml index 99c18c02..6d5f8830 100644 --- a/src/org.bluez.xml +++ b/src/org.bluez.xml @@ -77,9 +77,11 @@ THE SOFTWARE. <interface name="org.bluez.GattCharacteristic1"> <method name="ReadValue"> <arg name="value" type="ay" direction="out"/> + <arg name="options" type="a{sv}" direction="in"/> </method> <method name="WriteValue"> <arg name="value" type="ay" direction="in"/> + <arg name="options" type="a{sv}" direction="in"/> </method> <method name="StartNotify"/> <method name="StopNotify"/> @@ -93,9 +95,11 @@ THE SOFTWARE. <interface name="org.bluez.GattDescriptor1"> <method name="ReadValue"> <arg name="value" type="ay" direction="out"/> + <arg name="options" type="a{sv}" direction="in"/> </method> <method name="WriteValue"> <arg name="value" type="ay" direction="in"/> + <arg name="options" type="a{sv}" direction="in"/> </method> <property name="UUID" type="s" access="read"/> <property name="Characteristic" type="o" access="read"/> |