Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

HJ720IT pedometer daily data #10

Merged
merged 7 commits into from Jun 16, 2011
Merged

HJ720IT pedometer daily data #10

merged 7 commits into from Jun 16, 2011

Conversation

smw1218
Copy link

@smw1218 smw1218 commented Jan 22, 2011

Hi,

I managed to add the code for the daily data. I changed the struct a bit because the time is actually just for aerobic steps, not daily total. I figure this shouldn't break anyone since the data wasn't filled in anyway (and you're pre 1.0 anyway ;)

I have the device and I tested in in Mac OS 10.6 and it seems to be working. I will test Linux as well later tonight. I will probably also push some test code later as well. This is my first pull request so I hope this is right. If you need any other help with the pedometer code, I'm happy to help.

Thanks,
Scott White

Scott White added 7 commits January 21, 2011 17:37
…ts since the daily count may not be what we think it is

when the clear data command is sent, it looks like the hourly data pointer is correctly reset but the daily data is not.
In addition, when iterating through to the end of the daily data count after a delete seems to provide bad data at some
point in the past.  I will continue more testing to see if i can figure out the behavior.
@smw1218
Copy link
Author

smw1218 commented Jun 15, 2011

My branch has fixes for numerous pedometer bugs with the format, includes all the data read by the windows client and includes a delete flag. I've now been using it exclusively for months and the data appears to be 100% correct. I still occasionally get a hang in some of the lower level IO code on Mac OS. Killing the csv read and trying again almost always works the second time. I tried adding a sleep which seems to help, but not completely eliminate this issue. I think when reads happen too fast there are data errors and the internal state machine gets out of sync with the code's expectations.

Sample Process says things like:

Call graph:
862 Thread_331974 DispatchQueue_1: com.apple.main-thread (serial)
862 start
862 main
862 omron_get_device_version
862 omron_dev_info_command
862 omron_exchange_cmd
862 omron_check_mode
862 omron_send_clear
862 omron_read_data
862 libusb_bulk_transfer
862 do_sync_bulk_transfer
862 libusb_handle_events
862 libusb_handle_events_timeout
862 handle_events
862 poll

Call graph:
2612 Thread_591409 DispatchQueue_1: com.apple.main-thread (serial)
2612 start
2612 main
2612 omron_get_pd_hourly_data
2612 omron_exchange_cmd
2612 omron_get_command_return
2612 omron_read_data
2612 libusb_bulk_transfer
2612 do_sync_bulk_transfer
2612 libusb_handle_events
2612 libusb_handle_events_timeout
2612 handle_events
2612 poll
2612 Thread_591412
2612 thread_start
2612 _pthread_start
2612 event_thread_main
2612 CFRunLoopRun
2612 CFRunLoopRunSpecific
2612 __CFRunLoopRun
2612 mach_msg
2612 mach_msg_trap
2612 Thread_591413 DispatchQueue_2: com.apple.libdispatch-manager (serial)
2612 start_wqthread
2612 _pthread_wqthread
2612 _dispatch_worker_thread2
2612 _dispatch_queue_invoke
2612 _dispatch_mgr_invoke
2612 kevent

Call graph:
2600 Thread_196532 DispatchQueue_1: com.apple.main-thread (serial)
2600 start
2600 main
2600 omron_get_device_version
2600 omron_dev_info_command
2600 omron_exchange_cmd
2600 omron_check_mode
2600 omron_send_clear
2600 omron_read_data
2600 libusb_bulk_transfer
2600 do_sync_bulk_transfer
2600 libusb_handle_events
2600 libusb_handle_events_timeout
2600 handle_events
2600 poll
2600 Thread_196537
2600 thread_start
2600 _pthread_start
2600 event_thread_main
2600 CFRunLoopRun
2600 CFRunLoopRunSpecific
2600 __CFRunLoopRun
2600 mach_msg
2600 mach_msg_trap
2600 Thread_196538 DispatchQueue_2: com.apple.libdispatch-manager (serial)
2600 start_wqthread
2600 _pthread_wqthread
2600 _dispatch_worker_thread2
2600 _dispatch_queue_invoke
2600 _dispatch_mgr_invoke
2600 kevent

qdot added a commit that referenced this pull request Jun 16, 2011
HJ720IT pedometer daily data
@qdot qdot merged commit 3002bc9 into openyou:master Jun 16, 2011
@qdot
Copy link
Member

qdot commented Jun 16, 2011

All merged. May have to go in and fix the unistd thing in the CSV util, since that'll kill windows compatibility, but for now, eh. Thanks for much for the additions, I'll add you to the credits and all. :)

@smw1218
Copy link
Author

smw1218 commented Jun 16, 2011

Thanks! I had fun hacking on it and I'm very appreciative of your reverse engineering effort.

I can get rid of the unistd stuff, i suppose i can parse a single "-d" without using getopt ;) i didn't even think about the windows compatibility.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants