I have a device that (as far as I understand) transmit data using the ECMA-48 protocol or ANSI Escape sequences.
That data usually get printed to a 2rows-16chars LCD device.
I want to be able to read that data using an Arduino, and send it to another software parsed as:
<1>FirstRowData</1><2>SecondRowData</2>
I found some projects online that do the opposite..let you send ANSI escape sequences parsed data to a device. I need the other way around..
It appears that .[x is an ANSI escape sequence. Removing them should be pretty simple. Of course, you'll need to understand what each of them does, in order to figure out how the text is currently displayed, so that you can rearrange the text in the same way.
The only ones that I see used in your example are the home and erase line codes. I don't see how those move 000089568 to the second line, and 07 BAG DDAST to the first line.
1.It was just an example [there are different escape codes used with this device].
2. I don't know for sure how, but if I'll connect the real display connected to the device - this is the rows order.
first it outputs the second row, then, the first one.
OK, so that data was just a snapshot of a portion of the data stream. From that, it appears that there are two different packets involved. The value is from one, and the header if from the next packet.
Finding what represents the start of a packet might be important.