rcn-ee / repos

repos.rcn-ee.com
41 stars 30 forks source link

reset Bluetooth pin before trying to enable if it was on #21

Closed imrehg closed 7 years ago

imrehg commented 7 years ago

Previous version of code misbehaves under containerized applications. In the first run of the application the Bluetooth enable pin is set, and hciattach called. On application restart (but not whole device reboot) hciattach will be killed, but the enable pin stays as it was. Then when running this code again on the start, Bluetooth enable fails and initialization times out. To prevent that to happen, if the Bluetooth enable is on, toggle it (disable then enable again) to reset the hardware.

RobertCNelson commented 7 years ago

Thanks @imrehg merged and pushed out!