I'm trying to send packets to bluetooth low energy (BLE) device from smartphone (Android App)
I know how to send Write Command:
something like this:
public void onServicesDiscovered(final BluetoothGatt gatt, int status) {
List<BluetoothGattService> services = gatt.getServices();
for (BluetoothGattService service : services) {
for (final BluetoothGattCharacteristic characteristic : service.getCharacteristics()) {
if (characteristic.getUuid().toString().equals(CONTROL_UUID)) {
boolean setValue = characteristic.setValue(new byte[]{/*..BYTES.*/});
boolean writeCharacteristic = gatt.writeCharacteristic(characteristic);
}
}
}
}
when I see this sent command in Wireshark (sniffing app), I see something like this
but I also need to send something like this (not write command, but write request)
official app which controls that devices sends this write request only once after connecting
seems without it I would not be able to control that device
so before I would send any write command I need to send this write request first