/* Get A2DP Role */
str = g_key_file_get_string(key_file, "General", "DefaultA2DPRole", &gerr);
if (gerr || !str) {
- adapter->a2dp_role = BLUETOOTH_A2DP_SOURCE_ROLE;
+ if (main_opts.default_a2dp_role_sink) {
+ DBG("Default A2DP role is sink");
+ adapter->a2dp_role = BLUETOOTH_A2DP_SINK_ROLE;
+ } else {
+ adapter->a2dp_role = BLUETOOTH_A2DP_SOURCE_ROLE;
+ }
g_error_free(gerr);
gerr = NULL;
} else {
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
gboolean le_privacy;
char *pin_code;
+ gboolean default_a2dp_role_sink;
#endif
uint16_t did_source;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
"EnableLEPrivacy",
"PinCode",
+ "DefaultA2DPRoleSink",
#endif
NULL
};
main_opts.pin_code = g_strdup(str);
g_free(str);
}
+
+ boolean = g_key_file_get_boolean(config, "General", "DefaultA2DPRoleSink", &err);
+ if (err) {
+ DBG("%s", err->message);
+ g_clear_error(&err);
+ } else {
+ DBG("DefaultA2DPRoleSink=%s", boolean ? "true" : "false");
+ main_opts.default_a2dp_role_sink = boolean;
+ }
#endif
str = g_key_file_get_string(config, "GATT", "Cache", &err);
if (err) {
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
main_opts.le_privacy = FALSE;
main_opts.pin_code = NULL;
+ main_opts.default_a2dp_role_sink = false;
#endif
if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
# Default device class. Only the major and minor device class bits are
# considered. Defaults to '0x000000'.
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+Class = 0x40414 # Audio/Video(Loudspeaker)
+#else
#Class = 0x000100
+#endif
# How long to stay in discoverable mode before going back to non-discoverable
# The value is in seconds. Default is 180, i.e. 3 minutes.
PinCode = 0000
#endif
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+# Default A2DP role is sink in headless device.
+DefaultA2DPRoleSink = true
+#endif
+
[GATT]
# GATT attribute cache.
# Possible values: