Easytrack - Status Field

Filipe Oliveira7 years ago

As seen in the table below, easytrack protocol has a status field. This field consist by 4 bytes, that need to be "translate" using the table. As we can see in EasyTrackProtocolDecoder.java the code already do this translation in the subfield alarm.

My question is: Why the other fields do not have their own keys in the attributes object? Can I submit a PR with this 'feature'? I have this need because the ignition field is an important field in tracking and I think it should be easily accessible

I.E:

Now:

 attributes: {
     command: 'HB',
     status: 1086324736,
     signal: '20',
     power: 100,
     oil: 0,
     odometer: 6200,
     distance: 2.07,
     totalDistance: 2467.4,
     motion: true 
}

Could be:

attributes:{
  command: 'HB',
  status: 1086324736,
  alarm: "OVER_SPEED", //obtained from the status field
  powerSave: true, //obtained from the status field
  ignition: true, //obtained from the status field
  signal: '20',
  power: 100,
  oil: 0,
  odometer: 6200,
  distance: 2.07,
  totalDistance: 2467.4,
  motion: true
},

Part two. Device status. Consist by 4 bytes. The blank ones are to be determined

Item number First byte Second byte Third byte Fourth byte
0 Alarm against external power cut SOS alarm alarm against enter geo-fence 1(Round shape)
1 alarm against enter platform geo-fence (Square shape geo-fence) Movement alarm alarm against exit geo-fence 1 (Round shape)
2 alarm against exit platform geo-fence (Square shape geo-fence) Power down alarm alarm against enter geo-fence 2 (Round shape)
3 low voltage of backup battery Cut off engine power alarm against exit geo-fence 2 (Round shape)
4 GPS status Car door opened alarm against enter geo-fence 3 (Round shape)
5 sense of motion Alarm of car anti-theft device alarm against exit geo-fence 3 (Round shape)
6 Car is driving Power saving mode
7 Over-speed alarm ACC ignition on=1; ignition off=0;
Anton Tananaev7 years ago

Sure, feel free to send a pull request. Make sure you provide protocol documentation and some message samples from real device.