package com.ruoyi.dataInterchange.model;
|
|
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBufUtil;
|
import io.netty.buffer.Unpooled;
|
import lombok.Data;
|
|
/**
|
* 主动请求停止实时音视频传输
|
*
|
* @author zhibing.pu
|
* @Date 2025/3/21 9:51
|
*/
|
@Data
|
public class DOWNRealvideoMsgEnd {
|
/**
|
* 车牌号
|
*/
|
private String vehicleNo;
|
/**
|
* 车牌颜色
|
*/
|
private Integer vehicleColor;
|
/**
|
* 子业务类型标识
|
*/
|
private Integer dataType;
|
/**
|
* 后续数据长度
|
*/
|
private Integer dataLength;
|
/**
|
* 逻辑通道号
|
*/
|
private Integer channelId;
|
/**
|
* 视频类型
|
* 0x00: 音视频
|
* 0x01: 音频
|
* 0x02: 视频
|
*/
|
private Integer avttemType;
|
|
|
/**
|
* 编码回复报文
|
*/
|
public byte[] encode() {
|
ByteBuf byteBuf = Unpooled.buffer(30);
|
byte[] bytes1 = this.getVehicleNo().getBytes();
|
for (int i = 0; i < 21; i++) {
|
if (i < bytes1.length) {
|
byteBuf.writeByte(bytes1[i]);
|
} else {
|
byteBuf.writeByte(0x00);
|
}
|
}
|
byteBuf.writeByte(this.getVehicleColor());
|
byteBuf.writeShort(this.getDataType());
|
byteBuf.writeInt(this.getDataLength());
|
byteBuf.writeChar(this.getChannelId());
|
byteBuf.writeChar(this.getAvttemType());
|
byte[] bytes = ByteBufUtil.getBytes(byteBuf);
|
byteBuf.release();
|
return bytes;
|
}
|
}
|