• So ideally I think the way this should work is that there is a configurable service widget and client Apps that provide the UI and presentation.

    There is an assumption in the GPSrecorder that you wil get a fix every second and you just count down the number of fixes and record the nth fix. This will no longer be true when using the gpsservice set for an update period of say 120s.

    Also I think the logging needs to be configurable, eg min_distance_before_log so that you have to move so many meters before you log a new point, otherwise you will end up with 26 points when you stop to look at the map for a couple of minutes. When logging a 10k mountain walk you really only want about 50-100 points at most, maybe 100m apart. The min time to wait before logging a next point also needs to be set and then log whatever comes first.

    Definitely agree duplicate code all over the place is not a good idea and dont want to make things worse. I will have to read the code for the openstreetmap library to understand how it works.

    I was thinking of using the same file format so that I could add logging and then use the GPSrecorder app to plot my logs.

    You say its possibe for 2 widegts to coexist ? Is this really true if both are setting up the GPS config differently ? Is it possible to have 2 widgets registered as callbacks for Bangle.on('GPS',onxxx) ?

    Thinking about this I have realised there are still a few issues with gpsservice that I need to address. 1) there needs to be a gps_set_settings(settings_object) so that any App can pass in a configuration. I am not sure yet if that would write the settings back to storage OR if calling that should cause the GPS to power on if the settings were changes to ON (i think better to keep turning on/off as seperate call). 2) the gps_power_off() needs to set everything back to SuperE power management (ie default) so that the next app that uses the GPS is not using an unexpected configuration. I will work on fixes for these issues next.

About

Avatar for HughB @HughB started