1 /* 2 * Copyright (c) 2025 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 /** 17 * @addtogroup DeviceManager 18 * @{ 19 * 20 * @brief Provides APIs to obtain information about trusted devices and local devices. 21 * 22 * @since 20 23 */ 24 25 /** 26 * @file oh_device_manager.h 27 * 28 * @brief Provides APIs of the DeviceManager module. 29 * 30 * @kit DistributedServiceKit 31 * @library libdevicemanager_ndk.so 32 * @syscap SystemCapability.DistributedHardware.DeviceManager 33 * 34 * @since 20 35 */ 36 37 #ifndef OH_DEVICE_MANAGER_H 38 #define OH_DEVICE_MANAGER_H 39 40 #include <stdint.h> 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * @brief Get local device name. 48 * 49 * @param localDeviceName This is an output parameter. It indicates the address pointer of the localDeviceName. 50 * You need to manually release space resources after using. 51 * @param len This is an output parameter. Length of the localDeviceName. 52 * @return Returns the status code of the execution. For detail, see {@link DeviceManager_ErrorCode}. 53 * Returns {@link ERR_OK}, The operation is successful. 54 * Returns {@link DM_ERR_FAILED}, Failed to execute the function. 55 * Returns {@link DM_ERR_OBTAIN_SERVICE}, Failed to obtain devicemanager service. 56 * Returns {@link DM_ERR_OBTAIN_BUNDLE_NAME}, Failed to obtain the bundleName. 57 * @since 20 58 */ 59 int32_t OH_DeviceManager_GetLocalDeviceName(char **localDeviceName, unsigned int &len); 60 61 #ifdef __cplusplus 62 }; 63 #endif 64 65 /** @} */ 66 #endif