Reorg FitBitResponse.__init__

Move member initialization before loop to try opening device.  If device
does not exist, exit() instead of returning (which would subsequently
try to use the conneciton and reach an ugly death.)
Add framing to protocol layer, remove protocol info from libusb.py

Add a _recieve_message() method to protocol.py (and an internal _find_sync()
method).  The _receive_message() method is a match for _send_message().  It
pulls in packets using libusb's _reeive() method, then locates the SYNC
char to establish framing, breaks input into packets and verifies the checksum,
manages timeouts, and performs logging.

Removed the data_received method, since it was slightly weird call to an
upper layer from libusb (and only called if debug was enabled, despite the
fact that it performed some checksum and packet verification).

libusb interfaces using a byte array (based on the underlying usb core),
but the protocol layer now consistently uses int lists to interface (so
now hexList takes an int list instead of a char array.)

Finally, changed most calls to _receive() into calls to _receive_message(),
except for _check_burst_response (which I need to study more) and
FitBitANT.init() which is derived from libusb, not protocol.
Convert _check_burst_response() to use _receive_message().
Close the fitbit channel if an exception occurs so we can re-open it later

In run_upload_request(), if an exception occurs, we catch it, close the
fitbit channel, and re-raise the exception.  This makes sure that
run_upload_request() always closes the device.  Since main() now waits
15 minutes and re-tries, this ensures that the re-try will be able to open
the device.
Limit all loops to a maximun number of retries.

Ensure that all of the loops eventually terminate.  This guarantees that the
program will not get stuck looping for some condition that will never happen.
Limit all loops to a maximum number of retries.

Ensure that all of the loops eventually terminate.  This guarantees that the
program will not get stuck looping for some condition that will never happen.
Merge branch 'master' of github.com:marcushall42/libfitbit
Add debug output to mark what is going on in the protocol.  Also, allow retries
of run_opcode.
Merge pull request #18 from marcushall42/master

Create protocol::_recieve_message() with protocol level operations above libusb
Loop limit for receiving bursts was too low.  Allow for at least ~500 bytes,
which works out to 62 messages.  Double that to be safe (this is a sanity check
after all), and make it a nice round 128 messages.
For opcodes with 0x42 return value, where we retrieve data_bank information,
the first message should have a 0x70 "command", while subsequent messages
should have "0x60" for the command.  This seems to be related to getting
more detailed informaiton from the tracker.  I noticed this through careful
reading of the fitbit software logs, and it appears to be getting the full
info now.

Also, after sending a payload, or after returning 0x41, pass the received
response back as the result instead of synthesizing a dummy response.  I
don't know if this really makes any difference, but it seems more "honest"
with the fitbit website.
When a sync fails, re-try immediately.  Only sleep 15 minutes after a
successful sync.  This mimic's fitbit's software behavior.
Wait for ~5 minutes for a beacon (each _receive_message call takes ~4 seconds
to timeout, *75 = 300 seconds == 5 minutes).  This mimics the fitbit behavior
and hopefully is more successful at catching a tracker.  Not sure if it
really makes much difference, since we will re-try again right away if we
don't see the tracker.
Merge pull request #22 from marcushall42/master

Change download data bank to get detailed data & sleep markers
Initial attempt at trying different bases in fitbit_client
make list of base classes an attribute of FitBitClient class
don't try other bases if we got one
slightly more logical ordering of base check if statement
Merge pull request #24 from jsnyder/try_multiple_bases

Try multiple bases in fitbit_client
Comment typo unixtime is since 1970, not 1980