新增协议

This commit is contained in:
2025-01-02 09:32:39 +08:00
parent 792679098c
commit 27c08f735c
5 changed files with 309 additions and 133 deletions

35
main.go
View File

@@ -72,8 +72,7 @@ func main() {
// 客户端{"Type":"ping"}
// 服务端{"Type":"pong"}
// 服务端发 {"Type":"ota","Ip":"192.168.31.1:80","File":"/xxx/1.bin"}
// 服务端发 {\"Type\":\"ota\",\"Ip\":\"192.168.31.1:80\",\"File\":\"/xxx/1.bin\"}
// 服务端发 {\"Type\":\"ota\",\"Ip\":\"http://8.141.8.18/V1002.bin\"}
// 客户端回复 {"Type":"ota","State":"1"}
// 开始实时上传数据
@@ -88,4 +87,36 @@ func main() {
// 服务端发 {\"Type\":\"server\",\"Ip\":\"1222\",\"Port\":\"1222\"}
// 客户端回复 {"Type":"server","State":"1"}
// 设置楼层信息
// 服务器端发 {"Type":"SetConfig","Conf":{"zong":"10","ceng":["-2","-1","1","2","3","4","5","6","7","8"],"height":"4"}}
// 客户端回复 {"Type":"SetConfig","State":"1"}
// 获取楼层信息
// 服务器端发 {"Type":"GetConfig"}
// 客户端回复 {"Type":"GetConfig","Conf":{"zong":"10","ceng":["-2","-1","1","2","3","4","5","6","7","8"],"height":"4"}}
// 设置第一段语音
// 服务器端发 {"Type":"mp3a","jg":"10","MpData":"内容" }
// 客户端回复 {"Type":"mp3a","State":"1"}
// 设置第二段语音
// 服务器端发 {"Type":"mp3b","jg":"10","MpData":"内容"}
// 客户端回复 {"Type":"mp3b","State":"1"}
// 设置第三段语音
// 服务器端发 {"Type":"mp3c","jg":"10","MpData":"内容"}
// 客户端回复 {"Type":"mp3c","State":"1"}
// 服务端设置语音配置
// 服务器端发 {"Type":"SetVoiceConf","VoiceConf":{"fyr":"0","yl":"8","ys":"8","yd":"8","isPlay":"0"}}
// 客户端回复 {"Type":"SetVoiceConf","State":"1"}
// 服务端获取客户端语音配置
// 服务器端发 {"Type":"GetVoiceConf"}
// 客户端回复 {"Type":"GetVoiceConf","VoiceConf":{"fyr":"0","yl":"8","ys":"8","yd":"8","isPlay":"0"}}
//播放
//{\n\t"Type":"ping"}
//{\"Type\":\"txt\",\"content\":\"c4e3bac3a3accac0bde7a3a1\","jg":"21""} 间隔秒