sending message from gsm to txtweb service

hello everyone i am trying to send message from gsm to txtweb service special number 51115.here is the code

include "prototype.h"

/************************* GSM INITIALIZATION **********************************/
void gsm_ini()
{
uart_string("AT");
uart_tx(0x0D);
uart_tx(0x0A);
RI = 0;
while(uart_rx() != 'K');

uart_string("ATE0");
uart_tx(0x0D); 
uart_tx(0x0A);
while(uart_rx() != 'K');

uart_string("AT+CNMI=2,2,0,0,0");
uart_tx(0x0D); 
uart_tx(0x0A);  
while(uart_rx() != 'K');

uart_string("AT+CMGF=1");
uart_tx(0x0D); 
uart_tx(0x0A);
while(uart_rx() != 'K');

}

/******************************* GSM SENDING ***********************************/
void gsm_send(unsigned char *num)
{
uart_string("at+cmgs=\"");
uart_string( num );
uart_tx('"');

uart_tx(0x0D); 
uart_tx(0x0A); 

while(uart_rx() != '>');


func();
lcd_cmd(0x01);
lcd_string("Sending....");
    uart_tx(0x1A);

while(uart_rx() != 'K');

lcd_cmd(0x01);
lcd_cmd(0x80);

}
/************************** message function ****************************/
void func()
{
int g;
uart_string("HELP ME!!!!!!");
uart_tx(0x0D);
uart_tx(0x0A);

    uart_string("lattitude:");
    for(g=18;g<29;g++)
    uart_tx(b[g]);

uart_tx(0x0D); 
uart_tx(0x0A);

    uart_string("longitude:");
        for(g=30;g<42;g++)
        uart_tx(b[g]);

}

but i am failing to send the message .please somebody who used txtweb service before please help.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion