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

[transport] detect and warn about unaligned esc sequences #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

r00t-
Copy link
Collaborator

@r00t- r00t- commented Jan 5, 2023

first step of improvement towards #103 (see also devZer0/libsml-testing#12 )

this at least provides a warning:

$ ./examples/sml_server - <libsml-testing/EasyMeter_Q3A_A1064V1009.bin  >/dev/null 
libsml: warning: could not read the whole file
libsml: warning: unaligned end esc sequence found in data, stream desynced?
libsml: warning: unaligned (likely) start esc sequence found in data, stream desynced?
libsml: warning: unaligned end esc sequence found in data, stream desynced?
libsml: warning: unaligned (likely) start esc sequence found in data, stream desynced?
libsml: warning: unaligned end esc sequence found in data, stream desynced?
libsml: warning: unaligned (likely) start esc sequence found in data, stream desynced?
libsml: warning: unaligned end esc sequence found in data, stream desynced?
libsml: warning: unaligned (likely) start esc sequence found in data, stream desynced?

@r00t- r00t- force-pushed the detect_unaligned_esc_sequences branch from 50834d7 to e15b9f7 Compare January 5, 2023 21:44
@r00t-
Copy link
Collaborator Author

r00t- commented Jan 5, 2023

this could be merged as-is, but it would heavily spam a user's log in case of a desync.
(might still be better than silently stopping to return data.)
we should extend it to re-sync to the data stream somehow.

@r00t-
Copy link
Collaborator Author

r00t- commented Apr 13, 2023

(also the code is rather simplistic and inefficient, there should be better ways to do this.)

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

Successfully merging this pull request may close these issues.

1 participant