0
私はfff2特性から値を取得する必要があります。 その特性は01または00を返しますbluetoothから配列値を取得低エネルギーfff2 Javaの特性
値を得るには?
thisは私が欲しい値の例です。
public boolean readCharacteristic(){
//check mBluetoothGatt is available
if (bluetoothGatt == null) {
Log.e(TAG, "lost connection");
return false;
}
BluetoothGattService Service = bluetoothGatt.getService(UUID.fromString("0000fff0-0000-1000-8000-00805f9b34fb"));
if (Service == null) {
Log.e(TAG, "service not found!");
return false;
}
BluetoothGattCharacteristic charac = Service
.getCharacteristic(UUID.fromString("0000fff2-0000-1000-8000-00805f9b34fb"));
if (charac == null) {
Log.e(TAG, "char not found!");
return false;
}
final byte[] data = charac.getValue(); // return null
String s2 = new String(data);
Log.i("READ", s2);
boolean status = true;
return status;
}
感謝..
お願いします。 – 7383
これは私のコード@ 7383です –