• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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_SYSTEM_IDEVICEID_H
17 #define OHOS_SYSTEM_IDEVICEID_H
18 
19 #include <iostream>
20 #include "beget_ext.h"
21 #include "iremote_broker.h"
22 #include "iremote_proxy.h"
23 
24 namespace OHOS {
25 namespace device_info {
26 class IDeviceInfo : public OHOS::IRemoteBroker {
27 public:
28     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.system.IDeviceInfo");
29 
30     virtual int32_t GetUdid(std::string& result) = 0;
31     virtual int32_t GetSerialID(std::string& result) = 0;
32 
33     static constexpr int ERR_FAIL = -1;
34 };
35 } // namespace device_info
36 } // namespace OHOS
37 
38 #ifndef DINFO_DOMAIN
39 #define DINFO_DOMAIN (BASE_DOMAIN + 8)
40 #endif
41 
42 #ifndef DINFO_TAG
43 #define DINFO_TAG "DeviceInfoKits"
44 #endif
45 
46 #define DINFO_LOGI(fmt, ...) STARTUP_LOGI(DINFO_DOMAIN, DINFO_TAG, fmt, ##__VA_ARGS__)
47 #define DINFO_LOGE(fmt, ...) STARTUP_LOGE(DINFO_DOMAIN, DINFO_TAG, fmt, ##__VA_ARGS__)
48 #define DINFO_LOGV(fmt, ...) STARTUP_LOGV(DINFO_DOMAIN, DINFO_TAG, fmt, ##__VA_ARGS__)
49 
50 #define DINFO_CHECK(ret, exper, ...) \
51     if (!(ret)) { \
52         DINFO_LOGE(__VA_ARGS__); \
53         exper; \
54     }
55 #define DINFO_ONLY_CHECK(ret, exper, ...) \
56     if (!(ret)) { \
57         exper; \
58     }
59 
60 #endif // OHOS_SYSTEM_IDEVICEID_H