emgo icon indicating copy to clipboard operation
emgo copied to clipboard

Does nrf5 ble support hid?

Open dzhou121 opened this issue 7 years ago • 3 comments

dzhou121 avatar Apr 16 '18 15:04 dzhou121

There is no ready to use BLE package in Emgo.

ziutek avatar Apr 16 '18 16:04 ziutek

Is it easy to add? And I can help if you could give me a bit of guidance.

dzhou121 avatar Apr 17 '18 03:04 dzhou121

No, it isn't easy... at least for me.

The problem isn't higher layers but lowest layer: BLE controller.

You need to read:

  1. Bluetooth Core Specification (at least 4.0): https://www.bluetooth.com/specifications/bluetooth-core-specification/archived-specifications

  2. nRF51822 (preferably also nRF52832) Reference Manual: http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.1.pdf

The problem insist in strict timing. You have to design a state machine that properly handles all cases and you need to write it cleanly in Go. You need a deep understanding of the protocol and hardware. Debuging is difficult, especially if your only tool is Android phone with its HCI logging.

There are open source implementations in: MyNewt and Zephyr. The last one has some support from Nordic: https://devzone.nordicsemi.com/b/blog/posts/nrf5x-support-within-the-zephyr-project-rtos

I didn't studied their code but it's probably worth doing.

There is my proof of concept code in nrf5/blec and an example that almost works. But everything must be be thought over and rewritten.

ziutek avatar Apr 17 '18 08:04 ziutek