• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 758
  • Last Modified:

Writing and reading AT cmds using Hp Vee

I have written a program that the user can enter an AT command for a GSM PC Card. Then it displays the results. The program is in a continuous loop until the user type in Exit. However sometimes the serial port times out or just does not give a result, I put an error terminal on the output of the device, which gives the error number 811. I clear the buffer at the start of the program and 20 sec after each command is entered. It works about 80% of the time, which is not good enough, and 20 sec for each command is extremely painful! Does anyone have an example that will help allow me to see more consistent results, using Hp Vee?
  • 2
1 Solution
I have had similar problems on Win2K with a Nokia phone. Any commands effecting the interface need time to take effect so I wait two seconds (SetCommState) on these.

The phone also seems a bit sensitive, so I wait one second after writing anything before reading the response. This makes it a bit slow, but it works almost 100% of the time.

I think my problem, like yours, is connected with serial line handshaking. How have you set that up? Xon/Xoff or Hardware and if hardware how do you control the lines?

On Linux I also use Xon/Xoff. I take the CRTSCTS flag out of c_cflag and insert IXON IXOFF IXANY in c_iflag.

Madmax31Author Commented:
Thanks for the help. Looks like I need to play more with the timing. I have handshaking set to none.
"I have handshaking set to none."


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now