Skip to content

Commit

Permalink
Fix pattern comments formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Nov 6, 2015
1 parent 10bd96d commit 87a8c80
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/org/traccar/protocol/GpsGateProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ public GpsGateProtocolDecoder(GpsGateProtocol protocol) {

private static final Pattern PATTERN = new PatternBuilder()
.text("$GPRMC,")
.number("(dd)(dd)(dd).?(d+)?,") // Time (HHMMSS.SSS)
.expression("([AV]),") // Validity
.number("(dd)(dd.d+),") // Latitude (DDMM.MMMM)
.number("(dd)(dd)(dd).?(d+)?,") // time
.expression("([AV]),") // validity
.number("(dd)(dd.d+),") // latitude
.expression("([NS]),")
.number("(ddd)(dd.d+),") // Longitude (DDDMM.MMMM)
.number("(ddd)(dd.d+),") // longitude
.expression("([EW]),")
.number("(d+.d+)?,") // Speed
.number("(d+.d+)?,") // Course
.number("(dd)(dd)(dd)") // Date (DDMMYY)
.any() // Other (Checksumm)
.number("(d+.d+)?,") // speed
.number("(d+.d+)?,") // course
.number("(dd)(dd)(dd)") // date (ddmmyy)
.any()
.compile();

private void send(Channel channel, String message) {
Expand Down
32 changes: 16 additions & 16 deletions src/org/traccar/protocol/HaicomProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ public HaicomProtocolDecoder(HaicomProtocol protocol) {

private static final Pattern PATTERN = new PatternBuilder()
.text("$GPRS")
.number("(d+),") // IMEI
.expression("([^,]+),") // Version
.number("(dd)(dd)(dd),") // Date
.number("(dd)(dd)(dd),") // Time
.number("(d)") // Flags
.number("(dd)(d{5})") // Latitude (DDMMMMM)
.number("(ddd)(d{5}),") // Longitude (DDDMMMMM)
.number("(d+),") // Speed
.number("(d+),") // Course
.number("(d+),") // Status
.number("(d+)?,") // GPRS counting value
.number("(d+)?,") // GPS power saving counting value
.number("(d+),") // Switch status
.number("(d+)") // Relay status
.expression("(?:[LH]{2})?") // Power status
.number("#V(d+)") // Battery
.number("(d+),") // imei
.expression("([^,]+),") // version
.number("(dd)(dd)(dd),") // date
.number("(dd)(dd)(dd),") // time
.number("(d)") // flags
.number("(dd)(d{5})") // latitude
.number("(ddd)(d{5}),") // longitude
.number("(d+),") // speed
.number("(d+),") // course
.number("(d+),") // status
.number("(d+)?,") // gprs counting value
.number("(d+)?,") // gps power saving counting value
.number("(d+),") // switch status
.number("(d+)") // relay status
.expression("(?:[LH]{2})?") // power status
.number("#V(d+)") // battery
.any()
.compile();

Expand Down

0 comments on commit 87a8c80

Please sign in to comment.