hsp_hs.h (99a1006758b1c3699c20f18ef38ff35741fe6eb2) hsp_hs.h (fffdd288575b1b4b1bf0e7fec3011e209f5de43f)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 44 unchanged lines hidden (view full) ---

53#endif
54
55/* API_START */
56
57/**
58 * @brief Packet handler for HSP Headset (HS) events.
59 *
60 * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes:
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 44 unchanged lines hidden (view full) ---

53#endif
54
55/* API_START */
56
57/**
58 * @brief Packet handler for HSP Headset (HS) events.
59 *
60 * The HSP HS event has type HCI_EVENT_HSP_META with following subtypes:
61 * - HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE
62 * - HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE
61 * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
62 * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE
63 * - HSP_SUBEVENT_RING
64 * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED
65 * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED
66 * - HSP_SUBEVENT_AG_INDICATION
67 *
68 * @param event See include/btstack/hci_cmds.h

--- 21 unchanged lines hidden (view full) ---

90 * @param callback
91 */
92void hsp_hs_register_packet_handler(hsp_hs_callback_t callback);
93
94/**
95 * @brief Connect to HSP Audio Gateway.
96 *
97 * Perform SDP query for an RFCOMM service on a remote device,
63 * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
64 * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE
65 * - HSP_SUBEVENT_RING
66 * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED
67 * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED
68 * - HSP_SUBEVENT_AG_INDICATION
69 *
70 * @param event See include/btstack/hci_cmds.h

--- 21 unchanged lines hidden (view full) ---

92 * @param callback
93 */
94void hsp_hs_register_packet_handler(hsp_hs_callback_t callback);
95
96/**
97 * @brief Connect to HSP Audio Gateway.
98 *
99 * Perform SDP query for an RFCOMM service on a remote device,
98 * and establish an RFCOMM connection if such service is found. The reception of the
99 * HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE or
100 * HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE event
101 * indicate if the connection is successfully established or not.
100 * and establish an RFCOMM connection if such service is found. Reception of the
101 * HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE with status 0
102 * indicates if the connection is successfully established.
102 *
103 * @param bd_addr
104 */
105void hsp_hs_connect(bd_addr_t bd_addr);
106
107/**
108 * @brief Disconnect from HSP Audio Gateway
109 *
103 *
104 * @param bd_addr
105 */
106void hsp_hs_connect(bd_addr_t bd_addr);
107
108/**
109 * @brief Disconnect from HSP Audio Gateway
110 *
110 * Releases the RFCOMM channel.
111 * Releases the RFCOMM channel. Reception of the
112 * HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE with status 0
113 * indicates if the connection is successfully released.
111 * @param bd_addr
112 */
113void hsp_hs_disconnect(void);
114
115
116/**
117 * @brief Send button press action. Toggle establish/release of audio connection.
118 */
119void hsp_hs_send_button_press(void);
120
121/**
122 * @brief Triger establishing audio connection.
114 * @param bd_addr
115 */
116void hsp_hs_disconnect(void);
117
118
119/**
120 * @brief Send button press action. Toggle establish/release of audio connection.
121 */
122void hsp_hs_send_button_press(void);
123
124/**
125 * @brief Triger establishing audio connection.
123 *
126 *
127 * Reception of the HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE with status 0
128 * indicates if the audio connection is successfully established.
124 * @param bd_addr
125 */
126void hsp_hs_establish_audio_connection(void);
127
128/**
129 * @brief Trigger releasing audio connection.
130 *
129 * @param bd_addr
130 */
131void hsp_hs_establish_audio_connection(void);
132
133/**
134 * @brief Trigger releasing audio connection.
135 *
136 * Reception of the HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE with status 0
137 * indicates if the connection is successfully released.
131 * @param bd_addr
132 */
133void hsp_hs_release_audio_connection(void);
134
135/**
136 * @brief Set microphone gain.
137 *
138 * The new gain value will be confirmed by the HSP Audio Gateway.

--- 41 unchanged lines hidden ---
138 * @param bd_addr
139 */
140void hsp_hs_release_audio_connection(void);
141
142/**
143 * @brief Set microphone gain.
144 *
145 * The new gain value will be confirmed by the HSP Audio Gateway.

--- 41 unchanged lines hidden ---