How to send SMS end char CTRL-Z

Hi,

Can anyone knows how to send the SMS end char CTRL-Z in openAT.
I am using AT+CMGS command to send SMS.
So i am struggling to send the text of the message and end of the message characters.
Can anyone help me

Thanks

Why don’t you use the ADL functions (adl_smsSend)?

I tried the sample code given in open at, the code as follows
but it won’t send SMS

void main_task ( void )
{
	adl_InitType_e adlInitType = adl_InitGetType ();
    /* SMS automaton test application */
    TRACE ( ( SA_TRACE_LEVEL, "SMS automaton sample main" ) );
    TRACE ( ( SA_TRACE_LEVEL, __DATE__ ) );
    TRACE ( ( SA_TRACE_LEVEL, __TIME__ ) );

    TRACE ( ( SA_TRACE_LEVEL, "Start SMS_Automaton application" ) );

    /* Subscribe to the SMS Service */
    SmsAutoHandle = adl_smsSubscribe ( cbSmsAutoHandler, cbSmsAutoCtrlHandler,
                    ADL_SMS_MODE_TEXT );
    TRACE ( ( SA_TRACE_LEVEL, "adl_smsSubscribe : "
            "SmsAutoHandle %d", SmsAutoHandle ) );

    adl_smsSend(SmsAutoHandle , "9092363289", "Hello World!", ADL_SMS_MODE_TEXT);




}

can you tell me the handler function of adl_smsSend(); syntax is correct

Thanks

Hi,
I called the unsolicited response funtion to wait for “+wind:4” response after that in the unsolicited response handler i call ad_atsendSms() calle then i received SMS.

But can any one tell how to send the hex values like SMS ending char.
Is there any APIs available?

Because i am going to handle with sensor based on some protocole formate in this i need to send like the hex values, so is there any APIs?

Thanks in Advance

SMS is either text or PDU based, so you will probably have to use PDU mode. However, you probably won’t be able to send raw hex values over PDU mode anyway, you will need to encode the hex somehow. Have a look at base64 encoding.
https://en.wikipedia.org/wiki/Base64

Pretty sure you can

Hi, i tried to intiate GSM through using GSM AT commands the code as follows

void ATCmdSend ( void )
{
    s8 s8Return = 0;

    TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+CSQ' using the adl_atCmdSend API") );
    s8Return = adl_atCmdSend( "AT+CSQ",
                              ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                              "*",
                              NULL );
    if ( 0 > s8Return )
    {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
    }

    TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+COPS' using the adl_atCmdSend API") );
    s8Return = adl_atCmdSend( "AT+COPS?",
                                  ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                  "*",
                                  NULL );
    if ( 0 > s8Return )
     {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
     }

    TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+CREG' using the adl_atCmdSend API") );
    s8Return = adl_atCmdSend( "AT+CREG=1",
                                      ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                      "*",
                                      NULL );
    if ( 0 > s8Return )
     {
      TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
     }

    TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+WREGC' using the adl_atCmdSend API") );
    s8Return = adl_atCmdSend( "AT+WREGC=0",
                                      ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                      "*",
                                      NULL );
     if ( 0 > s8Return )
      {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
      }

     TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+WGPRS' using the adl_atCmdSend API") );
     s8Return = adl_atCmdSend( "AT+WGPRS=0,1",
                                           ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                           "*",
                                           NULL );
     if ( 0 > s8Return )
      {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
      }
     TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+WGPRS' using the adl_atCmdSend API") );
     s8Return = adl_atCmdSend( "AT+CMEE=1",
                                                ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                "*",
                                                NULL );
     if ( 0 > s8Return )
     {
       TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
     }

     TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+WGPRS' using the adl_atCmdSend API") );
      s8Return = adl_atCmdSend( "AT+CPIN?",
                                                ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                "*",
                                                NULL );
     if ( 0 > s8Return )
      {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }

     TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+CMGF' using the adl_atCmdSend API") );
          s8Return = adl_atCmdSend( "AT+CMGF?",
                                                ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                "*",
                                                NULL );
      if ( 0 > s8Return )
       {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }


     
      TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "Send 'AT+CMGS' using the adl_atCmdSend API") );
      s8Return = adl_atCmdSend( "AT+CMGS=+919092363289",
                                                 ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                 "*",
                                                 NULL );
      if ( 0 > s8Return )
       {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }
      s8Return = adl_atCmdSend( "0x0D",( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                       "*",
                                                       NULL );
      if ( 0 > s8Return )
       {
         TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }
      s8Return = adl_atCmdSend(SMSEND_IDENTIFICATION ,( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                       "*",
                                                       NULL );
      if ( 0 > s8Return )
       {
         TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }


}

for the above thing only i need to send end of sms char, can you help me?

Thanks

Cool, never used PDU mode before, so wasn’t sure. You won’t however be able to view the hex characters on a phone unless they are printable ascii chars.

Please close look in to the code ,i send the hex vaue of CTRL-Z its indicating end of the SMS text. so can you guide me

Thanks

I thought you already had the code working for sending one SMS, and your problem was just how to repeat the sending for multiple recipients :question:

If you insist on using AT+CMGS to send SMS in your code, use adl_atCmdSendText to send your text after receiving the > character. It appends the 0x1A (ctrl-Z) if it’s not in the end of the string already.

Hi,

I tried in the following way still i didn’t received SMS, can you explain me where i done the mistake

s8Return = adl_atCmdSend( "AT+CMGS=+919092363289",
                                                 ( adl_atRspHandler_t ) ATCmdSend_Response_Handler,
                                                 "*",
                                                 NULL );
      if ( 0 > s8Return )
       {
        TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }
      s8Return = adl_atCmdSendText( ADL_PORT_NONE, "HI");
      if ( 0 > s8Return )
       {
         TRACE( ( APPLI_AT_CMD_TRACE_LEVEL, "ATCmdSend: error in adl_atCmdSend: %d", s8Return ) );
       }

Thanks

You are not waiting for the ‘>’ sign before sending your text, and you are also not sending the text termination character with the text (0x1A) that tobias told you about.

Please explain why you are using the AT commands, instead of the ADL functions? If you just use adl_smsSend, you don’t have to worry about AT commands!

How to implement the wait fucntion to wait the response ‘>’. But i am able to see the response in the response handler function?
For wait i tried adl_eventwait() function and adl_ctxsleep() functions even though i am not able to getting?
can you explain how implement wait function?

the main aim is i am goin to handle with sensors. That sensors are based on some protocol, that are implemented based on the hex values ony. so that i want to know how to send hex char?

Thanks

Once again, you will need to use PDU mode (regardless of whether you use AT commands or ADL functions), you can find some info here http://www.gsm-modem.de/sms-pdu-mode.html or just Google it.

I highly recommend you first learn how to send an SMS using the ADL functions before you worry about PDU mode and sending hex data. Have a look at the example applications to get started.

Think about what happens when you type the command in the terminal: You type AT+CMGS=+123456780 and then press enter. The modem then returns a ‘>’ sign to you. So in ADL, how would you see that? You would get a callback to your ATCmdSend_Response_Handler function and the string would be ‘>’. So then you send your text followed by 0x1A, and your message gets sent.

Or just use adl_smsSend.

Kindly close look into the code i post i used the call back function for handle response after that only i send the text through adl_atcmndsendTxt().
can you please explain me?

Hi i tried this function in this i cant able to receive more than one sms in this also i struggle in the wait function only?

Thanks