2017-12-19 5 views
1

연결된 블루투스 LE 장치로 데이터를 전송하는 방법은 다음과 같습니다에 https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#getService(java.util.UUID)나는 아래의 지침과 샘플 블루투스 LE 장치에 연결

https://github.com/googlesamples/android-BluetoothLeGatt

을하지만 난 (헥사 코드) 데이터를 전송하는 방법을 몰라 나를 도와 줄 사람이 누구입니까? ? 코드 아래 않는 장치로 데이터를 전송 :

BluetoothGattDescriptor descriptor = characteristic.getDescriptor(
UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG)); 
int hexaCode =Integer.parseInt("7c",16); 
descriptor.setValue( 
ByteBuffer.allocate(4).putInt(hexaCode).array()); 
mBluetoothGatt.writeDescriptor(descriptor); 

답변

1

BLE는 서비스에서 데이터를받을 수 있습니다. 서비스는 맞춤형 또는 BLE standers.ON 장치가 될 수 있습니다. 모든 Ble 서비스를 검색하고 해당 장치에서 사용 가능한 모든 서비스 (해당 UUID 및 기능 포함)를 찾습니다. 북유럽 반도체를 다운로드 할 수 있습니다. nRF 연결 응용 프로그램 BLE 읽기 및 쓰기

관련 문제