mirror of https://gitee.com/openkylin/genmai.git
update docs/架构设计/逻辑视图设计.md.
Signed-off-by: xujian <xujian@kylinos.cn>
This commit is contained in:
parent
8d919219e8
commit
6a71061c16
|
@ -280,13 +280,22 @@ const (
|
||||||
cmd指令数据结构示例
|
cmd指令数据结构示例
|
||||||
|
|
||||||
```
|
```
|
||||||
|
type command_body struct {
|
||||||
|
System int
|
||||||
|
Baseline int
|
||||||
|
Fastscan int
|
||||||
|
User string
|
||||||
|
Pwd string
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
type command_msg struct {
|
type command_msg struct {
|
||||||
Cmd int
|
Cmd int
|
||||||
Ack int
|
Ack int
|
||||||
ReqSn int
|
ReqSn int
|
||||||
Crc int
|
Body command_body
|
||||||
|
Crc int
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
cmd指令json格式打包示例
|
cmd指令json格式打包示例
|
||||||
|
@ -294,12 +303,22 @@ cmd指令json格式打包示例
|
||||||
```
|
```
|
||||||
func cmd_packaging(cmd Command)([]byte,error){
|
func cmd_packaging(cmd Command)([]byte,error){
|
||||||
|
|
||||||
|
body:=command_body{
|
||||||
|
System:1,
|
||||||
|
Baseline:1,
|
||||||
|
Fastscan:1,
|
||||||
|
User:"",
|
||||||
|
Pwd:"",
|
||||||
|
}
|
||||||
|
|
||||||
pkg:=command_msg{
|
pkg:=command_msg{
|
||||||
Cmd:int(cmd),
|
Cmd:int(cmd),
|
||||||
Ack:0,
|
Ack:0,
|
||||||
ReqSn:Req_sn,
|
ReqSn:Req_sn,
|
||||||
|
Body:body,
|
||||||
Crc:0,
|
Crc:0,
|
||||||
}
|
}
|
||||||
|
|
||||||
Req_sn+=1
|
Req_sn+=1
|
||||||
json_pkg, err := json.Marshal(pkg)
|
json_pkg, err := json.Marshal(pkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -308,6 +327,8 @@ func cmd_packaging(cmd Command)([]byte,error){
|
||||||
return json_pkg,err
|
return json_pkg,err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
转换的json格式举例:{"Cmd":0,"Ack":0,"ReqSn":0,"Body":{"System":1,"Baseline":1,"Fastscan":1,"User":"","Pwd":""},"Crc":0}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
cmd指令发送
|
cmd指令发送
|
||||||
|
|
Loading…
Reference in New Issue