From: Vibhav Pant <[email protected]>
This allows DBus clients to find an adapter's version and
manufacturer company code without querying the management API.
---
src/adapter.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index 8a7c53a9e..8c267d418 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -260,6 +260,7 @@ struct btd_adapter {
bdaddr_t bdaddr; /* controller Bluetooth address */
uint8_t bdaddr_type; /* address type */
+ uint8_t version; /* controller core spec version */
uint32_t dev_class; /* controller class of device */
char *name; /* controller device name */
char *short_name; /* controller short name */
@@ -3540,6 +3541,29 @@ static gboolean property_experimental_exists(const GDBusPropertyTable *property,
return !queue_isempty(adapter->exps);
}
+static gboolean property_get_manufacturer(const GDBusPropertyTable *property,
+ DBusMessageIter *iter,
+ void *user_data)
+{
+ struct btd_adapter *adapter = user_data;
+ dbus_uint16_t val = adapter->manufacturer;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &val);
+
+ return TRUE;
+}
+
+static gboolean property_get_version(const GDBusPropertyTable *property,
+ DBusMessageIter *iter, void *user_data)
+{
+ struct btd_adapter *adapter = user_data;
+ uint8_t val = adapter->version;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &val);
+
+ return TRUE;
+}
+
static DBusMessage *remove_device(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
@@ -3898,6 +3922,8 @@ static const GDBusPropertyTable adapter_properties[] = {
{ "Roles", "as", property_get_roles },
{ "ExperimentalFeatures", "as", property_get_experimental, NULL,
property_experimental_exists },
+ { "Manufacturer", "q", property_get_manufacturer },
+ { "Version", "y", property_get_version },
{ }
};
@@ -10164,6 +10190,8 @@ static void read_info_complete(uint8_t status, uint16_t length,
adapter->supported_settings = btohl(rp->supported_settings);
adapter->current_settings = btohl(rp->current_settings);
+ adapter->version = rp->version;
+
clear_uuids(adapter);
clear_devices(adapter);
--
2.42.0
From: Vibhav Pant <[email protected]>
---
doc/adapter-api.txt | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt
index d38ce7171..10c290c62 100644
--- a/doc/adapter-api.txt
+++ b/doc/adapter-api.txt
@@ -360,3 +360,14 @@ Properties string Address [readonly]
List of 128-bit UUIDs that represents the experimental
features currently enabled.
+
+ uint16 Manufacturer [readonly]
+
+ The manufacturer of the device, as a uint16 company
+ identifier defined by the Core Bluetooth Specification.
+
+ byte Version [readonly]
+
+ The Bluetooth version supported by the device, as a
+ core version code defined by the Core Bluetooth
+ Specification.
--
2.42.0
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:
On Fri, 29 Sep 2023 18:37:24 +0530 you wrote:
> From: Vibhav Pant <[email protected]>
>
> This allows DBus clients to find an adapter's version and
> manufacturer company code without querying the management API.
> ---
> src/adapter.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
Here is the summary with links:
- [BlueZ,v2,1/2] adapter: Add Version and Manufacturer props to org.bluez.Adapter1.
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f2677c0153fd
- [BlueZ,v2,2/2] adapter-api: Add docs for properties Manufacturer and Version.
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6393012d4680
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html