Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches

◆ ble_hid_send_key()

int ble_hid_send_key ( ble_hid_key_t key)

#include <applications/gesture_recognition/src/ble/hid/ble_hid.h>

Send a keyboard or consumer-control key via the HID profile.

Sends a key press followed by a key release for the specified key. Standard keys (arrows, F5, ESC) are sent as keyboard reports; media keys (play/pause, volume, track, mute) are sent as consumer-control reports.

Parameters
keyKey to send, see ble_hid_key_t
Return values
0Key sent successfully.
-EBUSYDevice is currently in pairing mode; key not sent.
-ENOTCONNNo active BLE connection.
-EAGAINBLE link is up but the peer has not yet enabled HID notifications (CCCD not written); key not sent.
-EINVALUnknown or unsupported key code.
<0Other negative errno from the underlying HID service.