Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: add BREAK detection #328

Open
gicking opened this issue Jan 25, 2025 · 0 comments
Open

feature request: add BREAK detection #328

gicking opened this issue Jan 25, 2025 · 0 comments

Comments

@gicking
Copy link

gicking commented Jan 25, 2025

Hello,

if I may, can I ask you for an additional feature? I am currently developing a LIN slave library for Arduino. It aims at supporting multiple boards and interfaces, also SoftwareSerial.

In LIN, frame synchronization is via a BREAK signal, e.g. 0x00 at 1/2 baudrate (--> 0x00 without stop bit --> framing error). This is used by the slave to reset the protocol handler. If I have access to the FE information, e.g. in ESP32 HardwareSerial, I use that information for frame synchronization. In other cases I simply use the inter-frame pause, which is ugly but seems to work.

However, for ESP32 and ESP8266 with your EspSoftwareSerial, I have a problem: seemingly your library drops bytes without stop bits. Thus my lib doesn't receive the BREAK and thus cannot react on it.

Therefore my kind request is to:

  1. add an additional argument to your constructor and set the default to current behavior for backward compatibility. For example "bool dropFE = true"
  2. in the receive handler, where you check the stop bit, keep the received byte if dropFE==false (new), else drop it (current)
  3. Ideally set a corresponding framing error flag via XOR, either in a 2nd buffer, or just for the last received byte (for simplicity)

For your consideration thanks a lot in advance and have a great day :-)

Georg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant