Code Monkey home page Code Monkey logo

bm_protocol's Introduction

Bristlemouth

For information on the Bristlemouth project, check out the official website bristlemouth.org

Developing

To set up your development environment, see ENV_SETUP.md

If you already have your development environment set up, check out the DEVELOPER.md file for some quick start guides, etc...

If you're developing on the Bristlemouth Development Kit, see the BMDK_README.md

bm_protocol's People

Contributors

beardedtrogon avatar evanshap avatar russelldeguzman avatar sophiediehl avatar tcj avatar towynlin avatar victorsowa12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bm_protocol's Issues

DevKit Payload UART wrapper (PLUART) should implement a queue for sensor lines, rather than a single buffer

Issue / request

  • PLUART maintains a single static _user_line buffer for thread-safe access of serial line data from sensors.
  • If the client app does not service data in this buffer with a call to readLine before another line comes from the sensor, the new line overwrites the buffer and data is lost.
  • Implement a thread-safe queue/buffer that can store multiple lines.
  • Alert client if data if queue overflowed and has been overwritten/lost.

Background / why

The PLUART namespace (defined here) adds some very convenient wrappers to the DevKit's Payload UART interface, which is the data interface for many of the serial connections the DevKit supports (UART, RS232, RS485, RS422, SDI-12).

There are (2) thread-safe methods exposed for users to access Rx data from their apps - PLUART::readLine and PLUART::readByte.

readLine can be used when the attached device is generating frames of serial data with reserved delimiting characters (a common example is ASCII text data with <CR> and/or <LF> being the frame delimiter). This is a very common pattern for legacy marine sensors so this is a very convenient wrapper to have.

The issue is that most of these sensors will have some multi-line data or command responses, the the potential for overwriting with the existing implementation results hairy-edge brittleness and a poor developer experience - the line buffer works most of the time. Works often enough to make it non-obvious what exactly is going wrong, but fails more than often enough to make it something a developer can just ignore. It's also susceptible to small timing changes in the app causing things to break, which can result in pernicious Heisenbugs.

related PR from legacy private repo for reference: https://github.com/wavespotter/bristlemouth/pull/465

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.