6 years, 6 months ago.

Does the WNC M14A2A modem support unsolicited messages "@SOCKDATAIND"?

I made changes in the mbed WncController library to support unsolicited message "@SOCKDATAIND" for indicating availability of data on a socket for subsequent read. It seems that the modem never sends the unsolicited message "@SOCKDATAIND". I have to explicitly call "AT@SOCKREAD" to read data from a socket which blocks the calling function until data is available or a timeout. In my application, there are 2 separated RTOS threads, one writing to the WNC socket and the other reading from the same WNC socket. When the read thread is blocked on a read WNC socket operation (waiting for data or timeout), the write thread does not get a chance to send any data on that WNC socket. To get around this problem, I wanted to implement support for unsolicited "@SOCKDATAIND" message, so that I could call a read on the socket only when data is actually available, which ensures that the read thread won't block until timeout.

Question relating to:

Avnet offers a breadth and depth of services capabilities, such as supply-chain and design-chain services, logistics solutions, product assembly, device programming, computer system configuration and integration, financing, marketing services and …


posted by Fred Kellerman 02 Jun 2017

1 Answer

6 years, 6 months ago.

Hi anshumankonwar,

Thanks for asking about this!

Regarding the library as-is (not handling event driven data reception), you don't have to block for a long time, your thread can poll it with little to no delay. The 14A2A will hold onto the data until a read is called to pull it out. It has a fairly large buffer and can hold many datagrams worth of incoming data.

The 14A2A does support unsolicited data notifications but you must upgrade the firmware from what comes in the box. This primarily is why the WncControllerLibrary does not support the @SOCKDATAIND, it was not yet working in the older firmware when we were writing the driver code. https://starterkit.att.com/tutorials/cellular-shield-firmware-upgrade

One other point, with the polling there is no way to tell where one set of data stops and the next begins. If more data comes into the 14A2A before before the 1st is completely read out the higher level protocol has to sort it out. With the data notifications on, when the notification arrives it will show an amount of data available and the amount returned will be for the entire incoming set of data, therefore enabling delineation of the independent separate data.

If you are interested in donating your work, the user community for the 14A2A may be interested in your enhancements. Of course the new feature has to be implemented in a way that retains and is backwards compatible with the existing code.

Hope that helps, best regards!