Help to create a new filter

tambiu5 years ago

Hi, I appreciated if someone can help me to create a new filter, I know how to compile the traccar, I have found this file FilterHandler, that have the logicals filters, I would like to create a filter that works like this: If speed is less than 5 km/h and ignition is false and new position time is x seconds more than the last one, so it will filtered out.

I dont know how to get ignition status to make the new filter,

    private boolean newFilter(Position position, Position last) {
        if (newFilter != 0 && last != null && position.getSpeed() < 5) {
            long time = position.getFixTime().getTime() - last.getFixTime().getTime();
            return time > newFilter;
        }
        return false;
    }

This new filter is for the devices that send ignition all the time.

thanks