# simple_protocol_py **Repository Path**: lyworkspace/simple_protocol_py ## Basic Information - **Project Name**: simple_protocol_py - **Description**: simple_protocol的python实现 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-07-01 - **Last Updated**: 2024-10-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # simlpe_protocol使用方法 ## 接口定义 ```c++ enum class FrameStatus { BUFFER_EMPTY = 0, // 缓冲区为空 BUFFER_INVALID = 1, // 无效缓冲区,没有可以使用的数据 BUFFER_TIMEOUT = 2, // 缓冲区超时,连续一定时间没有接收到数据,但在缓存中有数据 BUFFER_BROKEN = 3, // 一帧数据开关前面有未知意义的缓存 BUFFER_NOT_ENOUGH = 4, // 缓冲区长度不足 LENGTH_NOT_ENOUGH = 5, // 帧长度不足 LENGTH_ERROR = 6, // 帧长度错误 CRC_ERROR = 7, // 帧CRC错误 INVALID = 8, // 帧无效 VALID = 9, // 帧有效 }; struct frame_t { FrameStatus status; // 当前帧的状态 std::uint32_t channel; // 通道号 std::vector data; // 帧数据 const std::string str_data(); frame_t(FrameStatus status, std::uint32_t channel, std::vector data) : status(status), channel(channel), data(std::move(data)); }; ``` ## 使用方法 安装方法如下 ```shell python -m pip install . ```