// 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 DTSCANNERAPI_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 
// DTSCANNERAPI_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#pragma once

#ifdef DTSCANNERAPI_EXPORTS
#define DTScanner_API extern "C" __declspec(dllexport)
#else
#define DTScanner_API __declspec(dllimport)
#endif


#ifdef __cplusplus
extern "C" {
#endif

	/*-----------------------------------------------Scanner-----------------------------------------------*/
	typedef void (__stdcall *ScannerDataCallback)(char *pBuf,long dataLen);

	typedef struct {
		int      index;
		BOOL	bAction;
		LPCTSTR	string;
		BYTE   type;
	} DtrIscpRsSymbologies;

	//Connect to Scanner with specific serial port
	DTScanner_API int Scanner_Connect(int port);

	//Disconnect the connection with Scanner
	DTScanner_API int Scanner_Disconnect(void);

	//Specify a callback function. It will be called after Scanner sending data. 
	DTScanner_API int Scanner_SetDataReceiverCallback(ScannerDataCallback revFun);

	//Acquire the Scanner's firmware version.
	DTScanner_API int Scanner_GetFirmwareInfo(TCHAR *version, long verLen);

	//Get the current trigger mode.
	DTScanner_API int Scanner_GetTriggerMode(int *mode);

	//Set a new trigger mode to Scanner.
	DTScanner_API int Scanner_SetTriggerMode(int mode);

	//Set Scanner to its default factory configure.
	DTScanner_API int Scanner_SetFactoryDefault(void);

	//Enable or disable beep when Scanner has Receiving data.
	DTScanner_API int Scanner_SetBeepStatus(BOOL bBeep);

	//Acquire Scanner's Type, 1D or 2D
	DTScanner_API int Scanner_GetType(long *type);

	//Set one bar code symbol identifier status.
	DTScanner_API int Scanner_SetSymbolIdentifierStatus(int index, BOOL bActive);

	//Get one bar code symbol identifier status.
	DTScanner_API int Scanner_GetSymbolIdentifierStatus(int index, BOOL* bActive);

	//Trigger Scanner.
	DTScanner_API int Scanner_Trigger(void);

	//Cancel trigger signal to  Scanner.
	DTScanner_API int Scanner_UnTrigger(void);

	//Acquire all symbologies identifier class
	DTScanner_API int Scanner_EnumSymbolIdentifierClass(DtrIscpRsSymbologies* pSymbologies, int* count);

#ifdef __cplusplus
}
#endif