![Neoway M660 Скачать руководство пользователя страница 74](http://html.mh-extra.com/html/neoway/m660/m660_at-command-manual_1667874074.webp)
Neo_M660 AT Command Set
Copyright © Neoway Technology Co., Ltd
66
12.5 Sending Data to the Client: +TCPSENDS
Description
To send data to the client
Format
AT+TCPSENDS=<socket>,<length><CR>
Parameter
<socket>: The value of
AcceptSocket
, that is, the socket of the module. See the
description of the
AT+TCPLISTEN
command.
<length>: The length of the data to be sent, value ranges from
1
to
1024
, unit: byte.
Return
Value
See the Example.
Example
AT+TCPSENDS=0,10
>1234567890
OK
+TCPSENDS:0,10
10-byte data is successfully sent through link
0.
AT+TCPSENDS=0,536
>1234567890…
+TCPSENDS:Buffer not enough,439
536-byte data is sent on socket 0. Failed to
transmit the data because internal buffer is
insufficient.
Remarks
Ensure that the TCP link has been set up before sending TCP data.
12.6 Querying the Link Status on the Client: +CLIENTSTATUS
Description
To query the status of the link with the client
Format
AT+CLIENTSTATUS=<socket><CR>
AT+CLIENTSTATUS<CR>
Parameter
<socket>: The value of
AcceptSocket
, that is, the socket of the module. See the
description of the
AT+TCPLISTEN
command.
Return
Value
AT+CLIENTSTATUS=<socket> <CR> (Non-transparent transmission)
+CLIENTSTATUS:<socket>,<CONNECT or DISCONNECT>,<TCP>,
<send-buffer-size>
<CONNECT or DISCONNECT>: Link status, value: CONNECT or DISCONNECT
<TCP>: Link type, value: TCP
<send-buffer-size>: The size of the available send buffer on the module, in decimal
ASCII mode, unit: byte
AT+CLIENTSTATUS<CR> (Transparent transmission)
+CLIENTSTATUS:<CONNECT or DISCONNECT>,<TCP>, <send-buffer-size>
<CONNECT or DISCONNECT>: Link status, value: CONNECT or DISCONNECT
<TCP>: Link type, value: TCP
<send-buffer-size>: The size of the available send buffer on the module, in decimal
ASCII mode, unit: byte
Example
AT+CLIENTSTATUS=0
+CLIENTSTATUS:0,CONNECT,TCP,1024
A TCP link has been set up with the
socket 0 client and the buffer size is 1024
bytes.