Skip to content

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

Open
r00t- wants to merge 1 commit into
volkszaehler:masterfrom
r00t-:detect_unaligned_esc_sequences
Open

[transport] detect and warn about unaligned esc sequences#112
r00t- wants to merge 1 commit into
volkszaehler:masterfrom
r00t-:detect_unaligned_esc_sequences

Conversation

@r00t-

@r00t- r00t- commented Jan 5, 2023

Copy link
Copy Markdown
Collaborator

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-

r00t- commented Jan 5, 2023

Copy link
Copy Markdown
Collaborator Author

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-

r00t- commented Apr 13, 2023

Copy link
Copy Markdown
Collaborator Author

(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