Skip to main content
Viktor Duma
Associate III
October 19, 2017
Solved

How close socket AT+S.SOCKC?

  • October 19, 2017
  • 2 replies
  • 891 views
Posted on October 19, 2017 at 15:03

Hello! I cant close socket client be command AT+S.SOCKC -  “ERROR: Pending dataâ€� is raised'.  According to UM1695 it should be flushing pending data  (using the AT+S.READ command) is mandatory before closing the socket connection (AT+S.SOCKC). If the buffer is not erased, the “ERROR: Pending dataâ€� is raised. . I cant find description 

AT+S.READ. How can I do that properly?

AT+S.READ

ERROR: Command not found

AT+S.SOCKC=00

ERROR: Pending data

    This topic has been closed for replies.
    Best answer by Elio Cometti
    Posted on October 19, 2017 at 19:20

    AT+S.SOCKQ returns the number of bytes of data waiting on socket specified by socket ID argument.

    In your case:

    AT+S.SOCKQ=00

    DATALEN: xxx

    2 replies

    Elio Cometti
    Visitor II
    October 19, 2017
    Posted on October 19, 2017 at 17:27

    There is a typo in the UM, any occurrence of AT+S.READ must be substituted with AT+S.SOCKR

    Viktor Duma
    Associate III
    October 19, 2017
    Posted on October 19, 2017 at 19:15

    Thank you for the response. And how can  I know exactly data length?

    Elio Cometti
    Visitor II
    October 19, 2017
    Posted on October 19, 2017 at 19:20

    AT+S.SOCKQ returns the number of bytes of data waiting on socket specified by socket ID argument.

    In your case:

    AT+S.SOCKQ=00

    DATALEN: xxx