lichengzhang | b93f786 | 2025-06-06 17:44:35 +0800 | [diff] [blame^] | 1 | #include <stdio.h>
|
| 2 | #include <string.h>
|
| 3 | #include <strings.h>
|
| 4 | #include <stdlib.h>
|
| 5 | #include <errno.h>
|
| 6 | #include <fcntl.h>
|
| 7 | #include <signal.h>
|
| 8 | #include <sys/types.h>
|
| 9 | #include <unistd.h>
|
| 10 | #include <pthread.h>
|
| 11 | #include <termios.h>
|
| 12 | #include <time.h>
|
| 13 | #include <sys/ioctl.h>
|
| 14 | #include <dlfcn.h>
|
| 15 | #include <stdint.h>
|
| 16 | #include <stdbool.h>
|
| 17 |
|
| 18 | typedef enum{
|
| 19 | soc_max=0,
|
| 20 | cpu0,
|
| 21 | cpu1,
|
| 22 | cpu2,
|
| 23 | cpu3,
|
| 24 | gpu0,
|
| 25 | gpu1,
|
| 26 | dramc,
|
| 27 | mmsys,
|
| 28 | md_5g,
|
| 29 | md_4g,
|
| 30 | md_3g,
|
| 31 | soc_dram_ntc,
|
| 32 | pa_5g,
|
| 33 | pa_4g,
|
| 34 | rf_ntc,
|
| 35 | pmic,
|
| 36 | pmic_vcore,
|
| 37 | pmic_vpro,
|
| 38 | pmic_vgpu=19,
|
| 39 | }ZONE_NUM;
|
| 40 |
|
| 41 | int (*gsw_get_modem_temperture)(ZONE_NUM,int *temp);
|
| 42 | void *dlHandle_pm;
|
| 43 | char *lynqLib_pm = "/lib/libgsw_lib.so";
|
| 44 | int main(void)
|
| 45 | {
|
| 46 | int ret;
|
| 47 | int opt = 0;
|
| 48 | int temp;
|
| 49 | dlHandle_pm = dlopen(lynqLib_pm, RTLD_NOW);
|
| 50 | gsw_get_modem_temperture=(int32_t(*)())dlsym(dlHandle_pm, "gsw_get_modem_temperture");
|
| 51 | ret = gsw_get_modem_temperture(0,&temp);
|
| 52 | if(ret < 0)
|
| 53 | {
|
| 54 | printf("gsw_autosleep_enable FAIL.\n");
|
| 55 | return -1;
|
| 56 | }
|
| 57 | printf("gsw_autosleep_enable success.temp : %d\n",temp);
|
| 58 | dlclose(dlHandle_pm);
|
| 59 | return 0;
|
| 60 | } |