Moxa TC-6110-LX [74/74] The temperature sensor control script

Moxa TC-6110-W7E [74/74] The temperature sensor control script
TC-6110 / Windows 7 Sample Code for TC-6110 Customization
B-7
The Temperature Sensor Control Script
// TempSensor.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>
#include <WTypes.h>
#include "devices.h"
int _tmain(int argc, _TCHAR* argv[])
{
double dCPUTemp, dSATA1Temp, dSATA2Temp;
BOOL bRet = FALSE;
/* Open the sensor object */
mxsensor_open();
/* Get the SATA1 temperature */
bRet = mxsensor_get_sata1_temp(&dSATA1Temp);
if(bRet !=FALSE)
{
printf("Disk1 Temperaure = %.2f\n", dSATA1Temp);
}
else
{
printf("Disk1 Temperaure = N/A\n");
}
/* Get the SATA2 temperature */
bRet = mxsensor_get_sata2_temp(&dSATA2Temp);
if(bRet !=FALSE)
{
printf("Disk2 Temperaure = %.2f\n", dSATA2Temp);
}
else
{
printf("Disk2 Temperaure = N/A\n");
}
/* Close the sensor object */
mxsensor_close();
return 0;
}

Содержание

Похожие устройства

Скачать