1/*
2 * Copyright (c) 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#ifndef OHOS_HDI_BLUETOOTH_HCI_V1_0_HCIINTERFACESTUB_H
17#define OHOS_HDI_BLUETOOTH_HCI_V1_0_HCIINTERFACESTUB_H
18
19#include <ipc_object_stub.h>
20#include <message_option.h>
21#include <message_parcel.h>
22#include <object_collector.h>
23#include <refbase.h>
24#include "v1_0/ihci_interface.h"
25
26namespace OHOS {
27namespace HDI {
28namespace Bluetooth {
29namespace Hci {
30namespace V1_0 {
31
32using namespace OHOS;
33class HciInterfaceStub : public IPCObjectStub {
34public:
35    explicit HciInterfaceStub(const sptr<IHciInterface> &impl);
36    virtual ~HciInterfaceStub();
37
38    int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
39
40    static int32_t HciInterfaceStubInit_(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption, sptr<OHOS::HDI::Bluetooth::Hci::V1_0::IHciInterface> impl);
41
42    static int32_t HciInterfaceStubSendHciPacket_(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption, sptr<OHOS::HDI::Bluetooth::Hci::V1_0::IHciInterface> impl);
43
44    static int32_t HciInterfaceStubClose_(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption, sptr<OHOS::HDI::Bluetooth::Hci::V1_0::IHciInterface> impl);
45
46    static int32_t HciInterfaceStubGetVersion_(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption, sptr<OHOS::HDI::Bluetooth::Hci::V1_0::IHciInterface> impl);
47
48private:
49    int32_t HciInterfaceStubInit(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption);
50
51    int32_t HciInterfaceStubSendHciPacket(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption);
52
53    int32_t HciInterfaceStubClose(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption);
54
55    int32_t HciInterfaceStubGetVersion(MessageParcel& hciInterfaceData, MessageParcel& hciInterfaceReply, MessageOption& hciInterfaceOption);
56
57
58    static inline ObjectDelegator<OHOS::HDI::Bluetooth::Hci::V1_0::HciInterfaceStub, OHOS::HDI::Bluetooth::Hci::V1_0::IHciInterface> objDelegator_;
59    sptr<OHOS::HDI::Bluetooth::Hci::V1_0::IHciInterface> impl_;
60};
61} // V1_0
62} // Hci
63} // Bluetooth
64} // HDI
65} // OHOS
66
67#endif // OHOS_HDI_BLUETOOTH_HCI_V1_0_HCIINTERFACESTUB_H
68
69