• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 "bluetooth_hci_callback_impl.h"
17 #include "bluetooth_hci.h"
18 namespace OHOS {
19 namespace HDI {
20 namespace Bluetooth {
21 namespace Hci {
22 namespace V1_0 {
OnInited(BtStatus status)23 int32_t HciCallbackImpl::OnInited(BtStatus status)
24 {
25         BtInitStatus initStatus = BtInitStatus::SUCCESS;
26         if (status != BtStatus::SUCCESS) {
27             initStatus = BtInitStatus::INITIALIZATION_ERROR;
28         }
29     return 0;
30 }
31 
OnReceivedHciPacket(BtType type,const std::vector<uint8_t> & data)32 int32_t HciCallbackImpl::OnReceivedHciPacket(BtType type, const std::vector<uint8_t> &data)
33 {
34         BtPacketType packetType = BtPacketType::PACKET_TYPE_UNKNOWN;
35         switch (type) {
36             case BtType::HCI_EVENT:
37                 packetType = BtPacketType::PACKET_TYPE_EVENT;
38                 break;
39             case BtType::ACL_DATA:
40                 packetType = BtPacketType::PACKET_TYPE_ACL;
41                 break;
42             case BtType::SCO_DATA:
43                 packetType = BtPacketType::PACKET_TYPE_SCO;
44                 break;
45             default:
46                 break;
47         }
48         return 0;
49 }
50 
51 } // V1_0
52 } // Hci
53 } // Bluetooth
54 } // HDI
55 } // OHOS
56 
57