Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/media #15

Merged
merged 10 commits into from
May 29, 2023
Next Next commit
[WIP] [feat] 多媒体数据上传
fakeyanss committed Mar 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3518137d1d236608d0d302014aade10edf127a38
24 changes: 24 additions & 0 deletions internal/protocol/model/msg_0800.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package model

// 多媒体事件消息上传
type Msg0800 struct {
Header *MsgHeader `json:"header"`
}

func (m *Msg0800) Decode(packet *PacketData) error {
m.Header = packet.Header
return nil
}

func (m *Msg0800) Encode() (pkt []byte, err error) {
pkt, err = writeHeader(m, pkt)
return pkt, err
}

func (m *Msg0800) GetHeader() *MsgHeader {
return m.Header
}

func (m *Msg0800) GenOutgoing(incoming JT808Msg) error {
return nil
}
24 changes: 24 additions & 0 deletions internal/protocol/model/msg_0801.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package model

// 多媒体数据上传
type Msg0801 struct {
Header *MsgHeader `json:"header"`
}

func (m *Msg0801) Decode(packet *PacketData) error {
m.Header = packet.Header
return nil
}

func (m *Msg0801) Encode() (pkt []byte, err error) {
pkt, err = writeHeader(m, pkt)
return pkt, err
}

func (m *Msg0801) GetHeader() *MsgHeader {
return m.Header
}

func (m *Msg0801) GenOutgoing(incoming JT808Msg) error {
return nil
}
24 changes: 24 additions & 0 deletions internal/protocol/model/msg_8800.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package model

// 多媒体数据上传应答
type Msg8800 struct {
Header *MsgHeader `json:"header"`
}

func (m *Msg8800) Decode(packet *PacketData) error {
m.Header = packet.Header
return nil
}

func (m *Msg8800) Encode() (pkt []byte, err error) {
pkt, err = writeHeader(m, pkt)
return pkt, err
}

func (m *Msg8800) GetHeader() *MsgHeader {
return m.Header
}

func (m *Msg8800) GenOutgoing(incoming JT808Msg) error {
return nil
}