Developer World
Spresense SDK Library v3.2.0-ebc0364
bt_hfp.h
Go to the documentation of this file.
1/****************************************************************************
2 * modules/include/bluetooth/bt_hfp.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_HFP_H
44#define __MODULES_INCLUDE_BLUETOOTH_BT_HFP_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 * Public Types
57 ****************************************************************************/
58
64{
65 void (*command_status)(BT_CMD_STATUS status);
66 void (*connect)(struct bt_acl_state_s *bt_acl_state, BT_PROFILE_TYPE btProfileType);
67 void (*disconnect)(struct bt_acl_state_s *bt_acl_state);
68 void (*audio_connect)(struct bt_acl_state_s *bt_acl_state);
69 void (*audio_disconnect)(struct bt_acl_state_s *bt_acl_state);
70 void (*ag_feature)(struct bt_acl_state_s *bt_acl_state, BT_HFP_AG_FEATURE_FLAG feature);
71 void (*hf_at_response)(struct bt_acl_state_s *bt_acl_state, char *at_resp);
72};
73
79{
82 uint16_t bt_hfp_handle;
88};
89
90/****************************************************************************
91 * Public Function Prototypes
92 ****************************************************************************/
93
101
111int bt_hfp_connect(struct bt_acl_state_s *bt_acl_state);
112
122int bt_hfp_disconnect(struct bt_acl_state_s *bt_acl_state);
123
133int bt_hfp_audio_connect(struct bt_acl_state_s *bt_acl_state);
134
144int bt_hfp_audio_disconnect(struct bt_acl_state_s *bt_acl_state);
145
156int bt_hfp_send_at_command(struct bt_acl_state_s *bt_acl_state, char *at_cmd_str);
157
166int bt_hfp_press_button(struct bt_acl_state_s *bt_acl_state);
167
177
187int bt_hfp_register_cb(struct bt_hfp_ops_s *bt_hfp_ops);
188
189#endif /* __MODULES_INCLUDE_BLUETOOTH_BT_HFP_H */
Bluetooth common header for SDK on Spresense.
BT_CMD_STATUS
BT hci command status.
Definition: bluetooth.h:189
Bluetooth generic API.
BT_CONNECT_STATUS
BT profile connection status.
Definition: bt_common.h:124
int bt_hfp_disconnect(struct bt_acl_state_s *bt_acl_state)
Bluetooth HFP disconnect Disconnect to peer device with HFP.
int bt_hfp_set_feature(BT_HFP_HF_FEATURE_FLAG flag)
Bluetooth set feature Set feature.
int bt_hfp_audio_connect(struct bt_acl_state_s *bt_acl_state)
Bluetooth HFP Audio connect Connect to peer device with HFP Audio.
bool bt_hfp_is_supported(void)
Get HFP support or not support.
int bt_hfp_press_button(struct bt_acl_state_s *bt_acl_state)
Bluetooth press button Press button.
int bt_hfp_send_at_command(struct bt_acl_state_s *bt_acl_state, char *at_cmd_str)
Bluetooth send HFP command Send HFP command.
int bt_hfp_audio_disconnect(struct bt_acl_state_s *bt_acl_state)
Bluetooth HFP Audio disconnect Disconnect to peer device with HFP Audio.
int bt_hfp_register_cb(struct bt_hfp_ops_s *bt_hfp_ops)
Bluetooth HFP Register callbacks Set callback about HFP.
int bt_hfp_connect(struct bt_acl_state_s *bt_acl_state)
Bluetooth HFP connect Connect to peer device with HFP.
Bluetooth HFP common header for SDK on Spresense.
BT_PROFILE_TYPE
BT HFP profile type.
Definition: bt_hfp_features.h:65
BT_HFP_HF_FEATURE_FLAG
HFP HF device supported feature flags.
Definition: bt_hfp_features.h:75
BT_HFP_AG_FEATURE_FLAG
HFP AG device supported feature flags.
Definition: bt_hfp_features.h:94
Bluetooth ACL context.
Definition: bt_common.h:152
Bluetooth HFP HAL callbacks.
Definition: bt_if.h:115
Bluetooth HFP application callbacks.
Definition: bt_hfp.h:64
void(* disconnect)(struct bt_acl_state_s *bt_acl_state)
Definition: bt_hfp.h:67
void(* hf_at_response)(struct bt_acl_state_s *bt_acl_state, char *at_resp)
Definition: bt_hfp.h:71
void(* command_status)(BT_CMD_STATUS status)
Definition: bt_hfp.h:65
void(* audio_connect)(struct bt_acl_state_s *bt_acl_state)
Definition: bt_hfp.h:68
void(* audio_disconnect)(struct bt_acl_state_s *bt_acl_state)
Definition: bt_hfp.h:69
void(* connect)(struct bt_acl_state_s *bt_acl_state, BT_PROFILE_TYPE btProfileType)
Definition: bt_hfp.h:66
void(* ag_feature)(struct bt_acl_state_s *bt_acl_state, BT_HFP_AG_FEATURE_FLAG feature)
Definition: bt_hfp.h:70
Bluetooth HFP context.
Definition: bt_hfp.h:79
struct bt_acl_state_s * bt_acl_state
Definition: bt_hfp.h:84
BT_CONNECT_STATUS bt_hfp_audio_connection
Definition: bt_hfp.h:81
BT_HFP_HF_FEATURE_FLAG bt_hfp_supported_feature
Definition: bt_hfp.h:87
BT_CONNECT_STATUS bt_hfp_connection
Definition: bt_hfp.h:80
struct bt_hal_hfp_ops_s * bt_hal_hfp_ops
Definition: bt_hfp.h:85
uint16_t bt_hfp_audio_handle
Definition: bt_hfp.h:83
uint16_t bt_hfp_handle
Definition: bt_hfp.h:82
struct bt_hfp_ops_s * bt_hfp_ops
Definition: bt_hfp.h:86