#define RSSI_MAX_SAMPLE (100)
#define SETTLE_MAX (10)


#define BER_BIT_COUNT 0
#define BER_BIT_ERRORS 1
#define BER_ACCESS_CODE 2 /* Not used */
#define BER_RCVD_PKTS 3
#define BER_EXP_PKTS 4
#define BER_HDR_ERRORS 5
#define BER_CRC_ERRORS 6
#define BER_UNCORR_ERRORS 7
#define BER_SYNC_ERRORS 8
#define BER_MAX 9

#ifdef TESTENGINE_DLL
#define LIBAPI extern "C" _declspec(dllexport) 
#else
#define LIBAPI extern "C" _declspec(dllimport) 
#endif


/*************************************************************************************
	VERSION INFORMATION
*************************************************************************************/
/*************************************************************************************
*	
*	Function Name : char * get_version(int display_message_box);
*
*	Parameters :	display_message_box - determines if the function will display a 
*						windows messagebox. If set to zero (0) will NOT display the 
*						messagebox, any non-zero value it wil display the messagebox.
*
*	Returns :		Returns a pointer to the version string.
*
*	Description :	Retrieve or displays the current version string.
*
*************************************************************************************/
LIBAPI const char * _stdcall get_version(int display_message_box);

/*************************************************************************************
	LINK MANAGEMENT FUNCTIONS
*************************************************************************************/

/*************************************************************************************
*	
*	Function Name : int init_prodtest(int transport, char * transportDevice, unsigned long int dataRate, bool DMcommands);
*
*	Parameters :
*					transport - defines the protocol to be used when setting up the 
*								communication with BlueCore.
*								USB = 2
*								H4 = 4
*								BCSP = 1
*								NONE = 0 (not allowed)
*					transportDevice - Defines the physical port to use. A string which
*								for comm ports is "COMn" where 'n' is the number of the 
*								port. 
*					dataRate - defines the baud rate to be used. For UART connections 
*								only.
*
*					DMcommands - defines if the test system will require to send HCI 
*								commands (for HCIStack) or DM commands (for HID and 
*								RFC stacks). To use DM commands the VM will need to be 
*								disabled.
*
*	Returns :		This function will return a zero on failure or an integer which 
*					defines the handle to the host - host controller connection. This 
*					value is used as a parameter for all other function calls.
*
*	Description :	This function has to called before any communication with BlueCore
*					can commence. It creates the production test engine which handles
*					all communication with BlueCore and returns a connection handle 
*					which must be referenced when communication with a specific device. 
*
*************************************************************************************/
LIBAPI int _stdcall init_prodtest(int transport, char * transportDevice, unsigned long int dataRate, bool DMcommands);

/*************************************************************************************
*	
*	Function Name :	int close_prodtest( uint32 handle);
*
*	Parameters :
*					handle - handle to the device.
*
*	Returns :		Always 1.
*
*	Description :	This function should always be called when terminating 
*					communications with BlueCore. It will initiate a reset and then 
*					delete all objects associated with the communication stack.
*
*************************************************************************************/
LIBAPI int _stdcall close_prodtest( uint32 handle);

/*************************************************************************************
*	
*	Function Name :	int do_slave(uint32 handle);
*
*	Parameters :	handle - handle to the device
*
*
*	Returns :		1 on success, 0 on failure. 
*
*	Description :	Performs four steps:
*					1. Sets the event filter to auto accept a connection request. 
*					Implements the command HCI_Set_Event_Filter with the following
*					parameters:
*						0x02 - Connection  setup filter type
*						0x00 - Allow connections from all devices
*						0x02 - Auto accept the connection
*					
*					2. Implements the command HCI_Write_Pagescan_activity with the 
*					following parameters:
*						0x0040 - Pagescan interval
*						0x0020 - Pagescan window
*
*					3. 	Implements the command HCI_Write_Inquiryscan_activity with the 
*					following parameters:
*						0x0040 - Inquiryscan interval
*						0x0020 - Inquiryscan window
*
*					4. Implements the command HCI_WriteScan_Enable with the following
*					parameter:
*						0x03 - Inquiry scan enabled, Page scan enabled.
*
*					Success is determine by:
*						1. Valid handle
*						2. DM or HCI Command complete packets returned for all four commands
*						listed. On failure the function will attempt to stop all the
*						scan enables.
*
*************************************************************************************/
LIBAPI int _stdcall do_slave(uint32 handle);

