KDK_REAL_GET_CPU_TEMPERATURE(3)

NAME
kdk_real_get_cpu_temperature - 获取CPU温度

SYNOPSIS
#include <libkyrealtimeinfo.h>

extern double kdk_real_get_cpu_temperature();

Link with -lkyrealtime.

Detailed Description
The main function of the interface is to obtain the CPU temperature.

RETURN VALUE
On success, returns the CPU temperature of type double.

On error, return -1.

EXAMPLES
    #include "stdio.h"
    #include "libkyrealtimeinfo.h"
    int main()
    {
        // if(argc < 3)
        // {
        //     printf("./kyrealtime-test <网卡名> <磁盘名>);
        //     return 0;
        // }
        printf("netSpeed : %f, kdk_real_get_net_speed("enaftgm1i0"));
        printf("cpuTemp: %f, kdk_real_get_cpu_temperature());
        printf("diskTemp : %d, kdk_real_get_disk_temperature("/dev/nvme0n1"));
        printf("diskRate : %d, kdk_real_get_disk_rate("/dev/nvme0n1"));
        printf("ifnetSpeed : %f, kdk_real_get_if_speed("enaftgm1i0"));
        return 0;
    }

CONFORMING TO
These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_real_get_net_speed(), kdk_real_get_disk_temperature(), kdk_real_get_disk_rate() and kdk_real_get_if_speed().

SEE ALSO
kdk_real_get_net_speed(3), kdk_real_get_disk_temperature(3), kdk_real_get_disk_rate(3) and kdk_real_get_if_speed(3).