feat: disconnect
This commit is contained in:
parent
756d611c31
commit
c86ef81c4a
|
@ -143,12 +143,13 @@ class BluetoothRepositoryImpl(
|
|||
status: Int,
|
||||
newState: Int
|
||||
) {
|
||||
Log.d("onConnectionStateChange", "status: $status, newState: $newState")
|
||||
|
||||
if (status != BluetoothGatt.GATT_SUCCESS) {
|
||||
scope.launch(Dispatchers.Main) {
|
||||
Toast.makeText(context, "连接失败,错误码: $status", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
return
|
||||
}
|
||||
when (newState) {
|
||||
BluetoothProfile.STATE_CONNECTED -> {
|
||||
|
|
Loading…
Reference in New Issue