라즈베리 파이 3 모델 B를 블루투스 주변 기기로 사용하고 있습니다. Pi는 GATT 서버를 실행하고 광고합니다.안드로이드 앱을 BRE를 통해 Raspberry Pi 3에 연결하는 데 문제가 있습니다
LightBlue iOS 앱에서 연결할 수 있으며 값을 읽고 쓸 수 있습니다.
안드로이드 앱에서 BLE 오버 파이어에 연결하는 데 문제가 있습니다. Play 스토어에서 2 개의 앱 (BLE 스캐너 및 블루투스 LE 스캐너)을 사용해 보았습니다. BluetoothLeGatt는 사용 해본 또 다른 앱입니다. Android Studio에서 예제 BLE 프로젝트로 사용할 수 있습니다. pi가 검색 결과에 나타나고 connect를 누르면 앱이 연결을 시도하지만 pi로 연결을 거부 할 수 있습니다. 프로그램 제어는 'disconnected'상태로 변경된 GattCallback 기능으로 넘어 가고 서비스 검색은 절대로 발생하지 않습니다. 로그는 다음과 같이 :
D/BluetoothGatt: connect() - device: B8:27:EB:A4:E7:75, auto: false
D/BluetoothGatt: registerApp()
D/BluetoothGatt: registerApp() - UUID=0c46767a-1ddc-4d91-83fe-490f9d3a5ad7
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
D/BluetoothLeService: Trying to create a new connection.
D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=6 device=B8:27:EB:A4:E7:75
I/BluetoothLeService: Disconnected from GATT server.
같은 앱이 연한 파랑 iOS 앱 또는 DropBeacon iOS 앱을 사용하여 시뮬레이션 가상 주변 장치에 연결할 수 있습니다.
파이의 일부 구성이 Android에서 연결을 수락하지 못하게한다고 생각합니다.
SRC 코드 : https://github.com/googlesamples/android-BluetoothLeGatt
어떤 제안이 일을하기 위해?
mBluetoothGatt = device.connectGatt(this, false, mGattCallback,TRANSPORT_LE);
대신
mBluetoothGatt = device.connectGatt(this, false, mGattCallback);
의 사용 덕분에