Hi there!
I am working on a service that sends/ receives SMS using GSM/GPRS modem which is attached to COM port.
I cannot get to connect with the PORT...
Does anyone has any idea how to work it out?
Printable View
Hi there!
I am working on a service that sends/ receives SMS using GSM/GPRS modem which is attached to COM port.
I cannot get to connect with the PORT...
Does anyone has any idea how to work it out?
What is the GetLastError() returned code?
are you seting the baud rate and initialization parameters properly.
-Paresh
well, here it is not giving me any errors...
It simply writes port opened Successfully.
now, I am trying to catch any event so, I did DLL import of SetCommMask and WaitCommEvent...
and now it is not catching any event...
as it is a modem, I think I need to send a modem command like
"AT+CMGL=" and should see its result... that'swhat I am doing at the moment...
and when we talk about setting port parametrs, the winapi function needs a DCB structure... hola! I dont really get to know how to pass this structure through C#...
I think C++ was a better way out, but i opt for C#... hope wont have to go back to C++ for writing this service... :-)
thank you folkz for answers... if you have any idea, will be nice to hear...
Here! I atlast, got to find the solution to this problem.
I hope some other person will be looking for answers to same question... so, here is the link to get some idea about how to do this....
AccessingCOMPorts.html
first of all nice picture of yours ;) ;) :D :D :D
actually, you can do much in VC++ directly. but in C# you have to make use of APIs.
I remember , I did that AT + commands in past. it was a good fun to retrive results.
unfortunately I don't have the code snippet right now. but
I would point you an example,
SerialStream
Which is very known example and you can do stuffs like
read buffer,
write buffer,
open ports etc.
In fact you can send all of the AT+CMGL and all commands.
hope this helps though,
Paresh
Yes Paresh!
I had been working in C++ for quite a long time. but lately, the people here in company started to think about using latst .NET Technology.
As far as my personal opinion, it would have been fun and quite an easy job to MOULD this pretty good project in C++.
Anyways, thanks for replies and the link.
yeah ! Everywhere I see is Just .NET nothing else.
Hi,
I will be greatful if I can get the VC++ code for communicating with GSM modem as soon as possible.It is urgent. Thanks in advance.
-> What port(Com/USB etc) do you use?Quote:
Originally posted by Anil Belankar
Hi,
I will be greatful if I can get the VC++ code for communicating with GSM modem as soon as possible.It is urgent. Thanks in advance.
USB please ...Quote:
-> What port(Com/USB etc) do you use?
Do you want fries with that ? :D
Darwen.