openyou / libfitbit

Library for accessing and transfering data from the Fitbit health device
http://www.openyou.org
BSD 3-Clause "New" or "Revised" License
422 stars 66 forks source link

libfitbit should put tracker to sleep after sync #20

Closed bensmithurst closed 11 years ago

bensmithurst commented 12 years ago

From reading the logs on windows it appears that the windows client sends a final command at the end to put the tracker to sleep for the 15 minute sync interval. This change appears to have the desired effect of making libfitbit do the same.

qdot commented 12 years ago

Huh. I could've sworn I had that in there.

One thing: It actually takes a variable, which I think is a multiple of 5 minutes?

bensmithurst commented 12 years ago

I wasn't completely sure about that.. I wondered if that's what the 0x3c was, but that would make it a multiple of 15 seconds. Pretty sure what's what I saw in the windows logs anyway. I guess ideally it should parse the sleep time from the last HTTP response?

qdot commented 12 years ago

Wow, ok, I've flaked on the protocol, was reading the command byte as the parameter. Obviously been a while since I've been in the library. :)

Anyways, we can probably accept it as is for now, though we may want to make sleeping a opt-in parameter somehow (yes I realize there's not really a command line interface yet :( ) since having the tracker sleep for 15 minutes while developing would be annoying.

benallard commented 12 years ago

Just jumping in ...

You can just plug it in if you want to force the sync. So the sleeping is not that annoying ...

qdot commented 11 years ago

Brought in basic feature with #45