Hi,
I am using wm_strGetParameterString api for gettting the response data for AT+CSQ command and storing it in a Buffer.After this i want to sent the response as an SMS. I am able to get the SMS but it is empty . Can anyone explain what is the problem.
void Signal_stn( u8 ID, void * Context )
{
adl_atCmdCreate("at+csq\x1A", ADL_AT_PORT_TYPE( ADL_AT_UART1, TRUE ) ,(adl_atRspHandler_t)ADC_Response_Handler, "*", NULL);
}
bool ADC_Response_Handler( adl_atResponse_t *paras )
{
int i=0;
ascii * ptr;
ptr = paras->StrData;
// adl_atCmdCreate("at+csq\x1A", ADL_AT_PORT_TYPE( ADL_AT_UART1, TRUE ), (adl_atRspHandler_t)Signal_stn, "+CSQ: ", NULL);
wm_strGetParameterString ( Buffer_SS, paras->StrData,1);
//adl_atSendResponse(ADL_AT_RSP, "\r\Timer timed out\r\n");
// adl_atSendResponse(ADL_AT_RSP, "\r\inside signal38r\n");
wm_strcpy(Buffer_ST,Buffer_SS);
adl_atSendResponse(ADL_AT_RSP,Buffer_SS);
return TRUE;
}
First observation: why are you terminating the AT+CSQ command with \x1A
Please re-post that code with a legible layout - the indentation is all over the place and, therefore, it’s really hard to follow!
You need to uses spaces , not TABs, for indentation.
Also, please remove the commented-out sections - they just confuse the issue.
Hello awenil,
I am just trying to send the response for the AT command AT+CSQ ie) +csq: 22,0 as a SMS to a mobile number. In my code when displaying the value of buffer Buffer_SS through adl_atSendReponse is displayed as 22 but when im trying to send the value as an SMS it is received empty.
For this code im getting only the SMS “SG=” can u help me.
ascii Buffer_ST[100];
void Signal_stn( u8 ID, void * Context )
{
adl_atCmdCreate("at+csq", ADL_AT_PORT_TYPE( ADL_AT_UART1, TRUE) ,(adl_atRspHandler_t)ADC_Response_Handler, "*", NULL);
}
bool ADC_Response_Handler( adl_atResponse_t *paras )
{
int i=0;
ascii * ptr;
ascii Buffer_SS[20];
ptr = paras->StrData;
wm_strGetParameterString ( Buffer_SS ,ptr ,1);
wm_strcpy(Buffer_ST,"[SG=");
wm_strcat(Buffer_ST,Buffer_SS);
wm_strcat(Buffer_ST,"]");
adl_atSendResponse(ADL_AT_RSP,Buffer_SS);
return TRUE;
}
if(strcmp(Buffer,"txt")==0)
{
smsSend=adl_smsSend(smsHandler,Buffer1,Buffer_ST,ADL_SMS_MODE_TEXT);
}
void adl_main(adl_InitType_e InitType)
{
adl_tmrSubscribe(TRUE,100,ADL_TMR_TYPE_100MS,Signal_stn);
}
awneil
May 10, 2010, 10:12am
4
manikandan.t:
can u help me.
No - your code is still illegible!