ryanbinns / ttwatch

Linux TomTom GPS Watch Utilities
MIT License
205 stars 66 forks source link

Added a new feature "--get-summaries" to retrieve Summary Activity Tracker information #153

Closed derickr closed 5 years ago

derickr commented 5 years ago

This new flag "--get-summaries" fetches the Summary Activity Tracker information from the watch. These summaries are stored in the files 0x00b3xxxx. These files use Google's protobuffer format, and hence need to be parsed by a prototobuf library. The one that is used here is available as a package on Debian and Ubuntu. Parts of the format were discovered by @scubajorgen, with some of my additions.

The summaries information can be exported as CSV file too, by using --get-summaries --set-formats=csv. I am not intending to write a tool akin to ttbincnv at this moment.

This feature can be extended to also parse 0x00b1xxxx files, but that is a future step.

I can imagine that I will at least need to add documentation for this feature, but wanted to throw it our here so that you can see whether this is something you'd like to accept.

ryanbinns commented 5 years ago

Thanks for the pull request. Unfortunately, one of my latest commits has adding some conflicts that need resolving - I fixed some of the code around where you've extracted creating the directory name in do_get_activities_callback. It shouldn't be too hard to add them into your code.

derickr commented 5 years ago

I'll have a look later and see if I can merge them.

I've been using this "in production" for a few weeks now, and I haven't run into any problems either.

derickr commented 5 years ago

I think I've rebased and merged this correctly. I haven't managed to run this yet, as I currently don't have my cable with me.

derickr commented 5 years ago

Hi @ryanbinns — would you like me to make other changes to this Pull Request?

ryanbinns commented 5 years ago

No, it's fine. I just merged it. Sorry it's taken so long; I lost track of it. Thanks for all the effort!

ryanbinns commented 5 years ago

I've had problems getting this to compile. It errors out with

/workspace/ttwatch/include/export.h:12:22: fatal error: protobuf.h: No such file or directory

Is this file a system include, or is it one that should be checked in, but was missed?

derickr commented 5 years ago

I had forgotten to add it before committing. I'd just added it.

ryanbinns commented 5 years ago

No worries. I just pulled it from your branch and it all works now. Thanks!