class Jt808Encoder extends MessageToByteEncoder<Rs> {
    private final static Logger log = LoggerFactory.getLogger(Jt808Encoder.class);

    @Override
    protected void encode(ChannelHandlerContext ctx, Rs msg, ByteBuf out) throws Exception {<FILL_FUNCTION_BODY>}


}

        Session session = ctx.channel().attr(Session.KEY).get();

        ByteBuf encode = Jt808EncoderCmd.encode(msg, session, session.nextSerialNo());
        if(encode!=null){
            log.info("< {} hex:{}", session, ByteBufUtil.hexDump(encode));
            out.writeBytes(encode);
        }
    
<no_super_class>