19762338dSopenharmony_ci/* 29762338dSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 39762338dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 49762338dSopenharmony_ci * you may not use this file except in compliance with the License. 59762338dSopenharmony_ci * You may obtain a copy of the License at 69762338dSopenharmony_ci * 79762338dSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 89762338dSopenharmony_ci * 99762338dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 109762338dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 119762338dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 129762338dSopenharmony_ci * See the License for the specific language governing permissions and 139762338dSopenharmony_ci * limitations under the License. 149762338dSopenharmony_ci */ 159762338dSopenharmony_ci 169762338dSopenharmony_ci#include "bluetooth_hci_callback_impl.h" 179762338dSopenharmony_ci#include "bluetooth_hci.h" 189762338dSopenharmony_cinamespace OHOS { 199762338dSopenharmony_cinamespace HDI { 209762338dSopenharmony_cinamespace Bluetooth { 219762338dSopenharmony_cinamespace Hci { 229762338dSopenharmony_cinamespace V1_0 { 239762338dSopenharmony_ciint32_t HciCallbackImpl::OnInited(BtStatus status) 249762338dSopenharmony_ci{ 259762338dSopenharmony_ci BtInitStatus initStatus = BtInitStatus::SUCCESS; 269762338dSopenharmony_ci if (status != BtStatus::SUCCESS) { 279762338dSopenharmony_ci initStatus = BtInitStatus::INITIALIZATION_ERROR; 289762338dSopenharmony_ci } 299762338dSopenharmony_ci return 0; 309762338dSopenharmony_ci} 319762338dSopenharmony_ci 329762338dSopenharmony_ciint32_t HciCallbackImpl::OnReceivedHciPacket(BtType type, const std::vector<uint8_t> &data) 339762338dSopenharmony_ci{ 349762338dSopenharmony_ci BtPacketType packetType = BtPacketType::PACKET_TYPE_UNKNOWN; 359762338dSopenharmony_ci switch (type) { 369762338dSopenharmony_ci case BtType::HCI_EVENT: 379762338dSopenharmony_ci packetType = BtPacketType::PACKET_TYPE_EVENT; 389762338dSopenharmony_ci break; 399762338dSopenharmony_ci case BtType::ACL_DATA: 409762338dSopenharmony_ci packetType = BtPacketType::PACKET_TYPE_ACL; 419762338dSopenharmony_ci break; 429762338dSopenharmony_ci case BtType::SCO_DATA: 439762338dSopenharmony_ci packetType = BtPacketType::PACKET_TYPE_SCO; 449762338dSopenharmony_ci break; 459762338dSopenharmony_ci default: 469762338dSopenharmony_ci break; 479762338dSopenharmony_ci } 489762338dSopenharmony_ci return 0; 499762338dSopenharmony_ci} 509762338dSopenharmony_ci 519762338dSopenharmony_ci} // V1_0 529762338dSopenharmony_ci} // Hci 539762338dSopenharmony_ci} // Bluetooth 549762338dSopenharmony_ci} // HDI 559762338dSopenharmony_ci} // OHOS 569762338dSopenharmony_ci 57