# Error sending SMS to SIM900 in PIC

I am trying to interface SIM900 with PIC18F2520. I need to send SMS to a particular cell number. According to AT commands, AT+CMGS="number" is used to send SMS. After sending this command, we have to write our message and then press Ctrl+Z to terminate it. SIM 900 will then send the SMS.

I am doing the same thing as above but not able to send SMS. Following is the code:

putrsUSART("AT+CMGS=\"96********\"\r);   //command with number
putrsUSART("Hello");    //message content
putrsUSART("0x1A");     /to terminate it


but after sending these commands I am not receiving any SMS. I am confused with how to send 0x1A to SIM900. How to actually send hex numbers via UART?

Edit:

I am able to send sms but the sms is empty. I have attached a image of the response:

• To put 0x1A into a string you use an escape sequence like this putrsUSART("\x1A"); – Steve G Jul 25 '16 at 10:31
• Also, I'm not sure that "AT+CMGS=\"96********\"\r makes any sense. Surely it should be "AT+CMGS=96*****\r" – Steve G Jul 25 '16 at 10:36
• @SteveG I have included `("\x1A") and now I am able to send sms but the problem it doesnt have any text. I mean empty SMS. – S Andrew Jul 25 '16 at 10:42
• What is the response or error code from the SIM900? – Steve G Jul 25 '16 at 10:51
• @SteveG I have attached an image of the response – S Andrew Jul 25 '16 at 10:55