I am trying to connect a gps-device to a Q2400A Wavecom modem. This is done through the UART-interface. I do not have access to an other wavecom-modem with gps-support built in.
GPS-device -> serial port -> serial cable -> serial port -> Q2400A
I like to know how i can receive data through the UART.
I know you have different modes for the UART-interface:
Am i correct if i think that if i set the modem in ATO-mode. You can switch between AT-mode and Data-mode with sending a “+++” string?
In data-mode, can i still flash the Wavecom? (Since i need AT+WDWL, AT+Wopen, to program the device). Is this still possible?
And what happens if i send a character over the UART? How can i tell my program, that any character received should be put in a receive-buffer?
I know there is a command ioRead(); but that is just returning ‘OK’.
— Is there something like: getDataFromSerialPort(); ? or “receivebuffer”?
No, the “1 sec silence +++ 1 sec silence” string on the UART1 (serial) interface, will take you from DATA_MODE to AT_MODE.
You switch to DATA_MODE with wm_ioSerialSwitchState function.
You need to be in AT_MODE in order for the command parser to recognize the +WDWL or +WOPEN command. In DATA_MODE are all characters received just considered as data and not parsed by the Wavecom AT-parser.
In DATA_MODE: all characters are concidered as data characters.
This function is only related to the GPIO API. Nothing to do with the dataflow.
This is just my interpretation of how it works, I might have gotten something wrong but if that is the case then I hope that someone smarter will correct me…
Thanks already for answering my questions, it helped me further a lot.
I can’t use the ADL api because im using a Wavcom-device that my school gave me. It has an attached LCD-display, LED’s etc. etc. and all those drivers they gave me are in basic open AT.
And i have received documentation about basic open at and not about the ADL API. It will be quite difficult for me to use the ADL API. (Especially now when im getting used to basic open at).
(sorry for maybe unreadable code)
Am i correct if this bit of code (marked) is triggered when a set of data has been received with the UART?
(Since DSR stands for Data Set Ready)
Where do i find my data which should have been received??
Hi Trout
The code that you have shown only gets triggered by a timer and it will only tell you when in what state the Handshaking lines is
In the document “BUG_Open-AT_Basic_Development_Guide_3-02_v11.pdf” under section 3.5.6 it explains “receiving Data blocks”
under the wm_apmAppliParser() you have to use the
case WM_FCM_RECEIVE_BLOCK:
then you will have a data buffer containing your data.
They have some good information in this section on reading from UART.
I hope this is usefull
Regards
Walter
… The UART should be in DATA-mode. But if i send “AT” it still responds with “OK”.
(I placed above code in the wm_apmAplliInit1(); )
I also did what [color=blue]waltersenekal has told me.
case WM_FCM_RECEIVE_BLOCK :
wm_atSendUnsolicitedExternalApp ( 12, "\r\nReceived\r" );
break;
But i’m not reading anything in my HyperTerminal screen.
So i think i am not switching to ‘DATA_MODE’ correctly and the “WM_FCM_RECEIVE_BLOCK”-case doesn’t get triggered.
Or is ‘wm_atSendUnsolicitedExternalApp’ wrong, because i was in data-mode after all?
I also added:
case WM_IO_SERIAL_SWITCH_STATE_RSP :
wm_atSendUnsolicitedExternalApp ( 8, "\r\nTest\r" );
break;
But i still aint receiving anyting in my HyperTerminal screen. (But if i send “AT” i do receive “OK”).
Second question:
You refer to “BUG_Open-AT_Basic_Development_Guide_3-02_v11.pdf” I only have “BUG_Open_AT_Basic_Development_Guide_002-010.pdf”
On the wavecom-site only v.09 seems to exist.
So where do i get that documentation? (paragraph 3.6.5 does not exist in v.10, so i definitely need it).
(You could also email me at troutdude-at-gmail.com, but if you don’t like to, i’ll accept that).