1 /*
2  * Copyright (c) 2021-2024 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_IDISTRIBUTED_HARDWARE_H
17 #define OHOS_IDISTRIBUTED_HARDWARE_H
18 
19 #include <cstdint>
20 #include <string>
21 #include <unordered_map>
22 
23 #include "iremote_broker.h"
24 #include "device_type.h"
25 
26 #include "distributed_hardware_fwk_kit_paras.h"
27 #include "iav_trans_control_center_callback.h"
28 #include "ipublisher_listener.h"
29 
30 namespace OHOS {
31 namespace DistributedHardware {
32 class IDistributedHardware : public OHOS::IRemoteBroker {
33 public:
34     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.distributedhardware.accessToken");
35     IDistributedHardware() = default;
36     virtual ~IDistributedHardware() = default;
37     virtual int32_t RegisterPublisherListener(const DHTopic topic, const sptr<IPublisherListener> listener) = 0;
38     virtual int32_t UnregisterPublisherListener(const DHTopic topic, const sptr<IPublisherListener> listener) = 0;
39     virtual int32_t PublishMessage(const DHTopic topic, const std::string &msg) = 0;
40     virtual std::string QueryLocalSysSpec(QueryLocalSysSpecType spec) = 0;
41 
42     virtual int32_t InitializeAVCenter(const TransRole &transRole, int32_t &engineId) = 0;
43     virtual int32_t ReleaseAVCenter(int32_t engineId) = 0;
44     virtual int32_t CreateControlChannel(int32_t engineId, const std::string &peerDevId) = 0;
45     virtual int32_t NotifyAVCenter(int32_t engineId, const AVTransEvent &event) = 0;
46     virtual int32_t RegisterCtlCenterCallback(int32_t engineId,
47         const sptr<IAVTransControlCenterCallback> callback) = 0;
48     virtual int32_t NotifySourceRemoteSinkStarted(std::string &deviceId) = 0;
49     virtual int32_t PauseDistributedHardware(DHType dhType, const std::string &networkId) = 0;
50     virtual int32_t ResumeDistributedHardware(DHType dhType, const std::string &networkId) = 0;
51     virtual int32_t StopDistributedHardware(DHType dhType, const std::string &networkId) = 0;
52 };
53 } // namespace DistributedHardware
54 } // namespace OHOS
55 #endif // OHOS_IDISTRIBUTED_HARDWARE_H
56