Gracefully closing the socket


I am working with the wavecom radio: 657d09gg.Q24PL001 in order to connect to a server for sending and receiving data.
I am having difficulty switching back to the AT command mode from the data mode. The way it is working right now is when the server closes its TCP socket, I receive a SHUTDOWN message on my mapped UART. Then if I send an AT+WIPCLOSE=2,1, I receive CME ERROR: 843 (since the server has already closed its socket). This causes me to switch to AT mode and then if I issue AT+WIPCLOSE again, I get an OK to that. This ‘kind of’ works, but I am trying to get rid of the CME ERROR and close the socket on my end gracefully.
I realised that I should be sending the AT+WIPCLOSE after I switch back to the AT mode. So, now I tried sending ‘+++’ sequence, but I still receive the CME ERROR: 843 as a response to that. Our application waits 2 secs after the SHUTDOWN response, then sends the first ‘+’, waits 100 msec, sends the second ‘+’, waits 100 msecs and then sends the last ‘+’. After about 650 msecs I receive the CME ERROR: 843 on the mapped UART.
We have one active UART mapped at a time and hence, I cannot use ‘AT+WIPDATA=2,index,0’ from another UART to switch to AT mode.
Any help would be appreciated.
Thanks and Regards,
-Kiran Nagi


Check AT&S and AT&D commands. Maybe it helps.