RPM
Posts: 3
Joined: Mon Mar 21, 2016 10:56 am

Device Mapper Scripting with Persistence

Mon Mar 21, 2016 11:04 am

Hi,

I have a Xexun XT009 that I am trying to create a device mapper script for to give me the current ignition status.

XT009 sends ignition status using the 'message' field:

- Ignition is turned on, sends 'ACCStart' just once
- Subsequent position updates do not contain any info about ignition status
- Ignition is turned off, sends 'ACCStop' just once
- Subsequent position updates do not contain any info about ignition status

I thought this would be simple with scripting (I wrote a few line script that sets ignition to true when ACCStart, to false when ACCStop, and attempts to use the previous value when no message).

However, it seems that you cannot access previous value of the ignition that you set, as there is not stateful info in the next script call?

It also seems there is no way to have persistence between script calls either (global variables etc), is that correct too?

Any suggestions on how I can make this work would be gladly received :)

User avatar
johan
GpsGate
Posts: 15403
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Device Mapper Scripting with Persistence

Mon Mar 21, 2016 3:28 pm

Device Mapper Scripting does not have a state.

The Xexun plugin shouold already support ACCStart/ACCStop. Please send Terminal data to support @ gpsgate which includes ACCStart + ACCStop and we will see what is wrong.

Regards,
Johan

GpsGate Support

RPM
Posts: 3
Joined: Mon Mar 21, 2016 10:56 am

RE: Device Mapper Scripting with Persistence

Mon Mar 21, 2016 9:54 pm

Hi Johan,

Thanks for the reply, will send in email.

FYI, the TK102-2 mapping I use which supports the other fields needed does not have ignition.

The XT008 says it has ignition but resets to false on the second update from this XT009, and is missing the Satellite Count field that I also use.

I cannot see a Xexun mapper that has both Satellite Count and Ignition built in either.

Richard

RPM
Posts: 3
Joined: Mon Mar 21, 2016 10:56 am

RE: Device Mapper Scripting with Persistence

Tue Mar 22, 2016 10:02 pm

Hi Johan,

Many thanks for the resolution to making Ignition save state on the 'Xexun XT008' mapper - this now works perfectly.

And an even bigger thanks for releasing the new plugin version that adds SatelliteCount to the Xexun and XT008 mappers too!

This makes the XT009 work perfectly with the XT008 mapper now.

Richard

Return to “GpsGate for Developers”