bluez5: autoconnect device profiles on startup

Auto-connect all paired & trusted devices on startup.
Since devices that already connected or powering off would reject the connecting requests, it should be fine with this behavior.
Also reconnect remaining profiles if only partial profiles are connected.
This commit is contained in:
Huang-Huang Bao 2021-03-26 12:53:04 +08:00 committed by Wim Taymans
parent 4112b34f4d
commit 34c9f24d2a
5 changed files with 168 additions and 86 deletions

View file

@ -200,6 +200,7 @@ static inline enum spa_bt_profile spa_bt_profile_from_uuid(const char *uuid)
else
return 0;
}
int spa_bt_profiles_from_json_array(const char *str);
enum spa_bt_hfp_ag_feature {
SPA_BT_HFP_AG_FEATURE_NONE = (0),
@ -406,6 +407,8 @@ struct spa_bt_device {
int blocked;
uint32_t profiles;
uint32_t connected_profiles;
uint32_t reconnect_profiles;
int reconnect_state;
struct spa_source timer;
struct spa_list remote_endpoint_list;
struct spa_list transport_list;