All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.grzeslowski.jsupla.protocol.api.encoders.ToSuplaDataPacketEncoder Maven / Gradle / Ivy

The newest version!
package pl.grzeslowski.jsupla.protocol.api.encoders;

import pl.grzeslowski.jsupla.protocol.api.structs.SuplaDataPacket;
import pl.grzeslowski.jsupla.protocol.api.types.ProtoToSend;

public interface ToSuplaDataPacketEncoder extends Encoder {
    default SuplaDataPacket encode(T proto, short version, long rrId) {
        final byte[] data = encode(proto);
        return new SuplaDataPacket(version, rrId, proto.callType().getValue(), data.length, data);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy