IARM_BUS_UIEventSimulator.c
IARM_Result_t sendCommand()
{
	int i,j;

#ifdef TRACE
	printf("[FUNC] %s [LINE] %d\n", __FUNCTION__, __LINE__);
	printf("[FUNC] %s Command=%d repeat=%d interval=%d\n", __FUNCTION__, keyCode, repeat, interval);
#endif

#if defined _SKQ_KEY_MAP_1_
/* Allow a fraction of second for EPG to get ready to receive key events
 * from the newly created input dev via UINPUT_init()
*/
	usleep(50000);
#endif
	for (i = 0; i < repeat; i++)
	{
		if (pressAndHold)
		{
			sendKeyEventToIARM(KET_KEYDOWN, keyCode);
			usleep(50000);
			for (j = 0;j < duration*20  ;j++ )
			{
				sendKeyEventToIARM(KET_KEYREPEAT, keyCode);
				usleep(50000);
			}
			sendKeyEventToIARM(KET_KEYUP, keyCode);
				usleep(50000);
			sleep(interval);
		}
		else
		{
		sendKeyEventToIARM(KET_KEYDOWN, keyCode);
		usleep(100);
		sendKeyEventToIARM(KET_KEYUP, keyCode);
		sleep(interval);
		}
	}

	return IARM_RESULT_SUCCESS;
}
/**
 * @brief Wrapper to send the command to IARM.  Repeat and interval will be evaluated and executed.
 *
 * @return IARM_Result_t Error Code.
 */
@brief Wrapper to send the command to IARM.  Repeat and interval will be evaluated and executed.
@return IARM_Result_t Error Code.
@brief Wrapper to send the command to IARM . Repeat and interval will be evaluated and executed . @return IARM_Result_t Error Code .
IARM_Result_t sendCommand()
{
	int i,j;
#ifdef TRACE
	printf("[FUNC] %s [LINE] %d\n", __FUNCTION__, __LINE__);
	printf("[FUNC] %s Command=%d repeat=%d interval=%d\n", __FUNCTION__, keyCode, repeat, interval);
#endif
#if defined _SKQ_KEY_MAP_1_
	usleep(50000);
#endif
	for (i = 0; i < repeat; i++)
	{
		if (pressAndHold)
		{
			sendKeyEventToIARM(KET_KEYDOWN, keyCode);
			usleep(50000);
			for (j = 0;j < duration*20  ;j++ )
			{
				sendKeyEventToIARM(KET_KEYREPEAT, keyCode);
				usleep(50000);
			}
			sendKeyEventToIARM(KET_KEYUP, keyCode);
				usleep(50000);
			sleep(interval);
		}
		else
		{
		sendKeyEventToIARM(KET_KEYDOWN, keyCode);
		usleep(100);
		sendKeyEventToIARM(KET_KEYUP, keyCode);
		sleep(interval);
		}
	}
	return IARM_RESULT_SUCCESS;
}
IARM_Result_t sendCommand ( ) { int i , j ; #ifdef TRACE printf ( " \n " , __FUNCTION__ , __LINE__ ) ; printf ( " \n " , __FUNCTION__ , keyCode , repeat , interval ) ; #endif #if defined _SKQ_KEY_MAP_1_ usleep ( 50000 ) ; #endif for ( i = 0 ; i < repeat ; i ++ ) { if ( pressAndHold ) { sendKeyEventToIARM ( KET_KEYDOWN , keyCode ) ; usleep ( 50000 ) ; for ( j = 0 ; j < duration * 20 ; j ++ ) { sendKeyEventToIARM ( KET_KEYREPEAT , keyCode ) ; usleep ( 50000 ) ; } sendKeyEventToIARM ( KET_KEYUP , keyCode ) ; usleep ( 50000 ) ; sleep ( interval ) ; } else { sendKeyEventToIARM ( KET_KEYDOWN , keyCode ) ; usleep ( 100 ) ; sendKeyEventToIARM ( KET_KEYUP , keyCode ) ; sleep ( interval ) ; } } return IARM_RESULT_SUCCESS ; }
@brief Wrapper to send the command to IARM.
@brief Wrapper to send the command to IARM .
/* Allow a fraction of second for EPG to get ready to receive key events
 * from the newly created input dev via UINPUT_init()
*/