# libserv **Repository Path**: yongwangzhiqiankai/libserv ## Basic Information - **Project Name**: libserv - **Description**: 跨平台串口通信库 - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 7 - **Created**: 2024-05-23 - **Last Updated**: 2025-03-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # libserv #### 介绍 跨平台串口通信库 #### Linux用例 ```C++ //需要绑定的包校验函数 bool check_function(std::vector package){ return true; } //需要绑定的消息处理回调 int test_function(void *arg, std::vector message){ if (message.size() < 11)return 0;//以jy901陀螺仪为例,它的一个包为11字节,当缓存小于11的时候直接返回 char *temp_char = new char[message.size()]; for (int i = 0; i < message.size() - 1; i++) { temp_char[i] = message[i]; } std::cout<<"Recive<-"< package){ return true; } //需要绑定的消息处理回调 int test_function(void *arg, std::vector message){ if (message.size() < 11)return 0; char *temp_char = new char[message.size()]; for (int i = 0; i < message.size() - 1; i++) { temp_char[i] = message[i]; } std::cout<<"Recive<-"<