Hi…awneil
Thank you for your reply…
I was debugging from last 2 days.
These things i observed:
When i use debugging mode in M2M and shell to see the adl_send response messages
It will come to-" ALREADY IN DATA MODE" It indicates adl_switch mode activated to DATA mode
but if i use my other serial port tools, ( m using dock light settings i made it exactly like m2m 115200 8N1 and H/W flow control)
message comes till “ADL_FCM_EVENT_FLOW_OPENNED”
after this i am executing adl_Switch_mode. it should display ALREADY IN DATA MODE but it is not displaying
I doubt here something going wrong. my module getting hanging ?? I dont know its not taking at command also.
please see my code
/*
* Main_FCM.c
*
* Created on: Oct 7, 2010
* Author: Hegde
*/
/****Mandatory *******************/
#include"adl_global.h"
const u16 wm_apmCustomStackSize = 1024*3;
/****Variables *******************/
s8 FCM_UART1_Handle;
s8 ADL_CHECK;
/*********************************FCM HANDLERS AND SUBSCRIPTION***************************************************************/
bool CtrlHdlr(adl_fcmEvent_e Event)
{
switch(Event)
{
case ADL_FCM_EVENT_FLOW_OPENNED:
TRACE( (1,"ADL_FCM_EVENT_FLOW_OPENNED") );
adl_atSendResponse ( ADL_AT_UNS, "\r\nUART1 OPENED\r\n");
adl_fcmSwitchV24State(FCM_UART1_Handle,ADL_FCM_V24_STATE_DATA); //to receive data in DATA MODE
adl_atSendResponse ( ADL_AT_UNS, "\r\nSWITCH STATE EXECUTED\r\n");
break;
case ADL_FCM_EVENT_FLOW_CLOSED:
TRACE( (1,"ADL_FCM_EVENT_FLOW_CLOSED") );
adl_atSendResponse ( ADL_AT_UNS, "\r\nUART1 HAS BEEN CLOSED");
break;
case ADL_FCM_EVENT_V24_DATA_MODE:
TRACE( (1,"ADL_FCM_EVENT_V24_DATA_MODE") );
adl_atSendResponse ( ADL_AT_UNS, "\r\nALREADY IN DATA MODE");
break;
case ADL_FCM_EVENT_V24_AT_MODE:
TRACE( (1,"ADL_FCM_EVENT_V24_AT_MODE") );
adl_atSendResponse ( ADL_AT_UNS, "\r\nALREADY IN AT MODE");
break;
default:
TRACE( (1,"UNKNOWN EVENT OCCURED") );
adl_atSendResponse ( ADL_AT_UNS, "\r\nUNKNOWN EVENT OCCURED");
// adl_fcmUnsubscribe(FCM_UART1_Handle);
break;
}
return TRUE;
}
//Handle incoming DATA
bool DataHdlr(u16 DataLen, u8 *Data)
{
TRACE( (1,"DataLen %d",DataLen) );
return TRUE;
}
//Subscribe Function
void fcm_uart_subscribe( void )
{
if( adl_fcmIsAvailable (ADL_FCM_FLOW_V24_MASTER ) == TRUE )
{
TRACE((1,"Port is available"));
adl_atSendResponse(ADL_AT_UNS,"\r\nPort is available");
FCM_UART1_Handle = adl_fcmSubscribe(ADL_FCM_FLOW_V24_MASTER, CtrlHdlr, DataHdlr);
TRACE((1,"%d",FCM_UART1_Handle));
}
}
/*********************************SIM HANDLER AND SUBSCRIPTION******************************************************/
void Sim_Handler( u8 Event)
{
switch(Event)
{
case ADL_SIM_EVENT_PIN_OK:
TRACE((1,"SIM event Pin Ok"));
break;
case ADL_SIM_EVENT_REMOVED:
adl_atSendResponse(ADL_AT_RSP,"\r\nPlease Insert Sim_card\r\n");
TRACE((1,"ADL_SIM_EVENT_REMOVED"));
break;
case ADL_SIM_EVENT_INSERTED:
TRACE((1,"ADL_SIM_EVENT_INSERTED"));
adl_atCmdCreate ( "AT+CMGD=1,4",FALSE, NULL, NULL);
break;
case ADL_SIM_EVENT_FULL_INIT:
adl_atSendResponse(ADL_AT_UNS,"\r\nSim_Card Is Registered to Public Network");
fcm_uart_subscribe(); //FCM_UART1 Subscription
break;
}
}
/*****Subscribe SIM *****************/
void sim_subscribe(void)
{
adl_simSubscribe(Sim_Handler, "4511");
}
/*************************************Application Entry point***********************************************************/
void adl_main ( adl_InitType_e InitType )
{
switch(InitType)
{
case ADL_INIT_POWER_ON:
adl_atSendResponse(ADL_AT_RSP,"\r\nEmbedded OS Power_On :[OK]\r\n");
break;
case ADL_INIT_REBOOT_FROM_EXCEPTION:
adl_atSendResponse(ADL_AT_RSP,"\r\nReboot From Exception\r\n");
break;
case ADL_INIT_DOWNLOAD_SUCCESS:
adl_atSendResponse(ADL_AT_RSP,"\r\nDownload Initialized\r\n");
break;
case ADL_INIT_DOWNLOAD_ERROR:
adl_atSendResponse(ADL_AT_RSP,"\r\nDownload Error\r\n");
break;
case ADL_INIT_RTC:
adl_atSendResponse(ADL_AT_RSP,"\r\nPower On due to RTC\r\n");
break;
}
TRACE (( 1, "Embedded : Appli Init" ));
adl_atSendResponse(ADL_AT_UNS,"\r\nMaking It Wireless\r\n");
sim_subscribe();
}
/*************************************END OF adl_main****************************************/
How to get rid of it??
Please guide me…
Best regards
Hegde