⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cli.c

📁 telcobridges pri develop,30b+d
💻 C
📖 第 1 页 / 共 5 页
字号:
	ERROR_HANDLING
	{
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Cleanup section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CLEANUP
	{
	}

	RETURN_VOID;
}

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |  TB640IsdnCliHome:	This function adjust display pointers for a Home
 |
 |  Note			:	~
 |
 |  Return          :	~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
TBX_VOID
TB640IsdnCliHome ( TBX_VOID )
{
	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Code section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CODE
	{
		TBX_SEM_GET (g_AppContext->DisplaySem, TBX_SEM_WAIT_FOREVER);
		if( g_aszErrorLines[g_un32ErrorLineWriteIndex+1][0] )
			g_un32ErrorLineReadIndex = g_un32ErrorLineWriteIndex+1;
		else
			g_un32ErrorLineReadIndex = 0;
		TBX_SEM_GIV (g_AppContext->DisplaySem);

		/* End of the code (skip to cleanup) */
		TBX_EXIT_SUCCESS (TBX_RESULT_OK);
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Error handling section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	ERROR_HANDLING
	{
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Cleanup section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CLEANUP
	{
	}

	RETURN_VOID;
}

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |  TB640IsdnCliEnd:	This function adjust display pointers for a End
 |
 |  Note			:	~
 |
 |  Return          :	~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
TBX_VOID
TB640IsdnCliEnd ( TBX_VOID )
{
	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Code section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CODE
	{
		TBX_SEM_GET (g_AppContext->DisplaySem, TBX_SEM_WAIT_FOREVER);
		g_un32ErrorLineReadIndex = g_un32ErrorLineWriteIndex ? g_un32ErrorLineWriteIndex - 1 : g_un32ErrorLineWriteIndex;
		TBX_SEM_GIV (g_AppContext->DisplaySem);

		/* End of the code (skip to cleanup) */
		TBX_EXIT_SUCCESS (TBX_RESULT_OK);
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Error handling section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	ERROR_HANDLING
	{
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Cleanup section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CLEANUP
	{
	}

	RETURN_VOID;
}

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |  TB640IsdnCliDownArrow:	This function adjust display pointers for a DownArrow
 |
 |  Note			:	~
 |
 |  Return          :	~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
TBX_VOID
TB640IsdnCliDownArrow ( TBX_VOID )
{
	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Code section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CODE
	{
		TBX_SEM_GET (g_AppContext->DisplaySem, TBX_SEM_WAIT_FOREVER);
		if (g_un32ErrorLineReadIndex != g_un32ErrorLineWriteIndex)
		{
			if (++g_un32ErrorLineReadIndex >= TB640_ISDN_CLI_MAX_NB_ERROR_LINES)
			{
				g_un32ErrorLineReadIndex = 0;
			}
		}
		TBX_SEM_GIV (g_AppContext->DisplaySem);

		/* End of the code (skip to cleanup) */
		TBX_EXIT_SUCCESS (TBX_RESULT_OK);
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Error handling section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	ERROR_HANDLING
	{
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Cleanup section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CLEANUP
	{
	}

	RETURN_VOID;
}

/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |  TB640IsdnCliUpArrow:	This function adjust display pointers for a UpArrow
 |
 |  Note			:	~
 |
 |  Return          :	~
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
TBX_VOID
TB640IsdnCliUpArrow ( TBX_VOID )
{
	TBX_UINT32					un32OldReadIndex;

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Code section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CODE
	{
		TBX_SEM_GET (g_AppContext->DisplaySem, TBX_SEM_WAIT_FOREVER);
		un32OldReadIndex = g_un32ErrorLineReadIndex;
		if (g_un32ErrorLineReadIndex != 0)
		{
			g_un32ErrorLineReadIndex--;
		}
		else
		{
			g_un32ErrorLineReadIndex = (TB640_ISDN_CLI_MAX_NB_ERROR_LINES-1);
		}
		if (g_un32ErrorLineReadIndex == g_un32ErrorLineWriteIndex)
		{
			g_un32ErrorLineReadIndex = un32OldReadIndex;
		}
		TBX_SEM_GIV (g_AppContext->DisplaySem);

		/* End of the code (skip to cleanup) */
		TBX_EXIT_SUCCESS (TBX_RESULT_OK);
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Error handling section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	ERROR_HANDLING
	{
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Cleanup section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CLEANUP
	{
	}

	RETURN_VOID;
}


/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |  TB640IsdnAdjustTraceLevel:	This function makes the user to select new trace levels
 |
 |  out_pun32FileLogLevel:	File log level selected by the user
 |	out_pun32DisplayLogLevel:	Display log level selected by the user
 |
 |  Note			:	~
 |
 |  Return          :	TBX_RESULT_OK
 |						TBX_RESULT_FAIL
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
TBX_RESULT
TB640IsdnAdjustTraceLevel (
  OUT		PTBX_UINT32				out_pun32FileLogLevel,
  OUT		PTBX_UINT32				out_pun32DisplayLogLevel)
{
	TBX_CHAR										szLine [TB640_ISDN_CLI_MAX_LINE_SIZE_GET];

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Code section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CODE
	{
		/* Initialize local variable */
		*out_pun32FileLogLevel = 0;
		*out_pun32DisplayLogLevel = 0;

		/* Display prompt */
		TB640_ISDN_DISPLAY_PRINT ("Enter the FILE log level (0=loud, 5=light): ");

		/* Get the input from the user */
		szLine[0] = '\0';
		fgets (szLine, TB640_ISDN_CLI_MAX_LINE_SIZE_GET, stdin);
		*out_pun32FileLogLevel = atoi (szLine);
		if (*out_pun32FileLogLevel > 5)
		{
			*out_pun32FileLogLevel = 5;
		}

		/* Display prompt */
		TB640_ISDN_DISPLAY_PRINT ("Enter the DISPLAY log level (0=loud, 5=light): ");

		/* Get the input from the user */
		szLine[0] = '\0';
		fgets (szLine, TB640_ISDN_CLI_MAX_LINE_SIZE_GET, stdin);
		*out_pun32DisplayLogLevel = atoi (szLine);
		if (*out_pun32DisplayLogLevel > 5)
		{
			*out_pun32DisplayLogLevel = 5;
		}

		/* Refresh the display */
		g_fRefreshDisplay |= TB640_ISDN_CLI_REFRESH_DISPLAY;

		/* End of the code (skip to cleanup) */
		TBX_EXIT_SUCCESS (TBX_RESULT_OK);
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Error handling section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	ERROR_HANDLING
	{
	}

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Cleanup section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CLEANUP
	{

	}

	RETURN;
}


/*-------------------------------------------------------------------------------------------------------------------------------
 |
 |  TB640IsdnSelectCallForAutomaticCall:	This function automatically selects the next timeslot to use for automatic call
 |											generation
 |
 |	in_un32StressOutgoingTimeslotMinIdleMsec:	Minimum time a timeslot needs to be idle before selection for an outgoing call
 |  out_pun32AdapterNb:	Adapter number to use
 |  out_pun32TrunkNb:	Trunk number to use
 |	out_pun32TimeslotNb:Timeslot number to use
 |
 |  Note			:	~
 |
 |  Return          :	TBX_RESULT_OK
 |						TBX_RESULT_FAIL
 |
 *------------------------------------------------------------------------------------------------------------------------------*/
TBX_RESULT
TB640IsdnSelectCallForAutomaticCall (
  IN		TBX_UINT32				in_un32StressOutgoingTimeslotMinIdleMsec,
  OUT		PTBX_UINT32				out_pun32AdapterNb,
  OUT		PTBX_UINT32				out_pun32TrunkNb,
  OUT		PTBX_UINT32				out_pun32TimeslotNb)
{
	TBX_BOOL										fFound;
	static TBX_UINT32								un32Adapter = 0;
	static TBX_UINT32								un32Trunk = 0;
	static TBX_UINT32								un32Timeslot = 0;

	TBX_UINT32										un32DiffTime;
	TBX_UINT32										un32StartingAdapter;
	TBX_UINT32										un32StartingTrunk;
	TBX_UINT32										un32StartingTimeslot;
	TBX_UINT32										un32DChannelIndex;

	PTB640_ISDN_ADAPTER_INFO						pAdapterInfo;
	PTB640_ISDN_TRUNK_INFO							pTrunkInfo;
	PTB640_ISDN_TRUNK_RESOURCE_INFO					pTrunkResInfo;

	/*---------------------------------------------------------------------------------------------------------------------------
	 |  Code section
	 *--------------------------------------------------------------------------------------------------------------------------*/
	CODE
	{
		/* Initialize local variable */
		*out_pun32AdapterNb = 0;
		*out_pun32TrunkNb = 0;
		*out_pun32TimeslotNb = 0;
		fFound = TBX_F

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -