ihex
ihex copied to clipboard
How to exit a data read loop when the ihex stream terminates?
The docs do not seem to say, and the explanation of ihex_data_read does not seem to specify, how is the ihex reader supposed to stop when it encounters the end of the ihex stream. The ihex2bin example shows how to capture an ihex stream sourced from a file, where the reading loop relies on fgets returning an EOF condition. But in scenarios where EOF is not available, such as when transmitting ihex data via the serial port, it is not clear what the reader can do to indicate that there should be no more data to read.
I can hoist the EOF record condition from ihex_data_read via a global variable, but it would be nice if there was a way to do it through the regular API.