BLE_TYQ_BJQ_CH32V303/doc/通讯协议/通讯协议.md

41 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
* @Author : stark1898y 1658608470@qq.com
* @Date : 2024-09-26 13:24:24
* @LastEditors : stark1898y 1658608470@qq.com
* @LastEditTime : 2024-09-26 13:24:24
* @FilePath : \JT-DT-YD4N02A_RTT_MRS\doc\通讯协议\通讯协议.md
* @Description :
*
* Copyright (c) 2024 by yzy, All Rights Reserved.
-->
基于《深圳铠湾智能无线终端通信协议(4G)V3.0-release
1. 设备采用通过 Tcp 数据传输协议方式与服务器通信
2. 保持长连接数据包默认为 1 分钟上报一次(需要可下发设置)
3. 测试服务器地址 : http://120.25.163.9/
4. 设备每次上电注册时需要发送一次注册包和心跳事件包;
5. 正常情况下心跳事件时间为 2小时上报一次需要可下发设置
帧数据格式定义
| 字段 | Header | Version | Manufacture | DataNo | Cmd | dataLen | data | CRC | Tail |
| ------------- | -------- | -------- | ----------- | ---------- | ------ | -------- | ------ | ------------------------------------------------------------------------------------------------------------------ | -------- |
| 含义 | 帧头 | 协议版本 | 厂商标识 | 数据序列号 | 命令位 | 数据长度 | 数据体 | 校验位 | 帧尾 |
| 长度字节B | 3 | 1 | 2 | 2 | 1 | 2 | N | 2 | 3 |
| | 0x57544B | 0x01 | 0x4454 | | | | | CRC16 XMODEM 多项式 x16+x12+x5+10x1021校验内容 =(帧头+协议版本+厂商标识+数据序列号+命令位+数据长度+数据体) | 0x454E44 |
命令集
| | | |
| - | - | - |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |