info.gratour.jt808core.codec.encoder.impl.MBEncoder808_8803_StoredMediaReq.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jt-core Show documentation
Show all versions of jt-core Show documentation
`jt-core` is a java/scala communication processing library for JT808/JT809/JT1078 standard.
The newest version!
/** *****************************************************************************
* Copyright (c) 2019, 2020 lucendar.com.
* All rights reserved.
*
* Contributors:
* KwanKin Yau ([email protected]) - initial API and implementation
* ******************************************************************************/
package info.gratour.jt808core.codec.encoder.impl
import info.gratour.jt808core.JT808Utils
import info.gratour.jt808core.codec.encoder.AbstractJT808MsgBodyEncoder
import info.gratour.jt808core.protocol.msg.JT808Msg_8803_StoredMediaReq
import io.netty.buffer.ByteBuf
object MBEncoder808_8803_StoredMediaReq extends AbstractJT808MsgBodyEncoder[JT808Msg_8803_StoredMediaReq] {
override protected def encodeBody(m: JT808Msg_8803_StoredMediaReq, out: ByteBuf): Unit = {
val p = checkNotNull(m.getParams, "params")
out.writeByte(p.getMediaType)
out.writeByte(p.getChannelId)
out.writeByte(p.getEvent)
out.writeBytes(JT808Utils.timestampToBcd6(p.getStartTime))
out.writeBytes(JT808Utils.timestampToBcd6(p.getEndTime))
out.writeByte(p.getDeleteFlag)
}
}