package com.lingniu.ingest.protocol.jt808.codec.parser;

import com.lingniu.ingest.protocol.jt808.codec.BodyParser;
import com.lingniu.ingest.protocol.jt808.model.Jt808Body;
import com.lingniu.ingest.protocol.jt808.model.Jt808Header;
import com.lingniu.ingest.protocol.jt808.model.Jt808MessageId;

import java.nio.ByteBuffer;

public final class UnregisterBodyParser implements BodyParser {

    @Override
    public int messageId() {
        return Jt808MessageId.TERMINAL_UNREGISTER;
    }

    @Override
    public Jt808Body parse(Jt808Header header, ByteBuffer body) {
        body.position(body.limit());
        return new Jt808Body.Unregister();
    }
}
