use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.
the class BandTime method toByteArray.
public byte[] toByteArray() {
ByteArrayWriter byteArrayWriter = new ByteArrayWriter();
byteArrayWriter.appendUint16(this.year);
byteArrayWriter.appendUint8(this.month);
byteArrayWriter.appendUint8(this.dayOfMonth);
byteArrayWriter.appendUint8(this.hour);
byteArrayWriter.appendUint8(this.min);
byteArrayWriter.appendUint8(this.sec);
byteArrayWriter.appendUint8(this.dayOfWeek);
byteArrayWriter.appendValue(this.timeZone.key, IntFormat.SINT8);
byteArrayWriter.appendUint8(this.dst.key);
return byteArrayWriter.getByteArray();
}
use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.
the class EventBase method getValueWriter.
protected ByteArrayWriter getValueWriter() {
ByteArrayWriter byteArrayWriter = new ByteArrayWriter();
byteArrayWriter.appendUint8(this.eventCode.value);
return byteArrayWriter;
}
use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.
the class EventWithValue method toByteArray.
public byte[] toByteArray() {
ByteArrayWriter byteArrayWriter = this.getValueWriter();
byteArrayWriter.appendUint32(this.value);
return byteArrayWriter.getByteArray();
}
use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.
the class BandAlarms method toByteArray.
public byte[] toByteArray() {
ByteArrayWriter byteArrayWriter = new ByteArrayWriter();
if (this.alarms.size() == 0) {
byteArrayWriter.appendUint32(1073741824L);
} else {
for (BandAlarm bandAlarm : this.alarms) {
UIntBitWriter uIntBitWriter = new UIntBitWriter(32);
uIntBitWriter.append(2, 0);
uIntBitWriter.append(4, bandAlarm.index);
uIntBitWriter.append(2, bandAlarm.state.value);
uIntBitWriter.append(4, bandAlarm.interval);
uIntBitWriter.append(6, bandAlarm.hour);
uIntBitWriter.append(6, bandAlarm.minute);
uIntBitWriter.append(1, 0);
uIntBitWriter.append(7, bandAlarm.repeat.toInt());
byteArrayWriter.appendUint32(uIntBitWriter.getValue());
}
}
return byteArrayWriter.getByteArray();
}
use of nodomain.freeyourgadget.gadgetbridge.service.devices.sonyswr12.util.ByteArrayWriter in project Gadgetbridge by Freeyourgadget.
the class ControlPoint method getValueWriter.
protected final ByteArrayWriter getValueWriter() {
final ByteArrayWriter byteArrayWriter = new ByteArrayWriter();
byteArrayWriter.appendUint8(this.code.value);
return byteArrayWriter;
}
Aggregations