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);