-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bugfix: Add VGN mode parameter #5523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f711369
a4123a0
107460f
852dd7d
5200dc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
|
@@ -81,13 +81,15 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { | ||
Map.entry("55", "GL50B"), | |||
Map.entry("5E", "GV500MAP"), | |||
Map.entry("6E", "GV310LAU"), | |||
Map.entry("70", "GV50M"), | |||
Map.entry("BD", "CV200"), | |||
Map.entry("C2", "GV600M"), | |||
Map.entry("DC", "GV600MG"), | |||
Map.entry("DE", "GL500M"), | |||
Map.entry("F1", "GV350M"), | |||
Map.entry("F8", "GV800W"), | |||
Map.entry("FC", "GV600W"), | |||
Map.entry("FE", "GV53MG"), | |||
Map.entry("802004", "GV58LAU"), | |||
Map.entry("802005", "GV355CEU")); | |||
|
|||
|
@@ -1122,6 +1124,7 @@ private Object decodeIgn( | ||
|
|||
String model = getDeviceModel(deviceSession, protocolVersion); | |||
index += 1; // device name | |||
if (isVirtualIgnitionMode(type, model)) index += 1; // virtual ignition mode | |||
index += 1; // duration of ignition on/off | |||
|
|||
index = decodeLocation(position, model, v, index); | |||
|
@@ -1142,6 +1145,11 @@ private Object decodeIgn( | ||
return position; | |||
} | |||
|
|||
private boolean isVirtualIgnitionMode(String type, String model) { | |||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need a separate function for this. Also what does |
|||
return type.contains("VG") && | |||
List.of("GV50M", "GV53MG").contains(model); | |||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A set of direct comparison would make more sense here. |
|||
} | |||
|
|||
private static final Pattern PATTERN_LSW = new PatternBuilder() | |||
.text("+RESP:").expression("GT[LT]SW,") | |||
.expression("(?:.{6}|.{10})?,") // protocol version | |||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,9 @@ public void testDecode() throws Exception { | |
"+RESP:GTVGN,C2010D,869653060009939,GV600M,453966,0,0.0,0,163.9,10.239379,45.931389,20231210233723,0222,0010,2F31,006D7621,,,0.0,20240107182623,143F$"), | ||
Position.KEY_IGNITION, true); | ||
|
||
verifyPosition(decoder, buffer( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add new test to the top of the file. |
||
"+BUFF:GTVGN,700401,865918060953848,,2,18764,0,0.0,10,212.7,-94.599696,35.409763,20250311043241,0310,0410,600B,03DB140F,,,0.0,20250311043242,D994$")); | ||
|
||
verifyAttribute(decoder, buffer( | ||
"+RESP:GTIGF,8020050502,867488060278727,,509,1,0.0,184,32.6,14.003446,42.654554,20240219124629,0222,0001,0FAD,0497F715,00,,0.0,20240219124630,FD2F$"), | ||
Position.KEY_IGNITION, false); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please attach full documentation for both device models.