CTS/RTS/DTR Settings for UART


#1

I have a UART terminal device that had flow control aspect to it.

My logic from PC works great and reads from terminal device just fine. Same logic from FASTRACK Supreme is becoming a slave device (request shows up as response). What Can I do to make the AT application UART master sending out requests. I know it is around CTS/RTS setting. I would appreciate the help.

s32             handle;
	sUartSettings_t Settings;
	psGItfCont_t    pinterface;
	sUartEvent_t    events;
	sUartLc_t       lc;
	sUartFlowCtrl_t Fc;

	TRACE (( 1, "uart_open(UART%c,%d)",identity[4], speed ));
	/* Device */
	Settings.capabilities = NULL;
	Settings.identity = identity;
	Settings.role = UART_ROLE_DCE;
	/* Events */
	events.user_data = (void*)0;
	events.valid_cb = UART_CB_ON_ALL;
	memcpy((u8*)events.cb_list, (u8*)uartCbTab, 6*sizeof(sGCbDesc_t));
	Settings.event_handlers = &events;

	/* To retrieve the UART SP Interface */
	Settings.interface = &pinterface;

	/* Line Coding */
	lc.valid_fields = UART_LC_ALL;
	lc.rate         = (eUartRate_t)(UART_RATE_USER_DEF | 2400 );
	lc.stop         = UART_STOP_BIT_1;
	lc.parity       = UART_PARITY_EVEN;
	lc.data         = UART_DATALENGTH_7;

	Settings.line_coding = &lc;

	/*------------------*/
	/* open UART device */
	/*------------------*/
	if( 0 < (handle = adl_OpenDevice( DF_UART_CLID, &Settings)) )
	{
		TRACE(( 1, "UART successfully opened" ));

		/* Locally store the uart interface */
		uart_itf = *pinterface;

		/* Flow control IO control setting */
		Fc.op   = G_IOC_OP_SET;
		//Fc.type = UART_FC_RTS_CTS;
		Fc.type = UART_FC_NONE;

		if( uart_itf.io_control( handle, IOC_UART_FC, (void*) &Fc) )
		{
			uart_itf.close( handle );
			TRACE((1, "ERROR : IOCTL FC Set"));
			handle = 0;
		}


		sUartSsIoc_t sigSetting;
		sigSetting.op = G_IOC_OP_SET;
		sigSetting.sig_id = UART_SIG_CTS;
		sigSetting.state = UART_SIG_CTS;
		if( uart_itf.io_control( handle, IOC_UART_SS, (void*) &sigSetting) ) {
			TRACE((1, "ERROR : IOCTL CTS Set"));
		}

	}
	else
	{
		TRACE(( 1, "Uart_Open : ERROR UART is not opened" ));
	}
	return handle;

I get following errors and data is not being transmitted from FASTRACK to my terminal device:

10/01/29,02:43:10:140 LLH 1 EVENT : SIG CHANGE delta 4 state 0

Thanks,
Haiden