//---------------------------------------------------------------------------

#include <stdlib.h>
#include <stdio.h>
#pragma hdrstop

//#include "../../core/api.h"
#include "ktapi.h"

//---------------------------------------------------------------------------

int main(int argc, char* argv[])
{
char * Name;
char * OS_String;

_pHWM_Item HM_Items;
_API_ * BIN_KT_API;


	if (KT_API_Open(sfInternal))
	{
		Get_KT_API(&BIN_KT_API);
		printf("KTAPI Verion %d.%03d.%d.%d",BIN_KT_API->VersionMajor,BIN_KT_API->VersionMinor,BIN_KT_API->Build,BIN_KT_API->Type);
		
		Name="N/A";
		GetBoardName(&Name);
		printf(" - %s",Name);

		
		OS_String="N/A";
		KT_API_Get_OS_String(&OS_String);
		printf(" (%s)\n",OS_String);		
		
		printf("\n");
	
		if (ReadHWMonitorItems(&HM_Items))
		{             
			while(HM_Items->ID!=_HWM_Last)
			{            
				
				switch(HM_Items->ID & _HWM_Type_Mask)
				{
				case _HWM_Type_Voltage:  
					printf("%-10s: %8.3f V\n",HM_Items->Name,HM_Items->Value);
					break;
				case _HWM_Type_Temperature:
					printf("%-10s: %8.1f C\n",HM_Items->Name,HM_Items->Value);
					break;
				case _HWM_Type_Fan:
					printf("%-10s: %8.0f RPM\n",HM_Items->Name,HM_Items->Value);
					break;
				default:
					printf("%-10s: %8.3f\n",HM_Items->Name,HM_Items->Value);
					break;
					
				}
				HM_Items++;
				
			}
		}
		KT_API_Close();
	}

	return 0;
}
//---------------------------------------------------------------------------
