- Android
[Android] BLE status 133 오류
junn__
2023. 9. 7. 22:15
반응형
GATT 연결시도
bluetoothGatt = device.connectGatt(this, false, gattCallback);
GATT 연결 시도 시 onConnectionStateChange 에서 status 133 으로 나타나며 연결이 되지 않고 종료되는 경우
bluetoothGatt = device.connectGatt(this, false, gattCallback, BluetoothDevice.TRANSPORT_LE);
다음 과 같이 BluetoothDevice.TRANSPORT_LE 인자를 추가하여 진행
특정 단말에 대해 연결이 잘 되지 않아서 이와 같이 해결. (status 0, newStatus 2)
단,
SDK 23 이상부터 사용이 가능하기에 버전 확인 후 조건 추가
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
bluetoothGatt = device.connectGatt(this, false, gattCallback, BluetoothDevice.TRANSPORT_LE);
}
반응형