Re-sending SMS


#1

hello to the forum residents!

Im a newbi…

my question is as follows:

the first time i send an SMS i get the ADL_SMS_EVENT_SENDING_OK

the second time it comes up with ADL_SMS_EVENT_SENDING_MR

what does it mean?
why does the second sms not being sent? (i do not recieve it on the other side)
what to do?

Thanks…


#2

Hi googlieye,

from what I understand you should receive both notifications for each SMS… Are you sure you sent 2 messages?

Could you maybe post the code that we can help you better?

Best Regards,
Jan


#3

Hi jan,

Thanks for the quick respons… :slight_smile:

I have followed the comments here (yours as well) and my code follows the general usage methode:

******* start of copy of code

void SMS_Init(void)
{

adl_atSendResponse(ADL_AT_RSP,"\r\nSetting up SMS service...\r\n");

SMS_Handle = adl_smsSubscribe(SMS_IN_Handler, SMS_OUT_Handler, ADL_SMS_MODE_TEXT);

} // void SMS_Init(void)

//void SMS_out_Handler (void)
void SMS_OUT_Handler (u8 Event, u16 NB)
{

switch (Event)
{
    case ADL_SMS_EVENT_SENDING_OK :
        adl_atSendResponse(ADL_AT_RSP,"\r\nSMS SENT Successfuly!\r\n");
    break;
    
    
    case ADL_SMS_EVENT_SENDING_ERROR :
        adl_atSendResponse(ADL_AT_RSP,"\r\nERROR SENDING SMS , code: ");
        adl_atSendResponse(ADL_AT_RSP, code);
    break;

    case ADL_SMS_EVENT_SENDING_MR :
        adl_atSendResponse(ADL_AT_RSP,"\r\nMR SMS SENT Successfuly!\r\n MR Code = ");
    break;
  

}

}

//void SMS_in_Handler (void)
bool SMS_IN_Handler ( ascii * smstel, ascii * smstimelength, ascii * smstext)
{

adl_atSendResponse(ADL_AT_RSP,"\r\nSMS Recieved!\r\n");
adl_atSendResponse(ADL_AT_RSP, smstext);
adl_atSendResponse(ADL_AT_RSP,"\r\nEnd Text\r\n");
adl_atSendResponse(ADL_AT_RSP, smstel);
adl_atSendResponse(ADL_AT_RSP,"\r\nEnd Tel\r\n");
adl_atSendResponse(ADL_AT_RSP, smstimelength);
adl_atSendResponse(ADL_AT_RSP,"\r\nEnd Time Stamp\r\n");

return (TRUE);
}

******* end of copy of code

This is how i send the SMS:

            adl_smsSend(SMS_stat, smstel, &MessageString[0] , ADL_SMS_MODE_TEXT); 
            switch (result) 
            { 
                case OK: 
                        adl_atSendResponse(ADL_AT_RSP, "\r\nsmsSend : OK\r\n" ); 
                        // don't send the "OK" answer here, but in SmsCtrlHandler 
                break; 
                case ADL_RET_ERR_PARAM: 
                        adl_atSendResponse(ADL_AT_RSP, "\r\nsmsSend : Parameter Error\r\n" ); 
                        adl_atSendStdResponse( ADL_AT_RSP, ADL_STR_ERROR); 
                break; 
                case ADL_RET_ERR_UNKNOWN_HDL: 
                        adl_atSendResponse(ADL_AT_RSP, "\r\nsmsSend : KUnknown handler\r\n" ); 
                        adl_atSendStdResponse( ADL_AT_RSP, ADL_STR_ERROR); 
                break; 
                case ADL_RET_ERR_BAD_STATE: 
                        adl_atSendResponse(ADL_AT_RSP, "\r\nsmsSend : not ready to send SMS\r\n" ); 
                        adl_atSendStdResponse( ADL_AT_RSP, ADL_STR_ERROR); 
                break; 
                default: 
                adl_atSendStdResponse( ADL_AT_RSP, ADL_STR_ERROR); 
           }                                             

The response i get the first time is:

MR SMS SENT Successfuly!
MR Code =
SMS SENT Successfuly!

and the second SMS i get:

smsSend : OK