1 /*
2 * Copyright (C) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "hci/hci.h"
17
18 #include "btstack.h"
19
20 #include "hci_cmd.h"
21
22 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
23 // 7.4.1 Read Local Version Information Command
HCI_ReadLocalVersionInformation()24 int HCI_ReadLocalVersionInformation()
25 {
26 HciCmd *cmd = HciAllocCmd(HCI_READ_LOCAL_VERSION_INFORMATION, NULL, 0);
27 return HciSendCmd(cmd);
28 }
29
30 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
31 // 7.4.2 Read Local Supported Commands Command
HCI_ReadLocalSupportedCommands()32 int HCI_ReadLocalSupportedCommands()
33 {
34 HciCmd *cmd = HciAllocCmd(HCI_READ_LOCAL_SUPPORTED_COMMANDS, NULL, 0);
35 return HciSendCmd(cmd);
36 }
37
38 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
39 // 7.4.3 Read Local Supported Features Command
HCI_ReadLocalSupportedFeatures()40 int HCI_ReadLocalSupportedFeatures()
41 {
42 HciCmd *cmd = HciAllocCmd(HCI_READ_LOCAL_SUPPORTED_FEATURES, NULL, 0);
43 return HciSendCmd(cmd);
44 }
45
46 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
47 // 7.4.4 Read Local Extended Features Command
HCI_ReadLocalExtendedFeatures(const HciReadLocalExtendedFeaturesParam * param)48 int HCI_ReadLocalExtendedFeatures(const HciReadLocalExtendedFeaturesParam *param)
49 {
50 HciCmd *cmd =
51 HciAllocCmd(HCI_READ_LOCAL_EXTENDED_FEATURES, (void *)param, sizeof(HciReadLocalExtendedFeaturesParam));
52 return HciSendCmd(cmd);
53 }
54
55 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
56 // 7.4.5 Read Buffer Size Command
HCI_ReadBufferSize()57 int HCI_ReadBufferSize()
58 {
59 HciCmd *cmd = HciAllocCmd(HCI_READ_BUFFER_SIZE, NULL, 0);
60 return HciSendCmd(cmd);
61 }
62
63 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
64 // 7.4.6 Read BD_ADDR Command
HCI_ReadBdAddr()65 int HCI_ReadBdAddr()
66 {
67 HciCmd *cmd = HciAllocCmd(HCI_READ_BD_ADDR, NULL, 0);
68 return HciSendCmd(cmd);
69 }
70
71 // BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E
72 // 7.4.8 Read Local Supported Codecs Command
HCI_ReadLocalSupportedCodecs()73 int HCI_ReadLocalSupportedCodecs()
74 {
75 HciCmd *cmd = HciAllocCmd(HCI_READ_LOCAL_SUPPORTED_CODECS, NULL, 0);
76 return HciSendCmd(cmd);
77 }