return TRUE;
}
+struct vendor {
+ uint16_t cid;
+ uint16_t vid;
+} __packed;
+
static gboolean endpoint_get_vendor(const GDBusPropertyTable *property,
DBusMessageIter *iter, void *data)
{
struct endpoint *ep = data;
+ struct vendor vendor = { ep->cid, ep->vid };
- dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &ep->cid);
- dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &ep->vid);
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &vendor);
return TRUE;
}
{ "UUID", "s", endpoint_get_uuid, NULL, NULL },
{ "Codec", "y", endpoint_get_codec, NULL, NULL },
{ "Capabilities", "ay", endpoint_get_capabilities, NULL, NULL },
- { "Vendor", "qq", endpoint_get_vendor, NULL, endpoint_vendor_exists },
+ { "Vendor", "u", endpoint_get_vendor, NULL, endpoint_vendor_exists },
{ }
};
g_dbus_dict_append_entry(&dict, "Codec", DBUS_TYPE_BYTE, &ep->codec);
- if (ep->caps->iov_len) {
+ if (ep->cid && ep->vid) {
+ struct vendor vendor = { ep->cid, ep->vid };
+
+ g_dbus_dict_append_entry(&dict, "Vendor", DBUS_TYPE_UINT32,
+ &vendor);
+ }
+
+ if (ep->caps) {
g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &key,
DBUS_TYPE_BYTE, &ep->caps->iov_base,
ep->caps->iov_len);
g_list_length(local_endpoints));
local_endpoints = g_list_append(local_endpoints, ep);
- if (g_strstr_len(argv[2], -1, ":")) {
- bt_shell_printf("Found split\r\n");
-
+ if (strrchr(argv[2], ':')) {
list = g_strsplit(argv[2], ":", 2);
ep->codec = 0xff;
return endpoint;
}
+struct vendor {
+ uint16_t cid;
+ uint16_t vid;
+} __packed;
+
static int parse_properties(DBusMessageIter *props, const char **uuid,
gboolean *delay_reporting, uint8_t *codec,
uint16_t *cid, uint16_t *vid,
{
gboolean has_uuid = FALSE;
gboolean has_codec = FALSE;
+ struct vendor vendor;
while (dbus_message_iter_get_arg_type(props) == DBUS_TYPE_DICT_ENTRY) {
const char *key;
dbus_message_iter_get_basic(&value, codec);
has_codec = TRUE;
} else if (strcasecmp(key, "Vendor") == 0) {
- if (var != DBUS_TYPE_UINT16)
- return -EINVAL;
- dbus_message_iter_get_basic(&value, cid);
- dbus_message_iter_next(&value);
- var = dbus_message_iter_get_arg_type(&value);
- if (var != DBUS_TYPE_UINT16)
+ if (var != DBUS_TYPE_UINT32)
return -EINVAL;
- dbus_message_iter_get_basic(&value, vid);
+ dbus_message_iter_get_basic(&value, &vendor);
+ *cid = vendor.cid;
+ *vid = vendor.vid;
} else if (strcasecmp(key, "DelayReporting") == 0) {
if (var != DBUS_TYPE_BOOLEAN)
return -EINVAL;
const char *uuid;
gboolean delay_reporting = FALSE;
uint8_t codec;
- uint16_t cid = 0;
- uint16_t vid = 0;
+ struct vendor vendor;
struct bt_bap_pac_qos qos;
uint8_t *capabilities = NULL;
int size = 0;
dbus_message_iter_get_basic(&iter, &codec);
if (g_dbus_proxy_get_property(proxy, "Vendor", &iter)) {
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT16)
- goto fail;
-
- dbus_message_iter_get_basic(&iter, &cid);
-
- dbus_message_iter_next(&iter);
- if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT16)
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
goto fail;
- dbus_message_iter_get_basic(&iter, &vid);
+ dbus_message_iter_get_basic(&iter, &vendor);
}
/* DelayReporting and Capabilities are considered optional */
}
endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid,
- delay_reporting, codec, cid,
- vid, &qos, capabilities,
- size, metadata, metadata_size,
+ delay_reporting, codec,
+ vendor.cid, vendor.vid, &qos,
+ capabilities, size,
+ metadata, metadata_size,
&app->err);
if (!endpoint) {
error("Unable to register endpoint %s:%s: %s", app->sender,