This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RF communication method in BLE Keyboard example

Hi.

I am using SDK15.0.0.
I tested the RF communication through the ESB example.
And I have tested the BLE communication using the ble_app_hids_keyboard example.
I want to combine the two codes to create a keyboard that can be both BLE and RF communication.
(For example, press and hold button 1 to send to BLE, press button 2 to transmit to RF)

static void keys_send (uint8_t key_pattern_len, uint8_t * p_key_pattern)
Can you add nrf_esb_write_payload (& p_key_pattern); in the above function?

Do you have a guide?

In the keyboard example, the data format is [modifier, reserved, Key1, Key2, Key3, Key4, Key6, Key7].
Is it possible to input 8 keys simultaneously in RF communication? (I only sent 5 bytes when sending keyboard values RF communication. [ReportID, modifier, key1, key2, key3])

Thank you.

Have a nice day.

rdsf
Parents Reply Children
  • Hi

    No, you can't just merge the proprietary RF examples with the BLE examples.

    The proprietary RF examples assume they have exclusive access to the radio, and so does the BLE SoftDevice. If you try to merge them directly you will get problems when both the proprietary protocol and the SoftDevice try to access the radio directly. 

    To make proprietary protocols work during BLE activity you have to schedule all the radio activity through time slots, using the timeslot API of the SoftDevice. 

    This is a lot more complicated, and only allows the proprietary RF protocol access to the radio when the SoftDevice doesn't need it.

    For this reason it would be much easier to simply use BLE in both cases, whether you are talking to the dongle or talking directly to a PC or mobile device. 

    Best regards
    Torbjørn

Related