How can I parser the other fields of yuwei yw3000-y?

ont20168 years ago

Here is my raw data that can be read from the url decoder.

%RP,1222102985:1,170509033806,E102.148745,N14.579128,,0,330,9,0,00-00-00-00-00-00-00-00-00-00-00-00,,1db2-02b3-52004,3>941.523-32,7>1,19>-10,20>30.6V
%RP,1222102985:1,170509033842,E102.146563,N14.582175,,0,320,10,0,00-00-00-00-00-00-00-00-00-00-00-00,,1db2-02b3-52004,3>941.523-32,7>1,19>-16,20>30.9V
%RP,1222102985:1,170509033918,E102.143967,N14.584857,,0,331,9,0,00-00-00-00-00-00-00-00-00-00-00-00,,1db2-02b3-52004,3>941.523-32,7>1,19>-18,20>30.8V
%RP,1222102985:1,170509034001,E102.142737,N14.588387,,0,341,9,0,00-00-00-00-00-00-00-00-00-00-00-00,,1db2-02b3-52004,3>941.523-32,7>1,19>-21,20>30.1V

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.

Anton Tananaev8 years ago

You can modify YwtProtocolDecoder class to decode extra information.

ont20168 years ago

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

Anton Tananaev8 years ago

You can use "PatternUtil" class to debug your regex patter.