How to intercept CONNECT 9600 by software application


#1

I’m doing a CSD call between two Q2686. If i use normal AT commands (atd +39xxxxxxx) to dial, i get ‘CONNECT 9600’ by GSM network. Otherwise, if i do the following code, i get no ‘CONNECT 9600’ message… why ?

void StartDataCall()
{
	if (CallTypeStatus == CALL_TYPE_UNDEFINED || CallTypeStatus == CALL_TYPE_CLOSED)
	{
		Log("s", "DATACALLING...", "");
		if (isGprsTcpChannelOpen == TRUE) GprsStop();
		adl_callSetup(myAuthorizedPhoneNumbers.GpsNumber, ADL_CALL_MODE_DATA);
		CallTypeStatus = CALL_TYPE_OPEN_DATA;
		if (adl_fcmIsAvailable(ADL_FCM_FLOW_GSM_DATA))
		{
			DatacallHandle = adl_fcmSubscribe(ADL_FCM_FLOW_GSM_DATA, (adl_fcmCtrlHdlr_f)DatacallControlHandler, (adl_fcmDataHdlr_f)DatacallDataHandler);
		}
	}
}

Here the function handlers:

bool DatacallControlHandler(u8 Event)
{
	switch(Event)
	{
		case ADL_FCM_EVENT_FLOW_OPENNED:
			Log("s", "FLOW OPEN", "");
		break;

		case ADL_FCM_EVENT_FLOW_CLOSED:
			CallTypeStatus = CALL_TYPE_CLOSED;
		break;

		case ADL_FCM_EVENT_V24_DATA_MODE:
			Log("s", "v24_DATA_MODE", "");
		break;
	}

	return TRUE;
}
//-------------------------------------------------------------------------------
bool DatacallDataHandler(u16 datalen, u8 * data)
{
	if (datalen > 0)
	{
		if (strstr(data, "CONNECT 9600") != NULL)
		{
			// Connessione pronta su chiamata dati
			Log("s", "Connessione aperta!", "");
		}

		//Log("s", "DATA: ", data);
	}
	return TRUE;
}

Where i’m doing mistakes ? Thank you!


#2

i get only ADL_FCM_EVENT_FLOW_OPENNED … why ? How i can detect when data channel is ready to send/receive data ? Please help me!


#3

#4

Yes, i’ve changed my code but when i can start to send data ? In which event ? Thank you…


#5

The Application Download sample illustrates using a CSD call (for XMODEM)…


#6

Mmm no, i’ve take a look to the code and there’s no references to any adl_fcm command.


#7

You haven’t looked hard enough!

In M2M Studio:

  1. Create a new project based on the ‘Application Download’ sample
  • this will give 2 projects in your worksppace: ‘Application Download’ and ‘Download’
  1. In the Project Explorer, select both of those 2 projects
  2. Search > Search > File Search
  • ‘Containing text’ = adl_fcm
  • ‘File name patterns’ = *.c
  • ‘Scope’ = ‘Selectedresources’
  • Search!

Gives me a total of 35 matches:
6 in applidwl.c
6 in downloader.c
23 in dwl_engin.c
4 in uploader.c


#8

In application download example there’s NO reference to adl_fcm commands! Only to constants!
Thank you again.


#9

As I said, the sample creates two projects - are you sure you are searching both projects?


#10

I look direct thru windows search in samples directory. Believe me i know how to do a search. I’ve resolved with a trick but there’s no CONNECT 9600 sent when two q2686 estabilishes a data call connection using ADL APIs. May be a bug in the firmware.


#11

No, that sounds perfectly reasonable: the ADL APIs “catch” the unsolicited response, and convert it to an Even which is passed to the app’s Event Handler.


#12

There’s no Event raised when the connection is estabilished… This is the reason of my topic… No event raised using ADL APIs. I need to subscribe an unsolicited response ? How ?


#13

Of course there is - otherwise the DOTA sample wouldn’t work!

No, you don’t.

I suggest that you just setup a simple project which simply traces the events as you do this manually - so that you can see which ADL events correspond to the “manual” actions…

Your handler will, of course, need to return ADL_CALL_FORWARD.


#14

Yes i say there’s no event 'cause i’m doing something wrong, of course!! :smiley: So i post my code:

There are call and data handlers on the calling side:

bool DatacallControlHandler(u8 Event)
{
	switch(Event)
	{
		case ADL_FCM_EVENT_FLOW_OPENNED:
			TRACE((2, "DatacallControlHandler(): FLOW OPEN"));
			adl_callSetup(myAuthorizedPhoneNumbers.GpsNumber, ADL_CALL_MODE_DATA);			
			if (adl_fcmIsAvailable(ADL_FCM_FLOW_GSM_DATA))
			{
				timer_DatacallStopOnErrorHandle = adl_tmrSubscribe(FALSE, 10*60 * 3, ADL_TMR_TYPE_100MS, (adl_tmrHandler_t)timer_DatacallStopOnError);
			}
			isDataCall = TRUE;
			adl_fcmSwitchV24State(DatacallHandle, ADL_FCM_V24_STATE_DATA);
		break;

		case ADL_FCM_EVENT_FLOW_CLOSED:
			CallTypeStatus = CALL_TYPE_CLOSED;
			isDataCall = FALSE;
			TRACE((2, "DatacallControlHandler(): FLOW CLOSED"));
			adl_fcmSwitchV24State(DatacallHandle, ADL_FCM_V24_STATE_AT);
		break;

		case ADL_FCM_EVENT_V24_DATA_MODE:
			TRACE((2, "v24_DATA_MODE"));
		break;

		case ADL_FCM_EVENT_V24_AT_MODE:
			TRACE((2, "v24_AT_MODE"));
			adl_fcmReleaseCredits(DatacallHandle, 0xFF);
		break;

		case ADL_FCM_EVENT_V24_AT_MODE_EXT:
			adl_fcmReleaseCredits(DatacallHandle, 0xFF);
		break;
	}

	return ADL_CALL_FORWARD;
}

bool DatacallDataHandler(u16 datalen, u8 * data)
{
	if (datalen > 0)
	{
		if (strstr(data, "CONNECT") != NULL)
		{
			TRACE((2, "CONNECT 9600"));
		}
		else
		{
			TRACE((2, "DATA:%s", data));
		}
	}
	return TRUE;
}

I make the datacall to receiver side with this code:

void StartDataCall()
{
	if (CallTypeStatus == CALL_TYPE_UNDEFINED || CallTypeStatus == CALL_TYPE_CLOSED)
	{
		GprsStop();
		CallTypeStatus = CALL_TYPE_OPEN_DATA;
		DatacallHandle = adl_fcmSubscribe(ADL_FCM_FLOW_GSM_DATA, (adl_fcmCtrlHdlr_f)DatacallControlHandler, (adl_fcmDataHdlr_f)DatacallDataHandler);	
        }
}

Where i get the ‘connect 9600’ message ? In the “DatacallDataHandler()” as string message ? Thank you.