
// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the KOMRIO_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// KOMRIO_API functions as being imported from a DLL, where as this DLL sees symbols
// defined with this macro as being exported.

//For detailed description of this API please see KomRioApi.chm help file.

/*
modification history
--------------------
 2008-01-18   Created							                           Dzk
*/


#ifdef __cplusplus
extern "C" {
#endif

#ifdef KOMRIO_EXPORTS
#define KOMRIO_API __declspec(dllexport)
#else
#define KOMRIO_API __declspec(dllimport)
#endif

#include <windows.h>


//KomRio data types / structures:
#define MAX_PORT_NAME	16	//max port name length

	//port types:
enum PortType
{
	ptCom=1,	//COM port (serial port)
	ptEth		//ethernet port
};

	//port routes:
enum PortRoute
{
	prFront=1,	//route to front panel
	prRio		//route to RearIO (back panel)
};

	//port info:
struct KomRioInfo
{
	UCHAR		portIdx;					//port index (zero-based)
	char		portName[MAX_PORT_NAME];	//port short description
	PortType	portType;					//type of port (com / eth)
};

//Library exports:

	//routing
KOMRIO_API DWORD KomRioGetAvailablePorts(UCHAR *pPorts);
KOMRIO_API DWORD KomRioGetPortInfo(UCHAR port,KomRioInfo *pInfo);
KOMRIO_API DWORD KomRioRouteGet(UCHAR port,PortRoute* pRoute);
KOMRIO_API DWORD KomRioRouteSet(UCHAR port,PortRoute route);

KOMRIO_API DWORD KomRioSetRestoreStatus(BOOL fRestore);
KOMRIO_API DWORD KomRioGetRestoreStatus(BOOL* pfRestore);

#ifdef __cplusplus
}
#endif

//EOF