#include "NDTSRS2AErrors.h"
#include "..\error\NDTSError.h"

typedef struct 
{
	RS2A_ReturnCode code ;
	char *pCodeString ;
} RS2A_Error ;

RS2A_Error RS2A_ApiErrors[] = 
{
	{RS2A_OK,																"RS2A_OK"},
	{RS2A_TakeSnapshot_UnsupportedTriggerMode,								"RS2A_TakeSnapshot fail: unsupported trigger mode"}, 
	{RS2A_TakeSnapshot_TimeoutWaitingForSamples,							"RS2A_TakeSnapshot fail: time out waiting for samples"},

	{RS2A_LastError,														"Unknown"}
} ;


RS2A_API const char * CALL_CONV RS2A_GetCodeString(int errorCode)
{
	int i = 0 ;

	while (RS2A_ApiErrors[i].code != errorCode && RS2A_ApiErrors[i].code != RS2A_LastError)
		i++ ;

	return RS2A_ApiErrors[i].pCodeString ;
}

void RS2A_HandleRS2AError(RS2A_ReturnCode errorCode) 
{
	NDTS_HandleError(errorCode) ;
}
