1 /* 2 * Copyright (c) 2020 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 HKS_HARDWARE_API_H 17 #define HKS_HARDWARE_API_H 18 19 #include <stdint.h> 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /* 26 * get hardware UDID(Unique Device Identifier) 27 * 28 * udid: UDID(Unique Device Identifier) 29 * udid_len: The length of UDID 30 * return == 0 write ok, return < 0 other error 31 */ 32 typedef int32_t (*hks_get_hardware_udid_callback)(uint8_t *udid, 33 uint32_t udid_len); 34 35 /* 36 * Register callback for get hardware UDID(Unique Device Identifier) 37 * 38 * callbacks: The callback functions for get hardware UDID 39 * return 0 ok, other error 40 */ 41 #ifndef HKS_API_PUBLIC 42 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) 43 #ifdef HKS_DLL_EXPORT 44 __declspec(dllexport) int32_t hks_register_get_hardware_udid_callback( 45 hks_get_hardware_udid_callback callback); 46 #else 47 __declspec(dllimport) int32_t hks_register_get_hardware_udid_callback( 48 hks_get_hardware_udid_callback callback); 49 #endif 50 #else 51 __attribute__((visibility("default"))) int32_t hks_register_get_hardware_udid_callback( 52 hks_get_hardware_udid_callback callback); 53 #endif 54 #else 55 __attribute__((visibility("default"))) int32_t hks_register_get_hardware_udid_callback( 56 hks_get_hardware_udid_callback callback); 57 #endif 58 59 #ifdef __cplusplus 60 } 61 #endif 62 63 #endif /* HKS_HARDWARE_API_H */ 64