This project can be used as a starting point for developing a nRF51 series mouse or keyboard using Gazell for communicating with a legacy nRF24LU1 USB dongle. It can communicate "out of the box" with the Dongle reference design and the nRFreadySimplePairing.exe application, that can be found in the nRFready Desktop v1.2.3.
This project sends mouse movement packets to the USB dongle when pin 1 is low (button connected to pin 1 pressed) and sends the 'a' keyboard character to the USB dongle when pin 2 goes from high to low (button connected to pin 2 pressed).
static void read_mouse_and_send |
( |
void |
| ) |
|
|
static |
Checks to see whether the mouse sensor has data to send. If so, adds this to the (unencrypted) Gazell TX FIFO on pipe NRFR_MOUSE_EP.
static void read_keyboard_and_send |
( |
void |
| ) |
|
|
static |
Checks to see whether the mouse sensor has data and send unencrypted.
If so, adds this to the (unencrypted) Gazell TX FIFO on pipe NRFR_MOUSE_EP. Checks to see whether the keyboard has data and send encrypted.
If the Device does net yet have the system address it will try to obtain it. After obtaining the system address it will attempt to obtain the Host ID. The keyboard data is discarded if pairing is not successful. It may take a few attempts to obtain the Host ID as this may not be yet generated at the Host.
Send a Host ID request and process the response.
If the request was rejected or failed (i.e. timed out), system_addr_received will be reset and the pairing process will begin on the next keypress.
If the request was received, subsequent keyboard data will be transmitted on an encrypted link.
If teh request is still pending, nothing is done. Further keypresses will initiate another
- Returns
- The result of the Host ID request.
- Returns
- ANSI required int return type.