Skip to content

Commit

Permalink
Handle decimal temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Jun 5, 2023
1 parent a24d7d5 commit fdbd269
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private Object decodePosition(
position.set(Position.KEY_RSSI, Integer.parseInt(value));
break;
case 0x82:
position.set(Position.KEY_DEVICE_TEMP, Integer.parseInt(value) * 0.1);
position.set(Position.KEY_DEVICE_TEMP, Double.parseDouble(value) * 0.1);
break;
case 0x104:
position.set(Position.KEY_ENGINE_LOAD, Integer.parseInt(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public void testDecode() throws Exception {

var decoder = inject(new FreematicsProtocolDecoder(null));

verifyPositions(decoder, text(
"UCFLFAYM#0:33770,24:300,82:53.000000,*F9"));

verifyPositions(decoder, text(
"M0ZR4X0#0:204391,11:140221,10:8445000,A:49.215920,B:18.737755,C:410,D:0,E:208,24:1252,20:0;0;0,82:47*B5"));

Expand Down

0 comments on commit fdbd269

Please sign in to comment.