mickeyl / LTSupportAutomotive

An iOS / watchOS / macOS support library for OBD2, VIN-Decoding, and more.
MIT License
212 stars 59 forks source link

Allow optimized communication #10

Closed mickeyl closed 6 years ago

mickeyl commented 6 years ago

Right now the parser requires to communicate in S1 mode, which is – albeit more readable – not as space efficient as possible. In particular when communicating with BTLE adapters, due to their inherently small bandwidths, every saved byte is a win.

It's not trivial to do this though since the current design relies on the space format to detect whether we have multi frames. Ideally we would feed the protocol a "normalized" form (no matter whether with or without spaces, we just have to decide on one) and take care about spaces or not on the parser level.

An added bonus would be to make the parser adaptive, i.e., to make it work with whatever input we feed, so that we would not have to configure to spaces-mode or non-spaces mode beforehand.

mickeyl commented 6 years ago

This has now been implemented as per revisions b10ef68a1a334184ad7a73aff67955aca01a3803 and a0cb1cbe529b3e87079b58bd597e92330518d568.