This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

gets function

hi

I have connected to the RXD, TXD signals of 8031 to PC. The 8031 is sending a string AT+cmgrusing printf statement (hyper terminal display AT+cmgr, when i type message successful in hyperterminal (8031 is receiving this message and storing the same in the 8031 external memory)

Now i have connected the TXD and RXD signals of 8031 to GSM modem and sending a command
AT+cmgs = 9845055406 0x0d using printf command
"send sms" 0x1A using printf statement, TheGSM modem is sending sms.

When i try to read the message from gsm modem (using function gets) it is not working

any help to solve this problem

thanks
aswathnarayana

Parents Reply Children
  • What, if anything, is your GSM modem sending? Do you get any characters at all over the serial port?

    gets() will wait until it receives a "newline" character (one or both of ASCII CR / LF). The actual definition of "newline" varies from platform to platform. Are you sure your modem produces the same "newline" that the Keil gets() is expecting?

    Experiment with your own routine using getchar() (or just peek at the code in the LIB/_getkey.c file) to see what's really coming in over the serial port.

  • "The actual definition of "newline" varies from platform to platform."

    With modems, it can be specified via an S-Register - see the modem's Manual