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

How to send arbitrary data using on_hid_rep_char_write()?

Hi,

I'm able to send arbitrary information to the host using generic HID descriptor (uses vendor defined page). There is no driver issue. I'm also able to connect to the bluetooth of host. But I'm not able to receive data from host. How do I change on_hid_rep_char_write() in order to receive data? 

In HID keyboard example, the OUTPUT_REPORT_BIT_MASK_CAPS_LOCK uses the default value in HID table. What if it was an arbitrary value? So instead of caps lock should I keep polling for a value from host (open source HID API) and then may be light an led? 

Please to not divert me to HID keyboard & mouse examples! I need some concrete advise/help beyond those examples.

Parents
  • Hello,

    I know you say you don't want to be diverted to the HID keyboard example, but I will either way, unfortunately.

    If I understand you correctly, and please correct me if I don't, you want to be able to receive other inputs than caps lock on or off, right?

    Well, if you send a command from the device you are connected to, they to should end up as an event in on_hid_rep_char_write(ble_hids_evt_t * p_evt)

    You just need to check your report__val, to check if there is any other data than 0x02 (caps lock on).

    What sort of message are you sending to the nRF, and do you get this event when you send it?

    Best regards,

    Edvin

Reply
  • Hello,

    I know you say you don't want to be diverted to the HID keyboard example, but I will either way, unfortunately.

    If I understand you correctly, and please correct me if I don't, you want to be able to receive other inputs than caps lock on or off, right?

    Well, if you send a command from the device you are connected to, they to should end up as an event in on_hid_rep_char_write(ble_hids_evt_t * p_evt)

    You just need to check your report__val, to check if there is any other data than 0x02 (caps lock on).

    What sort of message are you sending to the nRF, and do you get this event when you send it?

    Best regards,

    Edvin

Children
Related