Skip to content

Commit

Permalink
Fix Space10X decoding exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Jul 1, 2021
1 parent 94d95eb commit 9a070e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ private Object decodeBasicOther(
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());

if (type == MSG_LBS_MULTIPLE_1 || type == MSG_LBS_MULTIPLE_2 || type == MSG_LBS_EXTEND
if (type == MSG_LBS_STATUS && dataLength >= 18) {

return null; // space10x multi-lbs message

} else if (type == MSG_LBS_MULTIPLE_1 || type == MSG_LBS_MULTIPLE_2 || type == MSG_LBS_EXTEND
|| type == MSG_LBS_WIFI || type == MSG_LBS_2 || type == MSG_WIFI_3) {

boolean longFormat = type == MSG_LBS_2 || type == MSG_WIFI_3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public void testDecode() throws Exception {
verifyNull(decoder, binary(
"78780D01086471700328358100093F040D0A"));

verifyNull(decoder, binary(
"7878171915061810051a01f90101700d08c8f50c0000065494ae0d0a"));

verifyNotNull(decoder, binary(
"78783B2E10010D02020201CC00287D001F713E287D001F7231287D001E232D287D001F4018000000000000000000000000000000000000FF00020005B14B0D0A"));

Expand Down

0 comments on commit 9a070e7

Please sign in to comment.