1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 5 #ifndef AMP_UTILS_H 6 #define AMP_UTILS_H 7 8 #if defined(__cplusplus) 9 extern "C" { 10 #endif 11 12 #define AOS_VERSION_LENGTH 32 13 typedef struct { 14 char userjs[AOS_VERSION_LENGTH]; 15 char app[AOS_VERSION_LENGTH]; 16 char kernel[AOS_VERSION_LENGTH]; 17 char system[AOS_VERSION_LENGTH * 2]; 18 char module_hardware[AOS_VERSION_LENGTH]; 19 char product_hardware[AOS_VERSION_LENGTH]; 20 char build_time[AOS_VERSION_LENGTH]; 21 } AOS_SYSTEM_VERSION; 22 23 unsigned char hex2num(unsigned char ch); 24 char itoch(int val); 25 void num2hex(unsigned char ch, unsigned char *hex); 26 int end_with(char *str1, char *str2); 27 void amp_dump(const char *title, const void *buff, const int len); 28 void aos_userjs_version_set(char *version); 29 const char *aos_userjs_version_get(void); 30 const char *aos_app_version_get(void); 31 const char *aos_system_version_get(void); 32 const char *aos_system_info_get(void); 33 const char *aos_kernel_version_get(void); 34 const char *aos_system_build_time(void); 35 const char *aos_hardware_version_get(void); 36 37 #ifdef SUPPORT_NODE_MODELES 38 char *getFilePath(char *name); 39 char *getClearPath(char *path); 40 char *getNodeModulePath(char *path); 41 #endif 42 43 #if defined(__cplusplus) 44 } 45 #endif 46 47 #endif /* JSE_UTILS_H */ 48