I have a general question regarding the handling of
+KTCP_DATA responses with large receive data (>20000 bytes).
In general, after sending data, we are waiting for the unsolicited responses
+KTCP_DATA: 1,<ndata> in the following way:
(After transmit completed, radio drops back to command mode) …
+KTCP_DATA: 1,1300 <-- First 1300 bytes are ready to be received
AT+KTCPRCV=1,1300 <-- Start receiving CONNECT HTTP/1.1 200 OK Cache-Control: private Content-Type: application/octet-stream .... data... --EOF--Pattern-- OK
Now, switch back to command mode and wait for the next unsolicited
+KTCP_DATA: 1,<ndata> response.
Continue this until all bytes received.
- Is there any way for the radio to know how many total bytes are sent, or do we need to parse the TCP header to determine this?
- Is there any indication from the radio that it is done receiving data, or should we rely on “server closed the connection” notification after all bytes received? Is this a reliable way to do this?