mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
bluez5: parse bluez vendor/product ids
It seems few devices support the Device Id via bluez. Try to figure out vendor/product ids for usb devices also via sysfs. Also try to figure out the adapter bus type.
This commit is contained in:
parent
6c582d5445
commit
2c9764da1d
2 changed files with 157 additions and 2 deletions
|
|
@ -154,6 +154,12 @@ extern "C" {
|
|||
|
||||
#define HSP_HS_DEFAULT_CHANNEL 3
|
||||
|
||||
#define SOURCE_ID_BLUETOOTH 0x1 /* Bluetooth SIG */
|
||||
#define SOURCE_ID_USB 0x2 /* USB Implementer's Forum */
|
||||
|
||||
#define BUS_TYPE_USB 1
|
||||
#define BUS_TYPE_OTHER 255
|
||||
|
||||
#define HFP_AUDIO_CODEC_CVSD 0x01
|
||||
#define HFP_AUDIO_CODEC_MSBC 0x02
|
||||
|
||||
|
|
@ -206,6 +212,10 @@ static inline enum spa_bt_profile spa_bt_profile_from_uuid(const char *uuid)
|
|||
}
|
||||
int spa_bt_profiles_from_json_array(const char *str);
|
||||
|
||||
int spa_bt_format_vendor_product_id(uint16_t source_id, uint16_t vendor_id,
|
||||
uint16_t product_id, char *vendor_str, int vendor_str_size,
|
||||
char *product_str, int product_str_size);
|
||||
|
||||
enum spa_bt_hfp_ag_feature {
|
||||
SPA_BT_HFP_AG_FEATURE_NONE = (0),
|
||||
SPA_BT_HFP_AG_FEATURE_3WAY = (1 << 0),
|
||||
|
|
@ -290,6 +300,11 @@ struct spa_bt_adapter {
|
|||
char *alias;
|
||||
char *address;
|
||||
char *name;
|
||||
int bus_type;
|
||||
uint16_t source_id;
|
||||
uint16_t vendor_id;
|
||||
uint16_t product_id;
|
||||
uint16_t version_id;
|
||||
uint32_t bluetooth_class;
|
||||
uint32_t profiles;
|
||||
int powered;
|
||||
|
|
@ -405,6 +420,10 @@ struct spa_bt_device {
|
|||
char *battery_path;
|
||||
char *name;
|
||||
char *icon;
|
||||
uint16_t source_id;
|
||||
uint16_t vendor_id;
|
||||
uint16_t product_id;
|
||||
uint16_t version_id;
|
||||
uint32_t bluetooth_class;
|
||||
uint16_t appearance;
|
||||
uint16_t RSSI;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue