greatscottgadgets / ubertooth

Software, firmware, and hardware designs for Ubertooth
https://greatscottgadgets.com/ubertoothone/
GNU General Public License v2.0
1.92k stars 430 forks source link

Ubertooth follow doesn't set the clock correctly #373

Closed cathyz64 closed 3 years ago

cathyz64 commented 5 years ago

In ubertooth-follow, it uses hci_read_clock_offset to get the hopping pattern of the slave device. However, the offset is right shifted by 2 so it shouldn't be clock += offset, it should be clock += offset<<2. But there is another problem, because usleep(10000) is called before that clock value is sent to the ubertooth. It would be better to create a connection to the ubertooth prior to reading the clock offset and then send clock + offset<<2 + delay immediately to the ubertooth. You can then delay and close out the connection. I have tested this method and it works perfectly for getting the correct slave clock and thus the correct hopping pattern.

grvvy commented 5 years ago

Feel free to open a pull request with this change!

mikeryan commented 3 years ago

I second the request for a pull request @cathyz64

cathyz64 commented 3 years ago

I believe I made the pull request last summer. I think it went through with a few build errors that may need to be resolved on the gsg side of things. https://github.com/greatscottgadgets/ubertooth/pull/374

mikeryan commented 3 years ago

Thanks, I missed that one. I will review the PR before our next release.