Developer World
Spresense SDK Library v3.3.0-375c679
bt_avrcp.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/bluetooth/bt_avrcp.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_AVRCP_H
44#define __MODULES_INCLUDE_BLUETOOTH_BT_AVRCP_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 * Pre-processor Definitions
57 ****************************************************************************/
58
59/****************************************************************************
60 * Public Types
61 ****************************************************************************/
62
67typedef enum
68{
72
77typedef struct avrcTrackInfo {
79 uint8_t attrId;
80 uint16_t attrLen;
81 uint8_t attrValue[48];
83
89{
91 void (*trackChange)(BT_AVRC_TRACK_INFO *trackInfo);
92 void (*trackReachedEnd)(uint8_t *pdata, int len);
93 void (*trackReachedStart)(uint8_t *pdata, int len);
94 void (*playPosChanged)(uint8_t *pdata, int len);
95 void (*batteryStatusChange)(uint8_t *pdata, int len);
96 void (*systemStatusChange)(uint8_t *pdata, int len);
97 void (*appSettingChange)(uint8_t *pdata, int len);
98 void (*nowPlayingChange)(uint8_t *pdata, int len);
99 void (*avalPlayerChange)(uint8_t *pdata, int len);
100 void (*addrPlayChange)(uint8_t *pdata, int len);
101 void (*uidsChange)(uint8_t *pdata, int len);
102 void (*volumeChange)(uint8_t *pdata, int len);
103};
104
110{
112 void (*connect)(struct bt_acl_state_s *bt_acl_state, BT_AVRCP_ROLE role);
113 void (*disconnect)(struct bt_acl_state_s *bt_acl_state, BT_AVRCP_ROLE role);
114};
115
121{
130};
131
132/****************************************************************************
133 * Public Function Prototypes
134 ****************************************************************************/
135
143
153int bt_avrcp_connect(struct bt_acl_state_s *bt_acl_state);
154
164int bt_avrcp_disconnect(struct bt_acl_state_s *bt_acl_state);
165
177int bt_avrcp_send_command(struct bt_acl_state_s *bt_acl_state, BT_AVRCP_CMD_ID cmd_id, bool press);
178
188int bt_register_notification(struct bt_avrcp_notify_ops_s *bt_avrcp_notify_ops);
189
199int bt_avrcp_register_cb(struct bt_avrcp_ops_s *bt_avrcp_ops);
200
201#endif /* __MODULES_INCLUDE_BLUETOOTH_BT_AVRCP_H */
Bluetooth common header for SDK on Spresense.
BT_CMD_STATUS
BT hci command status.
Definition: bluetooth.h:189
int bt_avrcp_send_command(struct bt_acl_state_s *bt_acl_state, BT_AVRCP_CMD_ID cmd_id, bool press)
Bluetooth send AVRCP command Send command to target device.
int bt_avrcp_disconnect(struct bt_acl_state_s *bt_acl_state)
Bluetooth AVRCP disconnect Disconnect to peer device with AVRCP.
int bt_register_notification(struct bt_avrcp_notify_ops_s *bt_avrcp_notify_ops)
Bluetooth AVRCP Register notification Set callback about AVRCP notification.
BT_AVRCP_ROLE
AVRCP role.
Definition: bt_avrcp.h:68
@ BT_AVRCP_CONTROLLER
Definition: bt_avrcp.h:69
@ BT_AVRCP_TARGET
Definition: bt_avrcp.h:70
int bt_avrcp_register_cb(struct bt_avrcp_ops_s *bt_avrcp_ops)
Bluetooth AVRCP Register connection status callback Set callback about AVRCP connection.
int bt_avrcp_connect(struct bt_acl_state_s *bt_acl_state)
Bluetooth AVRCP connect Connect to peer device with AVRCP.
bool bt_avrcp_is_supported(void)
Get AVRCP support or not support.
AVRCP command I/F.
BT_AVRCP_CMD_ID
AVRCP command list.
Definition: bt_avrcp_cmds.h:64
Bluetooth generic API.
BT_CONNECT_STATUS
BT profile connection status.
Definition: bt_common.h:135
BT address types.
Definition: bluetooth.h:171
BT avrc track info type.
Definition: bt_avrcp.h:77
uint8_t attrId
Definition: bt_avrcp.h:79
BT_ADDR addr
Definition: bt_avrcp.h:78
uint16_t attrLen
Definition: bt_avrcp.h:80
uint8_t attrValue[48]
Definition: bt_avrcp.h:81
Bluetooth ACL context.
Definition: bt_common.h:164
Bluetooth AVRCP application callbacks.
Definition: bt_avrcp.h:89
void(* avalPlayerChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:99
void(* trackReachedEnd)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:92
void(* addrPlayChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:100
void(* trackChange)(BT_AVRC_TRACK_INFO *trackInfo)
Definition: bt_avrcp.h:91
void(* trackReachedStart)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:93
void(* nowPlayingChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:98
void(* playStatusChange)(BT_AVRC_TRACK_INFO *trackInfo)
Definition: bt_avrcp.h:90
void(* appSettingChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:97
void(* systemStatusChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:96
void(* playPosChanged)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:94
void(* volumeChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:102
void(* batteryStatusChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:95
void(* uidsChange)(uint8_t *pdata, int len)
Definition: bt_avrcp.h:101
Bluetooth AVRCP application callbacks.
Definition: bt_avrcp.h:110
void(* disconnect)(struct bt_acl_state_s *bt_acl_state, BT_AVRCP_ROLE role)
Definition: bt_avrcp.h:113
void(* command_status)(BT_CMD_STATUS status)
Definition: bt_avrcp.h:111
void(* connect)(struct bt_acl_state_s *bt_acl_state, BT_AVRCP_ROLE role)
Definition: bt_avrcp.h:112
Bluetooth AVRCP context.
Definition: bt_avrcp.h:121
struct bt_acl_state_s * bt_acl_state
Definition: bt_avrcp.h:126
BT_CONNECT_STATUS bt_avrct_connection
Definition: bt_avrcp.h:123
uint16_t bt_avrct_handle
Definition: bt_avrcp.h:125
uint16_t bt_avrcc_handle
Definition: bt_avrcp.h:124
struct bt_hal_avrcp_ops_s * bt_hal_avrcp_ops
Definition: bt_avrcp.h:127
struct bt_avrcp_ops_s * bt_avrcp_ops
Definition: bt_avrcp.h:128
struct bt_avrcp_notify_ops_s * bt_avrcp_notify_ops
Definition: bt_avrcp.h:129
BT_CONNECT_STATUS bt_avrcc_connection
Definition: bt_avrcp.h:122
Bluetooth AVRCP HAL callbacks.
Definition: bt_if.h:103