You can modify YwtProtocolDecoder class to decode extra information.
Hi Anton,
Thank you for your suggestion. I have to modify various pattern but it does not success in YwtProtocolDecoder. Please advice me to decode the extra information.
private static final Pattern PATTERN = new PatternBuilder()
.expression("%(..),") // type
.number("(d+):") // unit identifier
.number("d+,") // subtype
.number("(dd)(dd)(dd)") // date (yymmdd)
.number("(dd)(dd)(dd),") // time (hhmmss)
.expression("([EW])")
.number("(ddd.d{6}),") // longitude
.expression("([NS])")
.number("(dd.d{6}),") // latitude
.number("(d+)?,") // altitude
.number("(d+),") // speed
.number("(d+),") // course
.number("(d+),") // satellite
.expression("([^,]+),") // report identifier
.expression("([-0-9a-fA-F]+)") // status
.any()
.compile();
How can I coding the source to match the raw data?
`%RP,1222102985:1,170422075049,E102.069072,N15.017262,,0,0,7,0,00-10-00-00-20-00-00-00-00-00-00-00,,1db2-3111-52004,3>0.137-0,7>0,19>14,20>0.8V
You can use "PatternUtil" class to debug your regex patter.
Here is my raw data that can be read from the url decoder.
The importance data are 1db2-02b3-52004 for CELLID, 7>1 for analog input and 20>30.1V for External Voltage.
How can I modify source code to correct ywt protocol by myself? Any suggest almost welcome.