hsp_ag.h (efda0b48f920fa795cb4c2d0cf0c4acf184fb858) hsp_ag.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 Audio Gateway (AG) events.
59 *
60 * The HSP AG 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 Audio Gateway (AG) events.
59 *
60 * The HSP AG 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_MICROPHONE_GAIN_CHANGED
64 * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED
65 * - HSP_SUBEVENT_HS_COMMAND
66 *
67 * @param event See include/btstack/hci_cmds.h
68 * @param event_size

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

86
87/**
88 * @brief Register packet handler to receive HSP AG events.
89 * @param callback
90 */
91void hsp_ag_register_packet_handler(hsp_ag_callback_t callback);
92
93/**
63 * - HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
64 * - HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE
65 * - HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED
66 * - HSP_SUBEVENT_SPEAKER_GAIN_CHANGED
67 * - HSP_SUBEVENT_HS_COMMAND
68 *
69 * @param event See include/btstack/hci_cmds.h
70 * @param event_size

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

88
89/**
90 * @brief Register packet handler to receive HSP AG events.
91 * @param callback
92 */
93void hsp_ag_register_packet_handler(hsp_ag_callback_t callback);
94
95/**
94 * @brief Connect to HSP Headset
96 * @brief Connect to HSP Headset.
95 *
96 * Perform SDP query for an RFCOMM service on a remote device,
97 *
98 * Perform SDP query for an RFCOMM service on a remote device,
97 * and establish an RFCOMM connection if such service is found. The reception of the
98 * HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE or
99 * HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE event
100 * indicate if the connection is successfully established or not.
99 * and establish an RFCOMM connection if such service is found. Reception of the
100 * HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE with status 0
101 * indicates if the connection is successfully established.
101 *
102 * @param bd_addr
103 */
104void hsp_ag_connect(bd_addr_t bd_addr);
105
106/**
102 *
103 * @param bd_addr
104 */
105void hsp_ag_connect(bd_addr_t bd_addr);
106
107/**
107 * @brief Disconnect from HSP Headset.
108 * @brief Disconnect from HSP Headset
108 *
109 *
109 * Releases the RFCOMM channel.
110 * Reception of the HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE with status 0
111 * indicates if the connection is successfully released.
110 * @param bd_addr
111 */
112void hsp_ag_disconnect(void);
113
112 * @param bd_addr
113 */
114void hsp_ag_disconnect(void);
115
116
114/**
117/**
118 * @brief Establish audio connection.
119 *
120 * Reception of the HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE with status 0
121 * indicates if the audio connection is successfully established.
122 * @param bd_addr
123 */
124void hsp_ag_establish_audio_connection(void);
125
126/**
127 * @brief Release audio connection.
128 *
129 * Reception of the HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE with status 0
130 * indicates if the connection is successfully released.
131 * @param bd_addr
132 */
133void hsp_ag_release_audio_connection(void);
134
135/**
115 * @brief Set microphone gain.
116 * @param gain Valid range: [0,15]
117 */
118void hsp_ag_set_microphone_gain(uint8_t gain);
119
120/**
121 * @brief Set speaker gain.
122 * @param gain Valid range: [0,15]

--- 38 unchanged lines hidden ---
136 * @brief Set microphone gain.
137 * @param gain Valid range: [0,15]
138 */
139void hsp_ag_set_microphone_gain(uint8_t gain);
140
141/**
142 * @brief Set speaker gain.
143 * @param gain Valid range: [0,15]

--- 38 unchanged lines hidden ---