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 giving problem

gets function giving problem
Ameya Hardikar

Dear All,

I am trying to read some float values/strings from a serial port. A VB based front end application sends me these values over a serial port.The communication between the front end application and firmware is ok. i.e. I am able to read single characters send by application and application is able to read values which my firmware is sending.
But whenever I try to read values from serial port using gets function or scanf function then sometimes it works and sometimes not. And when it works 'gets' does not assigns all values received to the string variable. e.g. if i am receiving "Ameya" then only "mey" is received.
At the same time this code works fine on a keil debugger. I am using customized forms of putchar() and _getkey() functions...
Also I have tried sending CR/LF characters from VB application for which gets waits..but the problem still persists. I am wondering if it is working with keil debugger what could be problem..? Please help me ..