Giter Site home page Giter Site logo

zhuyanzhen1 / cdtp Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 8.0 763 KB

数据链路层协议,只需要提供单字节的收发函数就可以移植这些协议。Data link layer protocols can be transplanted by providing a single byte transceiver function.

License: GNU Affero General Public License v3.0

C 100.00%
data-transmit-protocol protocol stm32 uart-protocol

cdtp's Introduction

Data Transmit Protocol

Version  Build  License        English / 中文

    This project is a derivative version of a lightweight data transmission protocol proposed and developed by the author when he participated in Robomaster high school summer camp in senior three. The main purpose is to realize the function of the transport layer. This protocol can be applied to various physical layers, such as UART, SPI, IIC, etc., which provides a guarantee for sequential data transmission. According to the requirements of the amount of data transmitted, the author divides the protocol into the following three different versions:

    Note: please choose a small data transmission protocol when the transmission capacity is met, because the larger the data transmission protocol, the larger the stack, the more complex the protocol processing and the greater the error probability, which is reflected in the longer interrupt occupation time (geometric increase) and the easier the stack overflow on the microcontroller.


Porting Code:

  1. Porting files "encrypt.c,encrypt.h,decrypt.c,decrypt.h,ioctrl.c,ioctrl.h" into your project
  2. Realize the single byte transmit function in "ioctrl.c", which function name is common_sendbyte.
  3. After receiving a byte,call the "common_receivebyte" function in "decrypt.c", as well deliver the received byte to buf.
  4. After finished the previous steps,call the "xdtp_data_transmit" function to send a package; it'll trig the "xdtp_callback_handler" function in "ioctrl.c" if received a package.

Bugs & Feature Requests

Please report bugs and request features using the Issue Tracker and follow these request:

  1. Tab highlight when on different tab.
  2. Don’t let the update disappear if the window is not in focus.

License

The source code is released under a AGPL-3.0 License.

Affiliation:AcmeTech
Author: Yanzhen Zhu
Maintainer:YanzhenZhu, [email protected]

The product has been tested under Windows 10 and Ubuntu 22.04 LTS. This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.

cdtp's People

Contributors

zhuyanzhen1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cdtp's Issues

[Feature] Consider alternative framing bytes to improve UART protocol's robustness against interference

Verify steps

Description

Hi there,

I've been looking into your medium capacity data transmission protocol and noticed that it uses 0xFF as both frame header and frame tail. While this is simple and straightforward, it might lead to issues in situations where the UART communication is subject to interference.

When UART communication experiences external electromagnetic interference, an unexpected low-level signal (logical 0) might appear on the line. If the receiving end misinterprets this as a start bit and continues to detect high-level signals (logical 1) in the subsequent data bits, it may erroneously interpret it as a 0xFF byte. This can result in unstable communication and reduced protocol reliability.

To enhance the UART protocol's robustness against interference, I'd recommend considering alternative byte values for the frame header and frame tail, similar to the SLIP (Serial Line IP) protocol design. Using different and less likely byte combinations due to interference will help improve data transmission reliability in noisy environments.

Thank you for your work on this project!

Possible Solution

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.