Search in sources :

Example 6 with ByteBuf

use of sugar.free.sightparser.pipeline.ByteBuf in project SightRemote by TebbeUbben.

the class ExtendedBolusMessage method getData.

@Override
protected byte[] getData() throws Exception {
    ByteBuf data = new ByteBuf(22);
    data.putShort((short) 0x2503);
    data.putShort((short) 0xE300);
    data.putShort((short) 0x1F00);
    data.putShort((short) 0x0000);
    data.putShort((short) 0x0000);
    data.putUInt16LE(Helpers.roundDoubleToInt(amount * 100D));
    data.putUInt16LE(duration);
    data.putShort((short) 0x0000);
    data.putShort((short) 0x0000);
    data.putUInt16LE(Helpers.roundDoubleToInt(amount * 100D));
    data.putUInt16LE(duration);
    return data.getBytes();
}
Also used : ByteBuf(sugar.free.sightparser.pipeline.ByteBuf)

Example 7 with ByteBuf

use of sugar.free.sightparser.pipeline.ByteBuf in project SightRemote by TebbeUbben.

the class MultiwaveBolusMessage method getData.

@Override
protected byte[] getData() throws Exception {
    ByteBuf data = new ByteBuf(22);
    data.putShort((short) 0x2503);
    data.putShort((short) 0xFC00);
    data.putShort((short) 0x1F00);
    data.putShort((short) 0x0000);
    data.putUInt16LE(Helpers.roundDoubleToInt(amount * 100D));
    data.putUInt16LE(Helpers.roundDoubleToInt(delayedAmount * 100D));
    data.putUInt16LE(duration);
    data.putShort((short) 0x0000);
    data.putUInt16LE(Helpers.roundDoubleToInt(amount * 100D));
    data.putUInt16LE(Helpers.roundDoubleToInt(delayedAmount * 100D));
    data.putUInt16LE(duration);
    return data.getBytes();
}
Also used : ByteBuf(sugar.free.sightparser.pipeline.ByteBuf)

Example 8 with ByteBuf

use of sugar.free.sightparser.pipeline.ByteBuf in project SightRemote by TebbeUbben.

the class MuteAlertMessage method getData.

@Override
protected byte[] getData() throws Exception {
    ByteBuf byteBuf = new ByteBuf(2);
    byteBuf.putUInt16LE(alertID);
    return byteBuf.getBytes();
}
Also used : ByteBuf(sugar.free.sightparser.pipeline.ByteBuf)

Example 9 with ByteBuf

use of sugar.free.sightparser.pipeline.ByteBuf in project SightRemote by TebbeUbben.

the class SetPumpStatusMessage method getData.

@Override
protected byte[] getData() throws Exception {
    ByteBuf byteBuf = new ByteBuf(2);
    byteBuf.putShort(pumpStatus.getValue());
    return byteBuf.getBytes();
}
Also used : ByteBuf(sugar.free.sightparser.pipeline.ByteBuf)

Example 10 with ByteBuf

use of sugar.free.sightparser.pipeline.ByteBuf in project SightRemote by TebbeUbben.

the class SetTBRMessage method getData.

@Override
protected byte[] getData() throws Exception {
    ByteBuf byteBuf = new ByteBuf(6);
    byteBuf.putUInt16LE(amount);
    byteBuf.putUInt16LE(duration);
    byteBuf.putShort((short) 0x1F00);
    return byteBuf.getBytes();
}
Also used : ByteBuf(sugar.free.sightparser.pipeline.ByteBuf)

Aggregations

ByteBuf (sugar.free.sightparser.pipeline.ByteBuf)35 SuppressLint (android.annotation.SuppressLint)3 InvalidAuthCRCError (sugar.free.sightparser.error.InvalidAuthCRCError)2 InvalidNonceError (sugar.free.sightparser.error.InvalidNonceError)2 InvalidTrailerError (sugar.free.sightparser.error.InvalidTrailerError)2 CustomEvent (com.crashlytics.android.answers.CustomEvent)1 BigInteger (java.math.BigInteger)1 HistoryFrame (sugar.free.sightparser.applayer.descriptors.history_frames.HistoryFrame)1 AppLayerMessage (sugar.free.sightparser.applayer.messages.AppLayerMessage)1 AuthLayerMessage (sugar.free.sightparser.authlayer.AuthLayerMessage)1 CRCAuthLayerMessage (sugar.free.sightparser.authlayer.CRCAuthLayerMessage)1 DataMessage (sugar.free.sightparser.authlayer.DataMessage)1 InvalidAppCRCError (sugar.free.sightparser.error.InvalidAppCRCError)1 InvalidAppVersionError (sugar.free.sightparser.error.InvalidAppVersionError)1 InvalidAuthVersionError (sugar.free.sightparser.error.InvalidAuthVersionError)1 UnknownAppErrorCodeError (sugar.free.sightparser.error.UnknownAppErrorCodeError)1 UnknownAppMessageError (sugar.free.sightparser.error.UnknownAppMessageError)1 UnknownAuthMessageError (sugar.free.sightparser.error.UnknownAuthMessageError)1 UnknownServiceError (sugar.free.sightparser.error.UnknownServiceError)1