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 SOFTBUS_BUS_CENTER_MOCK_H 17 #define SOFTBUS_BUS_CENTER_MOCK_H 18 19 #include <cstdint> 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 constexpr uint32_t MOCK_NETWORK_ID_BUF_LEN = 65; 25 constexpr uint32_t MOCK_DEVICE_NAME_BUF_LEN = 65; 26 constexpr uint32_t UUID_BUF_LEN = 65; 27 /** 28 * @brief Defines the basic information about a device. 29 * @since 1.0 30 * @version 1.0 31 */ 32 typedef struct { 33 char networkId[MOCK_NETWORK_ID_BUF_LEN]; 34 char deviceName[MOCK_DEVICE_NAME_BUF_LEN]; 35 uint16_t deviceTypeId; 36 } NodeBasicInfo; 37 38 typedef enum { 39 NODE_KEY_UDID = 0, /**< UDID in string format*/ 40 NODE_KEY_UUID, /**< UUID in string format */ 41 NODE_KEY_MASTER_UDID, /**< UDID of master node in string format */ 42 NODE_KEY_BR_MAC, /**< BR MAC in string format */ 43 NODE_KEY_IP_ADDRESS, /**< IP address in string format */ 44 NODE_KEY_DEV_NAME, /**< Device name in string format */ 45 NODE_KEY_NETWORK_CAPABILITY, /**< Network capability in number format */ 46 NODE_KEY_NETWORK_TYPE, /**< Network type in number format */ 47 NODE_KEY_BLE_OFFLINE_CODE, /**< Ble offlinecode in string format */ 48 NODE_KEY_DATA_CHANGE_FLAG, 49 } NodeDeviceInfoKey; 50 51 int32_t GetLocalNodeDeviceInfo(const char *pkgName, NodeBasicInfo *info); 52 int32_t GetNodeKeyInfo(const char *pkgName, const char *networkId, 53 NodeDeviceInfoKey key, uint8_t *info, int32_t infoLen); 54 #ifdef __cplusplus 55 } 56 #endif 57 #endif // SOFTBUS_BUS_CENTER_MOCK_H