I have a M1306B modem with firmware 6.57c, wip 2.00.31, and OpenAT OS 3.13.2
I have an embedded application which opens the GPRS bearer and a communication socket to a remote host. Over the socket I’m sending small amounts of data, and as long as the AT command mode is enabled, this is working quite well.
But, when I set the UART in V24 (terminal/data) state, the problems occur.
What I see is this:
If I try to connect the GPRS bearer after V24 mode is enabled using the adl_fcmSwitchV24State(fcmHandle, ADL_FCM_V24_STATE_DATA); the GPRS connection fails.
If I first connect the GPRS bearer, and then the socket (using the WIP API in the application) and then enables V24 mode (data mode) I’m unable to send data over the socket. I write the actual data to the socket, but the data are not written to the remote host.
If I then enables AT mode again, (ADL_FCM_V24_STATE_AT) then all the date I’ve written to the socket are sent to the remote host. So, in case 2, all data written to the socket in data mode is buffered and released / sendt when data mode is disabled. I need to send the data I get, without buffering in data mode. How can I disable the buffering that FCM does in data mode when I’m writing to the socket?
I set the UART into Data mode, and have no problem thereafter
establishing a GPRS session.
This is exactly what I try to achieve, but it the connection fails.
First just a little bit about the application.
The modem is connected to a logger which does not support OpenAT and with extreamly limited programming capabilities. AT the same time this equipment is placed in the field running on batteries, and any more hw than absolutely necessary are highly undesired. Therefor we try to use a programmable modem to communicate with the logger. Normally you would use a PLC or similar between the logger and the modem.
To communicate to the logger I need to use FCM mode in order to control the serial line. The logger only accepts a few commands and does not support OpenAT at all. With FCM I can take full controll over the serial line and control the logger. This works well, and I’m able to set the logger up correctly and read the data from the logger.
The data read from the logger must be sent over GPRS, and this is the problem. If I switch to DATA mode before I connect the GPRS bearer the connection fails. If I connect the GPRS bearer and the socket after FCM is enabled, the data are not sent over the TCP/IP connection (but for some reason buffered). If I then switches back to AT mode, all the buffered data are written over the TCP/IP socket at once.
Since I need to listen on the stream from the serial line and respond to requests from the logger, I manually must parse the input and send all data from the logger over the socket (TCP/IP). To achieve this, I want to use the FCM DATA mode on the serial interface, without any interfering from FCM on the GPRS / Socket connection. Is it possible to configure the FCM not to tamper with the GPRS / Socket connection, and just controll the serial line?
Or is there any other way to gain full control over the serial line without using FCM?