Intent intent= new Intent(Action.GATT_ERROR);
intent.putExtra(Extra.STATUS, status);
intent.putExtra(Extra.GATT_OPERATION, DeviceCallbacks.GattOperation.CHARACTERISTIC_WRITE);
intent.putExtra(Extra.BLUETOOTH_DEVICE, mwState.mwBoard);
broadcastIntent(intent);
<BUG>}
if (!mwState.commandBytes.isEmpty()) writeCommand(mwState);
else mwState.deviceState= DeviceState.READY;
if (mwState.deviceState == DeviceState.READY) {
if (!mwState.readCharUuids.isEmpty()) {
mwState.deviceState= DeviceState.READING_CHARACTERISTICS;
readCharacteristic(mwState);
} else if (mwState.readyToClose) {</BUG>
close(mwState.notifyUser);

Intent intent= new Intent(Action.GATT_ERROR);
intent.putExtra(Extra.STATUS, status);
intent.putExtra(Extra.GATT_OPERATION, DeviceCallbacks.GattOperation.CHARACTERISTIC_WRITE);
intent.putExtra(Extra.BLUETOOTH_DEVICE, mwState.mwBoard);
broadcastIntent(intent);
