nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
hogp.h File Reference
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/conn.h>
#include <bluetooth/gatt_dm.h>
#include <bluetooth/services/hids.h>

Go to the source code of this file.

Data Structures

struct  bt_hogp_init_params
 HIDS client parameters for the initialization function. More...
 
struct  bt_hogp
 HOGP object. More...
 
struct  bt_hogp::bt_hogp_handlers
 

Typedefs

typedef uint8_t(* bt_hogp_read_cb) (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep, uint8_t err, const uint8_t *data)
 Callback function that is called when a notification or read response is received.
 
typedef void(* bt_hogp_write_cb) (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep, uint8_t err)
 Callback function that is called when a write response is received.
 
typedef void(* bt_hogp_ready_cb) (struct bt_hogp *hogp)
 Callback function that is called when the HIDS client is ready.
 
typedef void(* bt_hogp_prep_fail_cb) (struct bt_hogp *hogp, int err)
 Callback function that is called when an error is detected during HIDS client preparation.
 
typedef void(* bt_hogp_map_cb) (struct bt_hogp *hogp, uint8_t err, const uint8_t *data, size_t size, size_t offset)
 Callback function that is called when a chunk of a report map data is received.
 
typedef void(* bt_hogp_pm_update_cb) (struct bt_hogp *hogp)
 Callback function that is called when the protocol mode is updated.
 

Functions

void bt_hogp_init (struct bt_hogp *hogp, const struct bt_hogp_init_params *params)
 Initialize the HIDS client instance.
 
int bt_hogp_handles_assign (struct bt_gatt_dm *dm, struct bt_hogp *hogp)
 Assign handlers to the HIDS client instance.
 
void bt_hogp_release (struct bt_hogp *hogp)
 Release the HIDS client instance.
 
void bt_hogp_abort_all (struct bt_hogp *hogp)
 Abort all pending transfers.
 
bool bt_hogp_assign_check (const struct bt_hogp *hogp)
 Check if the assignment function was called.
 
bool bt_hogp_ready_check (const struct bt_hogp *hogp)
 Check if the HIDS client is ready to work.
 
int bt_hogp_rep_read (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep, bt_hogp_read_cb func)
 Send a read request addressing the report value descriptor.
 
int bt_hogp_rep_write (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep, bt_hogp_write_cb func, const void *data, uint8_t length)
 Send a write request addressing the report value descriptor.
 
int bt_hogp_rep_write_wo_rsp (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep, const void *data, uint8_t length, bt_hogp_write_cb func)
 Send a write command addressing the report value descriptor.
 
int bt_hogp_rep_subscribe (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep, bt_hogp_read_cb func)
 Subscribe to report notifications.
 
int bt_hogp_rep_unsubscribe (struct bt_hogp *hogp, struct bt_hogp_rep_info *rep)
 Remove the subscription for a selected report.
 
int bt_hogp_map_read (struct bt_hogp *hogp, bt_hogp_map_cb func, size_t offset, k_timeout_t timeout)
 Read part of the report map.
 
int bt_hogp_pm_update (struct bt_hogp *hogp, k_timeout_t timeout)
 Read the current protocol mode from the server.
 
enum bt_hids_pm bt_hogp_pm_get (const struct bt_hogp *hogp)
 Get the current protocol mode.
 
int bt_hogp_pm_write (struct bt_hogp *hogp, enum bt_hids_pm pm)
 Set the current protocol mode.
 
int bt_hogp_suspend (struct bt_hogp *hogp)
 Suspend the device.
 
int bt_hogp_exit_suspend (struct bt_hogp *hogp)
 Exit suspend and resume.
 
struct bt_conn * bt_hogp_conn (const struct bt_hogp *hogp)
 Get the connection object from the HIDS client.
 
const struct bt_hids_infobt_hogp_conn_info_val (const struct bt_hogp *hogp)
 Access the HID information value.
 
struct bt_hogp_rep_info * bt_hogp_rep_boot_kbd_in (struct bt_hogp *hogp)
 Access boot keyboard input report.
 
struct bt_hogp_rep_info * bt_hogp_rep_boot_kbd_out (struct bt_hogp *hogp)
 Access boot keyboard output report.
 
struct bt_hogp_rep_info * bt_hogp_rep_boot_mouse_in (struct bt_hogp *hogp)
 Access boot mouse input report.
 
size_t bt_hogp_rep_count (const struct bt_hogp *hogp)
 Get the number of HID reports in the device.
 
struct bt_hogp_rep_info * bt_hogp_rep_next (struct bt_hogp *hogp, const struct bt_hogp_rep_info *rep)
 Get the next report in the HOGP object.
 
struct bt_hogp_rep_info * bt_hogp_rep_find (struct bt_hogp *hogp, enum bt_hids_report_type type, uint8_t id)
 Find a report.
 
void bt_hogp_rep_user_data_set (struct bt_hogp_rep_info *rep, void *data)
 Set user data in report.
 
void * bt_hogp_rep_user_data (const struct bt_hogp_rep_info *rep)
 Get user data from report.
 
uint8_t bt_hogp_rep_id (const struct bt_hogp_rep_info *rep)
 Get report identifier.
 
enum bt_hids_report_type bt_hogp_rep_type (const struct bt_hogp_rep_info *rep)
 Get report type.
 
size_t bt_hogp_rep_size (const struct bt_hogp_rep_info *rep)
 Get report size.