Developer World
Spresense SDK Library v3.2.0-ebc0364
bt_a2dp.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/bluetooth/bt_a2dp.h
3 *
4 * Copyright 2018 Sony Semiconductor Solutions Corporation
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17 * the names of its contributors may be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ****************************************************************************/
35
43#ifndef __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_H
44#define __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_H
45
46/****************************************************************************
47 * Included Files
48 ****************************************************************************/
49
50#include <stdint.h>
51#include <bluetooth/bluetooth.h>
53#include <bluetooth/bt_common.h>
54
55/****************************************************************************
56 * Private Data
57 ****************************************************************************/
58
64{
65 void (*command_status)(BT_CMD_STATUS status);
66 void (*connect)(struct bt_acl_state_s *bt_acl_state, BT_AUDIO_CODEC_INFO codecInfo);
67 void (*disconnect)(struct bt_acl_state_s *bt_acl_state);
68 void (*receive_media_pkt)(struct bt_acl_state_s *bt_acl_state, uint8_t *data, int len);
69};
70
76{
78 uint16_t bt_a2dp_handle;
82};
83
84/****************************************************************************
85 * Public Function Prototypes
86 ****************************************************************************/
87
95
105int bt_a2dp_connect(struct bt_acl_state_s *bt_acl_state);
106
116int bt_a2dp_disconnect(struct bt_acl_state_s *bt_acl_state);
117
128int bt_a2dp_set_codec_capability(BT_AUDIO_CODEC_INFO *codec_capabilities, uint8_t num);
129
139
140#endif /* __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_H */
Bluetooth common header for SDK on Spresense.
BT_CMD_STATUS
BT hci command status.
Definition: bluetooth.h:189
int bt_a2dp_connect(struct bt_acl_state_s *bt_acl_state)
Bluetooth A2DP connect Connect to peer device with A2DP.
int bt_a2dp_disconnect(struct bt_acl_state_s *bt_acl_state)
Bluetooth A2DP disconnect Disconnect to peer device with A2DP.
int bt_a2dp_set_codec_capability(BT_AUDIO_CODEC_INFO *codec_capabilities, uint8_t num)
Bluetooth A2DP set codec capability Set capability of audio codecs.
bool bt_a2dp_is_supported(void)
Get A2DP support or not support.
int bt_a2dp_register_callback(struct bt_a2dp_ops_s *bt_a2dp_ops)
Register A2DP event packet callback.
Bluetooth A2DP common header for SDK on Spresense.
Bluetooth generic API.
BT_CONNECT_STATUS
BT profile connection status.
Definition: bt_common.h:124
Codec information element structure, used to provide info of a single type of codec.
Definition: bt_a2dp_codecs.h:195
Bluetooth A2DP application callbacks.
Definition: bt_a2dp.h:64
void(* disconnect)(struct bt_acl_state_s *bt_acl_state)
Definition: bt_a2dp.h:67
void(* command_status)(BT_CMD_STATUS status)
Definition: bt_a2dp.h:65
void(* connect)(struct bt_acl_state_s *bt_acl_state, BT_AUDIO_CODEC_INFO codecInfo)
Definition: bt_a2dp.h:66
void(* receive_media_pkt)(struct bt_acl_state_s *bt_acl_state, uint8_t *data, int len)
Definition: bt_a2dp.h:68
Bluetooth A2DP context.
Definition: bt_a2dp.h:76
struct bt_acl_state_s * bt_acl_state
Definition: bt_a2dp.h:79
struct bt_hal_a2dp_ops_s * bt_hal_a2dp_ops
Definition: bt_a2dp.h:80
BT_CONNECT_STATUS bt_a2dp_connection
Definition: bt_a2dp.h:77
struct bt_a2dp_ops_s * bt_a2dp_ops
Definition: bt_a2dp.h:81
uint16_t bt_a2dp_handle
Definition: bt_a2dp.h:78
Bluetooth ACL context.
Definition: bt_common.h:152
Bluetooth A2DP HAL callbacks.
Definition: bt_if.h:91