android - Bluetooth LE Java byte array size on characteristic setValue -
i trying send value using bluetooth le on android phone following line of code.
i getting error exceeds size of array, 127 because of 0xea byte. converted byte around 234. there way send byte using following line of code?
private void writecharacteristic(bluetoothgatt gatt) {bluetoothgattcharacteristic characteristic; log.d(tag, "writing data"); characteristic = gatt.getservice(service).getcharacteristic(data_in); characteristic.setvalue(new byte[]{0x08, 0x01, 0x03, 0x04, 0x52, 0x00, 0x02, 0x62, 0xea}); gatt.writecharacteristic(characteristic); }
to able use byte values above 127 in java, use (byte)0xea
.
Comments
Post a Comment