There is no need to sending set_discoverable command if new settings are not connectable as clearing connectable also clear discoverable. Sending set_discoverable when not connectable result in 'rejected' mgmt response. --- android/bluetooth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/bluetooth.c b/android/bluetooth.c index aa684bd..ffca084 100644 --- a/android/bluetooth.c +++ b/android/bluetooth.c @@ -1907,7 +1907,7 @@ static uint8_t set_scan_mode(void *buf, uint16_t len) return HAL_STATUS_FAILED; } - if (cur_disc != disc) { + if (cur_disc != disc && conn) { if (!set_discoverable(disc ? 0x01 : 0x00, 0)) return HAL_STATUS_FAILED; } -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html