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
  • Hi Kim

    It is technically possible to combine BLE and ESB, but it is quite complicated, and we don't have any updated examples for it. 

    It requires you to use the timeslot API of the SoftDevice to get access to the radio in between BLE events, and run the ESB protocol during these timeslots. 

    May I ask what kind of device you plan to use for the ESB receiver?

    Is there any reason you couldn't simply use BLE for both these links, so you don't have to combine ESB and BLE into one?

    It should be possible to send 8 keys at the time, yes. When using HID you can set up the HID descriptor to support more keys than standard. 

    Best regards
    Torbjørn

  • Thank you for your reply.

    The RF receiver will use the nRF52840.

    Can BLE and ESB be combined into one?
    Depending on whether the RF receiver is connected or not, is it possible to handle communication according to BLE and ESB?

    It is better to be able to combine into one.

    Thank you.

    Best Regards,

    powerup

  • Hi 

    Can't you just run BLE in the nRF52840 RF receiver also?

    Then you don't have to switch between ESB and BLE when the receiver is removed or added. 

    Best regards
    Torbjørn

  • Thank you for your reply.

    I want to use BLE communication with a PC or mobile device without a receiver.

    Simply integrating RF examples and BLE examples does not work?

    Thank you.

  • 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

Reply
  • 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

Children
No Data
Related