Feature: Add COBS-encoded float32 support #22
Open
SJ7F wants to merge 5 commits intoatomic14:mainfrom
Open
Conversation
TODO: Fix hack (where the Array of numbers is converted back to a string) on line 194 of useSerial.ts
For some reason VSCode complains about my fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds support for decoding float32 values encoded with COBS. Each COBS packet can contain any number of float32 values, each updating a different channel.
Motivation & Context
Allows for faster data logging.
COBS support was listed on the roadmap.
Changes
ascii(original mode, default) andcobs-f32modes.How to Test
Run the following code (requires Arduino.h) on a microcontroller (such as the esp32), and then connect to it using this serial plotter in COBS float32 mode. It should plot three sine waves.
(disclaimer: this test code was written by GPT-5)
Checklist
npm run lintand fixed any issuesnpm run typecheck(TypeScript) with no errorsnpm testand tests passnpm run test:coverageif code paths changed significantlyAdditional Notes
GPT-5 was used to help write cobsDecoder.ts
handleIncomingLine (in src/App.tsx) ought to be refactored at some point to remove the hack I added on line 194 of src/hooks/userSerial.ts