1 Star 0 Fork 40

peng2289/go808

forked from coco/go808 
Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
t808_0x0108.go 615 Bytes
Copy Edit Raw Blame History
Your Name authored 2020-04-07 18:27 +08:00 . 添加详细注释
package protocol
// 终端升级结果通知
type T808_0x0108 struct {
// 升级类型
// 0:终端, 12:道路运输证 IC 卡读卡器, 52:北斗卫星定位模块
Type byte
// 升级结果
// 0:成功, 1:失败, 2:取消
Result byte
}
func (entity *T808_0x0108) MsgID() MsgID {
return MsgT808_0x0108
}
func (entity *T808_0x0108) Encode() ([]byte, error) {
return []byte{entity.Type, entity.Result}, nil
}
func (entity *T808_0x0108) Decode(data []byte) (int, error) {
if len(data) < 2 {
return 0, ErrInvalidBody
}
entity.Type, entity.Result = data[0], data[1]
return 2, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/oco/go808.git
git@gitee.com:oco/go808.git
oco
go808
go808
32b1471f79b9

Search