Git Product home page Git Product logo

cobs-c's People

Contributors

cmcqueen avatar lotterleben 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

cobs-c's Issues

decoding a COBSR encoded data block does not result in original data

There seems to be an error in the encoder or decoder for C implementation of the COBSR algorithm.
I modified the test code in tests-c/main.c to check whether the decoded data resulted in the same as the original data. Sometimes it seems the decoded result is one byte longer. In the other cases the last byte is one higher than the original last byte.
Take the example data: 00 00, which when encoded and decoded results in 00 00 02. And 31 32 33 34 35 results in 31 32 33 34 36

Unbuffered version?

Originally reported by: Yaroslav Boris (Bitbucket: Boris_Yaroslav, GitHub: Unknown)


How about to realize the version without using buffers?
This will be useful for the controllers, who do not have a lot of memory.

For example: I received byte - passed to the function, the function may call another function, which sends the decoded byte.


Use `void *` instead of `uint8_t *`

For all the COBS and COBS/R encode and decode functions, change input and output buffer pointers to be void * instead of uint8_t *.

This would be similar to functions such as memcpy() which deal with void *.

C code unit tests

Originally reported by: Craig McQueen (Bitbucket: cmcqueen1975, GitHub: Unknown)


There are unit tests, but written in Python. This is good, but doesn't allow for unit tests to be run on a platform that doesn't support Python--e.g. a small embedded platform.

It would be good to provide some unit tests in C with reasonably good coverage.


Test in-place encoding and/or decoding (one buffer for input and output)

Originally reported by: Craig McQueen (Bitbucket: cmcqueen1975, GitHub: @cmcqueen)


Examine whether the code supports in-place encoding and/or decoding. That is, output is written to the input buffer, overwriting the original input. It could be useful to save RAM in small embedded systems.

  • My guess is that in-place decoding should work as-is
  • In-place encoding should work I think, however the input would have to be offset from the start of the output buffer by a certain number of bytes. In the code, see COBS_ENCODE_SRC_OFFSET() and COBSR_ENCODE_SRC_OFFSET() which calculate the required offset, for a given data size.

Once this has been checked:

  • Add some unit tests to check this.
  • Add documentation to say whether/how it works.

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.