• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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_DEVICE_MANAGER_H
17 #define OHOS_DEVICE_MANAGER_H
18 
19 #include "device_manager_callback.h"
20 #include "dm_device_info.h"
21 #include "dm_publish_info.h"
22 #include "dm_subscribe_info.h"
23 #include <map>
24 #include <memory>
25 #include <string>
26 #include <vector>
27 
28 namespace OHOS {
29 
30 namespace DistributedHardware {
31 class DeviceManager {
32 public:
33     static DeviceManager &GetInstance();
34 
35     virtual int32_t InitDeviceManager(const std::string &pkgName, std::shared_ptr<DmInitCallback> dmInitCallback);
36 
37     virtual int32_t UnInitDeviceManager(const std::string &pkgName);
38 
39     virtual int32_t GetTrustedDeviceList(
40         const std::string &pkgName, const std::string &extra, std::vector<DmDeviceInfo> &deviceList);
41 
42     virtual int32_t GetTrustedDeviceList(
43         const std::string &pkgName, const std::string &extra, bool isRefresh, std::vector<DmDeviceInfo> &deviceList);
44 
45     virtual int32_t GetAvailableDeviceList(const std::string &pkgName, std::vector<DmDeviceBasicInfo> &deviceList);
46 
47     virtual int32_t GetLocalDeviceInfo(const std::string &pkgName, DmDeviceInfo &deviceInfo);
48 
49     virtual int32_t RegisterDevStateCallback(
50         const std::string &pkgName, const std::string &extra, std::shared_ptr<DeviceStateCallback> callback);
51 
52     virtual int32_t RegisterDevStatusCallback(
53         const std::string &pkgName, const std::string &extra, std::shared_ptr<DeviceStatusCallback> callback);
54 
55     virtual int32_t GetUuidByNetworkId(const std::string &pkgName, const std::string &netWorkId, std::string &uuid);
56 
57     virtual int32_t GetEncryptedUuidByNetworkId(
58         const std::string &pkgName, const std::string &networkId, std::string &uuid);
59 
60 private:
61     int32_t testDemo = 0;
62     DeviceManager() = default;
63     virtual ~DeviceManager() = default;
64 };
65 } // namespace DistributedHardware
66 } // namespace OHOS
67 #endif // DEVICE_MANAGER_H