dotstack API Reference
1.10.37
|
Functions | |
bt_bool | bt_hid_init (void) |
Initialize HID layer. More... | |
bt_bool | bt_hid_listen (bt_hid_session_p session, bt_hid_state_callback_fp callback, bt_hid_get_report_callback_fp get_report_callback, bt_hid_set_report_callback_fp set_report_callback) |
Listen for incoming connections. More... | |
bt_bool | bt_hid_connect (bt_hid_session_p session, bt_bdaddr_t *remote_addr, bt_hid_state_callback_fp callback, bt_hid_get_report_callback_fp get_report_callback, bt_hid_set_report_callback_fp set_report_callback) |
Connect to a remote device. More... | |
bt_bool | bt_hid_disconnect (bt_hid_session_p session) |
Close connection. More... | |
void | bt_hid_unplug (bt_hid_session_p session) |
Unplug device. More... | |
bt_hid_session_p | bt_hid_allocate_session (bt_l2cap_mgr_t *l2cap_mgr, void *callback_param) |
Allocate HID session. More... | |
void | bt_hid_free_session (bt_hid_session_p session) |
Release HID session. More... | |
bt_bool | bt_hid_add_report (bt_hid_session_p session, bt_hid_report_t *report) |
Add report definition to local HID device. More... | |
bt_bool | bt_hid_send_report (bt_hid_session_p session, bt_byte channel, bt_byte report_type, bt_byte report_id, bt_bool send_report_id, bt_byte *data, bt_int len, bt_byte tran_type, bt_hid_send_report_callback_fp callback) |
Send report. More... | |
bt_bool bt_hid_add_report | ( | bt_hid_session_p | session, |
bt_hid_report_t * | report | ||
) |
Add report definition to local HID device.
This function add a report definitions to the specified HID session.
session | The HID session which a report definition to be added to. |
report | The report definition to be added. |
TRUE
if the function succeeds. FALSE
otherwise. bt_hid_session_p bt_hid_allocate_session | ( | bt_l2cap_mgr_t * | l2cap_mgr, |
void * | callback_param | ||
) |
Allocate HID session.
This function allocates a new HID session.
l2cap_mgr | The L2CAP manager on which the HID session is to be created. |
NULL
otherwise. bt_bool bt_hid_connect | ( | bt_hid_session_p | session, |
bt_bdaddr_t * | remote_addr, | ||
bt_hid_state_callback_fp | callback, | ||
bt_hid_get_report_callback_fp | get_report_callback, | ||
bt_hid_set_report_callback_fp | set_report_callback | ||
) |
Connect to a remote device.
This function establishes a HID connection with a remote device. Changes in the session state are reported through a callback function.
session | HID session. |
remote_addr | Address of the remote device. |
callback | The callback function that is called when session state changes. |
get_report_callback | The callback function that is called when a remote device requests an INPUT report. |
set_report_callback | The callback function that is called when a remote device sends and OUTPUT report. |
TRUE
if the function succeeds. FALSE
otherwise. The callback function is not called in this case. bt_bool bt_hid_disconnect | ( | bt_hid_session_p | session | ) |
Close connection.
This function closes a HID connection with a remote device. Changes in the session state are reported through a callback function set when connection was created by calling bt_hid_connect.
session | HID session. |
void bt_hid_free_session | ( | bt_hid_session_p | session | ) |
Release HID session.
This function deallocated the specified HID session. This function does not disconnect the session. It just frees the memory used by the bt_hid_session structure. The session has to be disconnected by calling bt_hid_disconnect or bt_hid_unplug first.
session | The HID session to be deallocated. |
bt_bool bt_hid_init | ( | void | ) |
Initialize HID layer.
This function initializes the HID layer of the stack. It must be called prior to any other HID function can be called.
bt_bool bt_hid_listen | ( | bt_hid_session_p | session, |
bt_hid_state_callback_fp | callback, | ||
bt_hid_get_report_callback_fp | get_report_callback, | ||
bt_hid_set_report_callback_fp | set_report_callback | ||
) |
Listen for incoming connections.
This function enables incoming connections on the specified HID session. Changes in the session state are reported through a callback function.
session | HID session. |
callback | The callback function that is called when session state changes. |
get_report_callback | The callback function that is called when a remote device requests an INPUT report. |
set_report_callback | The callback function that is called when a remote device sends and OUTPUT report. |
TRUE
if the function succeeds. FALSE
otherwise. The callback function is not called in this case. bt_bool bt_hid_send_report | ( | bt_hid_session_p | session, |
bt_byte | channel, | ||
bt_byte | report_type, | ||
bt_byte | report_id, | ||
bt_bool | send_report_id, | ||
bt_byte * | data, | ||
bt_int | len, | ||
bt_byte | tran_type, | ||
bt_hid_send_report_callback_fp | callback | ||
) |
Send report.
This function sends a report to a remote device
session | The HID session. |
channel | The type of the channel (CONTROL or INTERRUPT) used to send the report. |
report_type | The type of the report (INPUT, OUTPUR, or FEATURE). |
report_id | The id of the report. |
send_report_id | The flag that specifies weather the report id is included in the data packet. |
data | The pointer to the report data. |
len | The length of the report data. |
tran_type | The type of the transaction (see definition of the HID_TRANTYPE constants). |
callback | The callback function that is called when sending the report has been completed. |
TRUE
if the function succeeds. FALSE
otherwise. The callback function is not called in this case. void bt_hid_unplug | ( | bt_hid_session_p | session | ) |
Unplug device.
This function unplugs a virtually-cabled device Changes in the session state are reported through a callback function set when connection was created by calling bt_hid_connect.
session | HID session. |