Search in sources :

Example 6 with ByteArrayWriter

use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.

the class ControlPointWithValue method toByteArray.

public final byte[] toByteArray() {
    final ByteArrayWriter byteArrayWriter = this.getValueWriter();
    byteArrayWriter.appendUint16(this.value);
    return byteArrayWriter.getByteArray();
}
Also used : ByteArrayWriter(nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter)

Example 7 with ByteArrayWriter

use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.

the class ControlPointLowVibration method toByteArray.

public final byte[] toByteArray() {
    final UIntBitWriter uIntBitWriter = new UIntBitWriter(16);
    uIntBitWriter.append(13, 0);
    uIntBitWriter.appendBoolean(this.smartWakeUp);
    uIntBitWriter.appendBoolean(this.incomingCall);
    uIntBitWriter.appendBoolean(this.notification);
    final ByteArrayWriter byteArrayWriter = this.getValueWriter();
    byteArrayWriter.appendUint16((int) uIntBitWriter.getValue());
    return byteArrayWriter.getByteArray();
}
Also used : UIntBitWriter(nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.UIntBitWriter) ByteArrayWriter(nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter)

Aggregations

ByteArrayWriter (nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter)7 UIntBitWriter (nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.UIntBitWriter)2