emartinezv / tesis

ciaaMobile (based on pridolfi/workspace)
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

No clear way of exiting transparent mode or detecting return to command mode when using AT+CIPSTART #2

Closed emartinezv closed 5 years ago

emartinezv commented 5 years ago

The opening of TCP or UDP connections with the gsmGprsOpenPortF function is handled with AT+CIPMODE=1, which means that we operate in transparent mode. That is, after the TCP or UDP connection is established, the modem no longer works in standard command mode but rather in data mode, which sends everything to the remote open port.

The modem exits this mode if the TCP connection is closed remotely or if we send the "+++" sequence with certain timing constraints. However, this has not been implemented in the current code. That is, once the data mode callback function is called, we are stuck there for good.

emartinezv commented 5 years ago

Created function gsmCheckDataMode which checks for the commands the modem uses to indicate it has left data mode ("\r\nOK\r\n" and "\r\nCLOSED\r\n" in the case os the SIM800). The user needs to call this to check his reads inside his dataCback function.