Closed ctadlock closed 1 year ago
Unfortunately, that's correct. If you don't have a uniform, pre-defined set of delimiters, there's no way to register a delimited event listener. You will either have to write your own custom listener/parser in application code, or you could register a delimited event listener on "</" and then just parse the response tag by starting from whichever index the first "<" character is located at. Hope that helps!
Closing as "will not fix".
From what I can tell there is no way to create an event listener that supports multiple different delimiters. Is that true?
My use case is I have a device that returns XML data, the outer element of that XML is different based on the command that is sent. Its a crap design that I cant control. For example:
getFirmware
; Response:<firmware>1.2.3.4</firmware>
getName
; Response:<name>blah</name>
I dont see a way to create an event listener for this data as there is not a common delimeter, the length is not fixed, and multiple listeners is not supported (https://github.com/Fazecast/jSerialComm/issues/456).