#pragma once;
typedef void (*GenSignalCallbackType) (BYTE* Buf, DWORD NSamples, void* pParam);

extern "C" 
{
	DWORD PASCAL EXPORT O110_BuildFList();
	DWORD PASCAL EXPORT O110_BuildC100List();
	void PASCAL EXPORT O110_FreeFList();
	BOOL PASCAL EXPORT O110_ReconnectDevice(DWORD DN);
	BOOL PASCAL EXPORT O110_ReconnectDeviceSoft(DWORD DN);
	BOOL PASCAL EXPORT O110_AttachWiFiDevice(WCHAR* PC_IP, WCHAR* Dev_IP, DWORD* pDN);
	DWORD PASCAL EXPORT O110_AttachEthDevice(WCHAR* Dev_IP, DWORD* pDN);
	DWORD PASCAL EXPORT O110_GetLibraryVersion();

	DWORD PASCAL EXPORT O110_GetDeviceCount();
	DWORD PASCAL EXPORT O110_GetDeviceType(DWORD DN);
	DWORD PASCAL EXPORT O110_IsDeviceHighSpeed(DWORD DN);		//deprecated, always 0
	DWORD PASCAL EXPORT O110_GetDeviceVIN(DWORD DN);
	DWORD PASCAL EXPORT O110_GetDeviceRange(DWORD DN);
	double PASCAL EXPORT O110_GetData(DWORD DN, DWORD channel, DWORD type, DWORD aver, DWORD parN);
	DWORD PASCAL EXPORT O110_GetAverName(DWORD DN, DWORD Type, DWORD Aver, WCHAR* Buf, DWORD BufLen);
	DWORD PASCAL EXPORT O110_GetBandName(DWORD DN, DWORD Type, DWORD Aver, DWORD parN, WCHAR* Buf, DWORD BufLen);
	DWORD PASCAL EXPORT O110_GetChannelN(DWORD DN);
	double PASCAL EXPORT O110_GetDateTime(DWORD DN);

	DWORD PASCAL EXPORT O110_GetUnderrangeState(DWORD DN, DWORD Channel);
	DWORD PASCAL EXPORT O110_GetOverflowState(DWORD DN, DWORD Channel);

	void PASCAL EXPORT O110_SendResetCmd(DWORD DN);
	void PASCAL EXPORT O110_SendRangeCmd(DWORD DN, DWORD Range);
	void PASCAL EXPORT O110_SendPolCmd(DWORD DN, BOOL bPolOn);
	void PASCAL EXPORT O110_SendSetBandsCmd(DWORD DN, const double& Freq, int BandWidth, int* Factors);
    void PASCAL EXPORT O110_SendSetBandsCmdLF(DWORD DN, const double& Freq, int BandWidth);
	void PASCAL EXPORT O110_SendIcpModeCmd(DWORD DN, BOOL bIcp);
	void PASCAL EXPORT O110_SendZChModeCmd(DWORD DN, BOOL bRelpaceByA);
	void PASCAL EXPORT O110_SendSigRegModeCmd(DWORD DN, const double& FSmp, const double& FCut, DWORD ChMask);

	void PASCAL EXPORT O110_SendStartStopCmd(DWORD DN);
	DWORD PASCAL EXPORT O110_GetStartStopState(DWORD DN);
	DWORD PASCAL EXPORT O110_IsDeviceOnLine(DWORD DN);
	void PASCAL EXPORT O110_SendStartCmd(DWORD DN);
	void PASCAL EXPORT O110_SendStopCmd(DWORD DN);

	BOOL PASCAL EXPORT O110_SetSMode(DWORD DN, BOOL bSignal);
	void PASCAL EXPORT O110_Configure(DWORD DN, double* CBuffer, DWORD CBufLen);
	double* PASCAL EXPORT O110_GetWPtr(DWORD DN);
	double PASCAL EXPORT O110_GetFSampling(DWORD DN);	
	double PASCAL EXPORT O110_GetBaseLevel(DWORD DN, DWORD ch);

	BOOL PASCAL EXPORT TurnOnTele(int bSignal);
	int PASCAL EXPORT GetTeleType();
	void PASCAL EXPORT TurnOffTele();
	double PASCAL EXPORT GetAFast();
	BOOL PASCAL EXPORT GetSpectrum(double* r, int win);

	DWORD PASCAL EXPORT O110_OpenFile(const WCHAR* FileName);
	void PASCAL EXPORT O110_CloseFile(DWORD DN);

	DWORD PASCAL EXPORT O110_GetNumRecords(DWORD DN);
	DWORD PASCAL EXPORT O110_SetToRecord(DWORD DN, DWORD RecordN);

	void PASCAL EXPORT O110_ResetDevice(DWORD DN);
	BOOL PASCAL EXPORT O110_SelectVirtualDevice(DWORD DN, DWORD DeviceType);
	void PASCAL EXPORT O110_SendCalibrationCmd(DWORD DN, DWORD Ch, const double& Corr_dB, const double& Base, const double& Sensor);
	void PASCAL EXPORT O110_SwitchOffVirtualDevice(DWORD DN);

	DWORD PASCAL EXPORT O110_GetAverNByName(DWORD DN, WCHAR* AverName);
	DWORD PASCAL EXPORT O110_GetBandNByName(DWORD DN, DWORD Type, DWORD Aver, WCHAR* BandName);

	double PASCAL EXPORT O110_GetCorrection(DWORD DN, DWORD Ch);	
	double PASCAL EXPORT O110_GetKBase(DWORD DN, DWORD Ch);	
	double PASCAL EXPORT O110_GetSensor(DWORD DN, DWORD Ch);

	DWORD PASCAL EXPORT O110_WaitForTelePacket(DWORD DN, DWORD MaxWaitTMSec);
	void PASCAL EXPORT O110_SetDateTime(DWORD DN);

	void PASCAL EXPORT O110_RegisterCallbackForSignalSend(DWORD DN, GenSignalCallbackType pCallback, void* pParam);

    DWORD PASCAL EXPORT BK160_BuildBK160List();
    BOOL PASCAL EXPORT BK160_SetAmp(size_t DN, double amp);
    BOOL PASCAL EXPORT BK160_SetFrequency(size_t DN, double freq);
    BOOL PASCAL EXPORT BK160_SetLevel(size_t DN, double level);

	DWORD PASCAL EXPORT O110_BuildGenList();
	DWORD PASCAL EXPORT O110_GetGenCount();
	DWORD PASCAL EXPORT O110_GetGenName(DWORD DN, WCHAR* Buf, DWORD BufLen);
	BOOL PASCAL EXPORT O110_GenSetFreq(DWORD DN, double F, DWORD Ch);
	BOOL PASCAL EXPORT O110_GenSetLevel(DWORD DN, double L, DWORD Ch);
	BOOL PASCAL EXPORT O110_GenSetOffset(DWORD DN, double L, DWORD Ch);
	BOOL PASCAL EXPORT O110_GenSetUnits(DWORD DN, DWORD U, DWORD Ch);
	BOOL PASCAL EXPORT O110_GenSetOutputState(DWORD DN, BOOL V, DWORD Ch);
	BOOL PASCAL EXPORT O110_GenSetOutputLoad(DWORD DN, double V, DWORD Ch);
	BOOL PASCAL EXPORT O110_GenSetSignalType(DWORD DN, DWORD T, DWORD Ch);
}