FCM GSM->UART Queries

I’m just starting up with OpenAT and am making a ‘passthrough’ connection to take a CSD call and route comms through UART1. I’ve got a few questions that have arisen, simple ones first :

  1. How do I only view level 2 traces in the TMT Version 2.6.2.0 (Tried Trace->Set Diagnose Levels but don’t have CUS4 and CUS doesn’t seem to have any effect)

  2. After my first incoming call I get a lot of 878588 traces appearing and don’t know what they are - can anybody shed any light?

  3. Finally, the big one - why doesn’t it work second time round …

The code starts up and does adl_fcmSubscribe to ADL_PORT_GSM_BASE and ADL_FCM_FLOW_V24_UART1

My FCM control event handlers both get ADL_FCM_EVENT_FLOW_OPENNED events straight away

When I initiate an external call I get ADL_CALL_EVENT_RING_DATA in my call handler and then perform adl_fcmSwitchV24State on the UART to ADL_FCM_V24_STATE_DATA and it returns an ADL_CALL_NO_FORWARD_ATA

The call is set up and then I can send data from remote modem -> OpenAT app and vice versa.

When I hang the call up I get ADL_FCM_EVENT_FLOW_CLOSED in my control handler for the GSM stream - this is the bit I think I may need to act upon? I then switch the UART back to AT mode

If I then make another call I get the ring event again and switch the UART to data mode before getting swamped with “Unable to find the string of the remote trace in the file [ID = 878588]” (Question 2). I do, however, still get ADL_CALL_EVENT_ANSWER_OK and the call appears to be correctly established.

My problem here is that characters I type on the UART are ‘seen’ by the application but don’t appear on the GSM fcm stream and anything sent via the GSM fcm stream to the open at app doesn’t arrive. It’s as though the remote stream is in an invalid state - is there something I need to do to close/reestablish this connection?

This is on OpenAT Version 4.10

Any help appreciated

James

If it helps here’s a stripped down version of the code:

void adl_main (adl_InitType_e InitType)
{
	SubscribeToEvents();
}
//----------------------------------------------------------------------------------------------------------
void SubscribeToEvents()
{
	adl_simSubscribe (SIMEventHandler, NULL);
	adl_callSubscribe (CallEventHandler);
	GSM_FlowControlHandle=adl_fcmSubscribe (ADL_PORT_GSM_BASE, (adl_fcmCtrlHdlr_f)GSM_FCMControlHandler, (adl_fcmDataHdlr_f)GSM_FCMDataHandler);
	UART_FlowControlHandle=adl_fcmSubscribe (ADL_FCM_FLOW_V24_UART1, (adl_fcmCtrlHdlr_f)UART_FCMControlHandler, (adl_fcmDataHdlr_f)UART_FCMDataHandler);
}
//---------------------------------------------------------------------------------
s8 CallEventHandler (u16 Event, u32 CallID)
{
	s8 ReturnValue=ADL_CALL_FORWARD;
	
	switch (Event)
	{
		case ADL_CALL_EVENT_RING_DATA:
			//If we have a UART handle
			if (UART_FlowControlHandle>=0)
			{
				OutputTrace (1, "UART switched to data mode");
				adl_fcmSwitchV24State (UART_FlowControlHandle, ADL_FCM_V24_STATE_DATA);
				OutputTrace (1, "Incoming data call, answering call ...");
				//This answers the call
				ReturnValue=ADL_CALL_NO_FORWARD_ATA;
			}
			else
			{
				OutputTrace (1, "Ignoring incoming call, UART unavailable");
			}
			break;
	}

	return ReturnValue;
}
//---------------------------------------------------------------------------------
void Hangup()
{
	//Switch back to 'AT mode'
	adl_fcmSwitchV24State (UART_FlowControlHandle, ADL_FCM_V24_STATE_AT);
}
//---------------------------------------------------------------------------------
bool GSM_FCMControlHandler (adl_fcmEvent_e Event)
{
	switch (Event)
	{
		case ADL_FCM_EVENT_FLOW_OPENNED:
			OutputTrace (1, "GSM stream opened");
			break;
		case ADL_FCM_EVENT_FLOW_CLOSED:
			OutputTrace (1, "GSM stream closed");
			Hangup();
			break;
	}

	return TRUE;
}
//---------------------------------------------------------------------------------
bool GSM_FCMDataHandler (u16 DataLength, u8 *Data)
{
	u8 Response=0, Counter=0;
	
	//Output response on the V24 stream (the GSM connection)
	adl_fcmSendData (UART_FlowControlHandle, Data, DataLength);

	//Return true because we have processed the data
	return TRUE;
}
//---------------------------------------------------------------------------------
bool UART_FCMControlHandler (adl_fcmEvent_e Event)
{
	switch (Event)
	{
		case ADL_FCM_EVENT_FLOW_OPENNED:
			OutputTrace (1, "UART stream opened");
			break;
		case ADL_FCM_EVENT_FLOW_CLOSED:
			OutputTrace (1, "UART stream closed");
			break;
	}

	return TRUE;
}
//---------------------------------------------------------------------------------
bool UART_FCMDataHandler (u16 DataLength, u8 *Data)
{
	u8 Response=0, Counter=0;
	
	//Output response on the V24 stream (the GSM connection)
	adl_fcmSendData (GSM_FlowControlHandle, Data, DataLength);

	//Return true because we have processed the data
	return TRUE;
}

And here’s some debug:

//Starts up here
Trace IP 1 4/1/2000,0:43:22 GSM stream opened
Trace IP 1 4/1/2000,0:43:22 UART stream opened
Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 875186)

//Externally dialled here
Trace IP 1 4/1/2000,0:43:29 UART switched to data mode
Trace IP 1 4/1/2000,0:43:29 Incoming data call, answering call …
Trace IP 1 4/1/2000,0:43:30 UART in V24 data mode
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)
Trace 1 Unable to find the string of the remote trace in the file (ID = 877977)
Trace IP 1 4/1/2000,0:43:42 Answered OK, speed : 9600

//Sent some characters using the serial link manager
Trace IP 1 4/1/2000,0:43:45 UART Received 1
Trace IP 1 4/1/2000,0:43:46 UART Received 1
Trace IP 1 4/1/2000,0:43:46 UART Received 1
Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 875186)
Trace IP 1 4/1/2000,0:43:46 UART Received 1
Trace IP 1 4/1/2000,0:43:47 UART Received 1
Trace IP 1 4/1/2000,0:43:47 UART Received 1

//Sent some charaters remotely
Trace IP 1 4/1/2000,0:43:51 GSM Received 1
Trace IP 1 4/1/2000,0:43:51 GSM Received 1
Trace IP 1 4/1/2000,0:43:51 GSM Received 1
Trace IP 1 4/1/2000,0:43:52 GSM Received 1
Trace IP 1 4/1/2000,0:43:52 GSM Received 1
Trace IP 1 4/1/2000,0:43:52 GSM Received 1
Trace IP 1 4/1/2000,0:43:56 GSM Received 1
Trace IP 1 4/1/2000,0:43:56 GSM Received 1
Trace IP 1 4/1/2000,0:43:57 GSM Received 1

//Hung up
Trace MMT 1 Unable to find the string of the remote trace in the file (ID = 872087)
Trace IP 1 4/1/2000,0:43:58 GSM stream closed
Trace IP 1 4/1/2000,0:43:58 UART returned to ‘AT’ mode
Trace IP 1 4/1/2000,0:43:58 No carrier
Trace IP 1 4/1/2000,0:43:58 UART in V24 AT mode

//Another call
Trace L3RR 1 Unable to find the string of the remote trace in the file (ID = 875186)
Trace IP 1 4/1/2000,0:44:8 UART switched to data mode
Trace IP 1 4/1/2000,0:44:9 Incoming data call, answering call …
Trace IP 1 4/1/2000,0:44:9 UART in V24 data mode
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)
Trace 1 Unable to find the string of the remote trace in the file (ID = 878588)

That means you haven’t done the ‘Get Information About Target’ (or it didn’t work).

However, even after doing that, you can’t disable the ‘Unable to find the string…’ traces - they are Wavecom’s own, and beyond your control or mine as humble developers…

awneil - thanks for that, you’re right get info reveals cus 4 but not that it’s much use without being able to turn off the wavecom traces.

Is there any central source for what they all mean?

Trying to answer your JSeaman’s 3rd question

When a GSM call is disconnected, the GSM flow is closed automatically. So you have to subscribe to the GSM flow again before the second call is answered.
When you answer a GSM data call, make sure it is done on the Open AT port (ADL_PORT_OPEN_AT_VIRTUAL_BASE and not UART1, UART2 or USB) if you are using adl_callAnswerExt.

Hope this helps.