#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
uint8_t conn_type;
bool connect_le = FALSE;
+ uint8_t link_type = DEV_CONNECTED_NONE;
#endif
int err;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (conn_type == DEV_CONN_DEFAULT) {
- if (device_is_bonded(device, DEV_CONN_BREDR))
- return btd_error_already_exists(msg);
- else if (device_is_bonded(device, DEV_CONN_LE))
- return btd_error_already_exists(msg);
+ link_type = device_get_connected_state(device);
- if (device->bredr)
- conn_type = DEV_CONN_BREDR;
- else if (device->le)
- conn_type = DEV_CONN_LE;
- else
+ if (link_type == DEV_CONNECTED_BREDR) {
+ if (device_is_bonded(device, DEV_CONN_BREDR))
+ return btd_error_already_exists(msg);
conn_type = DEV_CONN_BREDR;
+ } else if (link_type == DEV_CONNECTED_LE) {
+ if (device_is_bonded(device, DEV_CONN_LE))
+ return btd_error_already_exists(msg);
+ conn_type = DEV_CONN_LE;
+ } else {
+ if (device_is_bonded(device, DEV_CONN_BREDR))
+ return btd_error_already_exists(msg);
+ else if (device_is_bonded(device, DEV_CONN_LE))
+ return btd_error_already_exists(msg);
+
+ if (device->bredr)
+ conn_type = DEV_CONN_BREDR;
+ else if (device->le)
+ conn_type = DEV_CONN_LE;
+ else
+ conn_type = DEV_CONN_BREDR;
+ }
} else {
if (device_is_bonded(device, conn_type))
return btd_error_already_exists(msg);
#endif
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ DBG("conn_type %d, link_type %d, bdaddr_type %d, device->bredr %d",
+ conn_type, link_type, bdaddr_type, device->bredr);
if (conn_type == DEV_CONN_LE &&
(device_is_bredrle(device) || bdaddr_type != BDADDR_BREDR)) {
DBG("LE Connect request");