{"id":33003036,"url":"https://github.com/itas109/CSerialPort","last_synced_at":"2025-11-18T08:03:20.417Z","repository":{"id":49741791,"uuid":"58247015","full_name":"itas109/CSerialPort","owner":"itas109","description":"CSerialPort - lightweight cross-platform serial port library and protocol parsing for C++/C/C#/Java/Python/Node.js/Electron/Rust","archived":false,"fork":false,"pushed_at":"2025-11-13T15:25:05.000Z","size":10623,"stargazers_count":863,"open_issues_count":15,"forks_count":360,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-11-13T17:22:53.749Z","etag":null,"topics":["android-serialport","communication","cpp","cpp-serial","cpp-serialport","cross-platform","cserialport","linux","linux-serialport","mscomm","protocol-parser","rs232","serial","serial-port","serialport","serialport-interface","serialportassistant","serialportsdk","uart","windows-serial"],"latest_commit_sha":null,"homepage":"https://blog.csdn.net/itas109/article/details/84282860","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itas109.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://blog.csdn.net/itas109"]}},"created_at":"2016-05-07T03:16:19.000Z","updated_at":"2025-11-13T15:25:10.000Z","dependencies_parsed_at":"2024-01-17T17:26:04.067Z","dependency_job_id":"899d2e04-b7d9-4da4-bd4c-774b23a6d5fb","html_url":"https://github.com/itas109/CSerialPort","commit_stats":{"total_commits":471,"total_committers":1,"mean_commits":471.0,"dds":0.0,"last_synced_commit":"cdc889f2cba89d532b52abb21a0384021f606bbc"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/itas109/CSerialPort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itas109%2FCSerialPort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itas109%2FCSerialPort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itas109%2FCSerialPort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itas109%2FCSerialPort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itas109","download_url":"https://codeload.github.com/itas109/CSerialPort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itas109%2FCSerialPort/sbom","scorecard":{"id":496750,"data":{"date":"2025-08-11","repo":{"name":"github.com/itas109/CSerialPort","commit":"e3edb59ff436882bc8a0254bf02a88e54626455a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"12 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: examples/CommAndroid/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/itas109/CSerialPort/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/itas109/CSerialPort/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/itas109/CSerialPort/build.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v4.3.2 not signed: https://api.github.com/repos/itas109/CSerialPort/releases/199407143","Warn: release artifact v4.3.1 not signed: https://api.github.com/repos/itas109/CSerialPort/releases/139806513","Warn: release artifact v4.3.2 does not have provenance: https://api.github.com/repos/itas109/CSerialPort/releases/199407143","Warn: release artifact v4.3.1 does not have provenance: https://api.github.com/repos/itas109/CSerialPort/releases/139806513"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'v4.2.x'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T20:36:25.535Z","repository_id":49741791,"created_at":"2025-08-19T20:36:25.535Z","updated_at":"2025-08-19T20:36:25.535Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285028340,"owners_count":27102545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-serialport","communication","cpp","cpp-serial","cpp-serialport","cross-platform","cserialport","linux","linux-serialport","mscomm","protocol-parser","rs232","serial","serial-port","serialport","serialport-interface","serialportassistant","serialportsdk","uart","windows-serial"],"created_at":"2025-11-13T14:00:38.909Z","updated_at":"2025-11-18T08:03:20.409Z","avatar_url":"https://github.com/itas109.png","language":"C++","readme":"# [CSerialPort](https://github.com/itas109/CSerialPort)\n\n[中文](README_zh_CN.md)\n\nCSerialPort is a lightweight cross-platform serial port library based on C++, which can easy to read/write serial port and communication protocol parsing on multiple operating system. Also support C, C#, Java, Python, Node.js, Electron, Rust etc.\n\n\u003cp\u003e\n\u003ca href=\"https://github.com/itas109/CSerialPort/releases\"\u003e\u003cimg alt=\"Version\" src=\"https://img.shields.io/github/release/itas109/CSerialPort\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/itas109/CSerialPort/stargazers\"\u003e\u003cimg alt=\"Stars\" src=\"https://img.shields.io/github/stars/itas109/CSerialPort\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://gitee.com/itas109/CSerialPort\"\u003e\u003cimg alt=\"Stars\" src=\"https://gitee.com/itas109/CSerialPort/badge/star.svg?theme=dark\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/itas109/CSerialPort/blob/master/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-LGPLv3%20with%20linking%20exception-orange\"/\u003e\u003c/a\u003e\n\u003cimg alt=\"language\" src=\"https://img.shields.io/badge/language-c++-red\"/\u003e\n\u003cimg alt=\"appveyor-ci\" src=\"https://ci.appveyor.com/api/projects/status/a4t6ddubhns561kh?svg=true\"/\u003e\n\u003c!-- \u003cimg alt=\"travis-ci\" src=\"https://www.travis-ci.org/itas109/CSerialPort.svg?branch=master\"/\u003e --\u003e\n\u003c/p\u003e\n\n---\n\n# Design Principles\n\n- Cross-platform\n- Easy to use\n- Higher efficiency\n- Custom protocol parsing\n\n# Feature\n\n- cross-platform windows linux macOS android freebsd\n- sync and async read/write\n- custom protocol parsing - [IProtocolParser](https://github.com/itas109/CSerialPort/tree/master/include/CSerialPort/IProtocolParser.h) and [CommNoGuiProtocol](https://github.com/itas109/CSerialPort/tree/master/examples/CommNoGuiProtocol)\n- hot plug notify - [CSerialPortHotPlugListener](https://github.com/itas109/CSerialPort/tree/master/include/CSerialPort/SerialPortListener.h)\n- third party language bindings - C, C#, Java, Python, Node.js, Electron, Rust - more information [bindings](https://github.com/itas109/CSerialPort/tree/master/bindings)\n- usage tutorial - [CSerialPort Tutorial](https://blog.csdn.net/itas109/category_12416341.html)\n- new cross-platform gui serial port tool - [CommMaster](https://gitee.com/itas109/CommMaster)\n\n# Todo List\n\n## Long-term Goal\n\n- [ ] 1.support modern c++ standard\n- [ ] 2.support character interval time and custom protocol parsing\n- [ ] 3.support raw sync、raw async and extend async mode\n- [ ] 4.support script engine\n\n## Short-term Goal\n\n- [x] 1.cross-platform OS identify class\n- [x] 2.cross-platform thread class\n- [x] 3.cross-platform lock class\n- [x] 4.cross-platform higher efficiency timer class\n- [ ] 5.cross-platform thread pool class\n- [ ] 6.Performance test report(Throughput \u0026\u0026 delay \u0026\u0026 packet dropout rates)\n\n# Latest version\n\n## Version: 4.3.3.250923\nby itas109 on 2025-09-23\n\n# Quick Start\n\n```\n$ git clone --depth=1 https://github.com/itas109/CSerialPort.git\n$ cd CSerialPort\n$ mkdir bin \u0026\u0026 cd bin\n$ cmake ..\n$ cmake --build .\n```\n\nrun demo ( for example serial port lookback test on linux)\n\n```\nCSerialPort/bin $ ./CSerialPortDemoNoGui \n[INFO] CSerialPort - OS: Linux, ProductName: Ubuntu 22.04.2 LTS, Arch: x86_64, ProcessorNum: 4, Compiler: gcc(11.4.0), Bit: 64, C++: 201703L, Bindings: , Version: https://github.com/itas109/CSerialPort - v4.3.3.250923\nVersion: https://github.com/itas109/CSerialPort - v4.3.3.250923\n\nAvailableFriendlyPorts:\n1 - /dev/ttyCH341USB0 QinHeng CH340 serial converter 1a86:7523\n2 - /dev/pts/0 0 pty terminal\n\nPlease Input The Index Of Port(1 - 2)\n1\nPort Name: /dev/ttyCH341USB0\n[INFO] openPort - portName: /dev/ttyCH341USB0, baudRate: 9600, dataBit: 8, parity: 0, stopBit: 0, flowControl: 0, mode: async, readBufferSize:4096(4096), readIntervalTimeoutMS: 0, minByteReadNotify: 1, byteReadBufferFullNotify: 3276\n[INFO] openPort - open /dev/ttyCH341USB0. code: 0, message: success\nOpen /dev/ttyCH341USB0 Success\nCode: 0, Message: success\n[INFO] writeData - write. len: 5, hex(top100): 3132333435\n[INFO] writeData - write. len: 7, hex(top100): 69746173313039\n[INFO] commThreadMonitor - write buffer(usedLen 12). len: 12, hex(top100): 313233343569746173313039\n[INFO] commThreadMonitor - onReadEvent min read byte. portName: /dev/ttyCH341USB0, readLen: 12\n[INFO] readData - read. len: 12, hex(top100): 313233343569746173313039\n/dev/ttyCH341USB0 - Count: 1, Length: 12, Str: 12345itas109, Hex: 0x31 0x32 0x33 0x34 0x35 0x69 0x74 0x61 0x73 0x31 0x30 0x39\n```\n\n# Install CSerialPort Using Vcpkg\n\nYou can download and install CSerialPort using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager\n\n```\n$ git clone https://github.com/Microsoft/vcpkg.git\n$ cd vcpkg\n$ ./bootstrap-vcpkg.sh\n$ ./vcpkg install cserialport\n```\n\n# Cross Compile\n\n- arm on ubuntu 20.04\n\n```\n$ sudo apt-get install g++-arm-linux-gnueabi\n$ cd CSerialPort\n$ mkdir bin_arm \u0026\u0026 cd bin_arm\n$ cmake .. -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchain_arm.cmake\n$ cmake --build .\n```\n\n- aarch64 on ubuntu 20.04\n\n```\n$ sudo apt-get install g++-aarch64-linux-gnu\n$ cd CSerialPort\n$ mkdir bin_aarch64 \u0026\u0026 cd bin_aarch64\n$ cmake .. -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchain_aarch64.cmake\n$ cmake --build .\n```\n\n- mips64el on ubuntu 20.04\n\n```\n$ sudo apt-get install g++-mips64el-linux-gnuabi64\n$ cd CSerialPort\n$ mkdir bin_mips64el \u0026\u0026 cd bin_mips64el\n$ cmake .. -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchain_mips64el.cmake\n$ cmake --build .\n```\n\n- riscv64 on ubuntu 20.04\n\n```\n$ sudo apt-get install g++-riscv64-linux-gnu\n$ cd CSerialPort\n$ mkdir bin_riscv64 \u0026\u0026 cd bin_riscv64\n$ cmake .. -DCMAKE_TOOLCHAIN_FILE=./cmake/toolchain_riscv64.cmake\n$ cmake --build .\n```\n\n# Screenshot\n\n## Gui\n\nDemo Path: CSerialPort/examples/CommQT\n\n![image](pic/linux_qt.jpg)\n\nDemo Path: CSerialPort/examples/CommElectron\n\n![image](pic/linux_electron.jpg)\n\n## Web\n\nDemo Path: CSerialPort/examples/CommWeb\n\n![image](pic/linux_web.jpg)\n\n## No Gui\n\nDemo Path: CSerialPort/examples/CommNoGui\n\n![image](pic/linux_no_gui.jpg)\n\n# Documents\n\n[API Document](doc/CSerialPort_doc_en.chm)\n[Directory List Document](doc/directory_list.md)\n[Error Guide Document](doc/error_guide.md)\n[Frequently Asked Questions](doc/FAQ.md)\n\n# Contacting\n\n- Email : itas109@qq.com\n- QQ Group : [129518033](http://shang.qq.com/wpa/qunwpa?idkey=2888fa15c4513e6bfb9347052f36e437d919b2377161862948b2a49576679fc6)\n\n# Links\n\n- [CSDN Blog](https://blog.csdn.net/itas109)\n- [Github](https://github.com/itas109/CSerialPort)\n- [Gitee](https://gitee.com/itas109/CSerialPort)\n\n# CSerialPort-based Applications\n## 1. [CommMaster](https://gitee.com/itas109/CommMaster)\n\n- support windows/linux/macos/raspberrypi and so on\n- support custom port name\n- support custom baudrate\n- support custom language\n- support custom theme\n\nhttps://gitee.com/itas109/CommMaster\n\n![image](pic/CommMaster.png)\n\n# Donate\n\n[CSDN Blog](https://blog.csdn.net/itas109)\n\n---\n\n# Other branches\n\nOnly for windows branch : https://github.com/itas109/CSerialPort/tree/CSerialPort_win_3.0.3\n\nThanks for [Remon Spekreijse's serial library](http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2483/A-communication-class-for-serial-port.htm)\n\n---\n\n# License\n\nCSerialPort v3.0.0.171216 - v4.3.1.240204 is licensed under the LGPLv3\n\nCSerialPort v4.3.2.250203 - present is licensed under the [LGPLv3 with LGPL-3.0-linking-exception](LICENSE)","funding_links":["https://blog.csdn.net/itas109"],"categories":["Serial Port"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitas109%2FCSerialPort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitas109%2FCSerialPort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitas109%2FCSerialPort/lists"}