User guide

Redpine Signals, Inc. Proprietary and Confidential. Page 55
R
R
S
S
9
9
1
1
1
1
0
0
-
-
N
N
-
-
1
1
1
1
-
-
2
2
2
2
/
/
2
2
4
4
/
/
2
2
8
8
S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e
P
P
r
r
o
o
g
g
r
r
a
a
m
m
m
m
i
i
n
n
g
g
R
R
e
e
f
f
e
e
r
r
e
e
n
n
c
c
e
e
M
M
a
a
n
n
u
u
a
a
l
l
V
V
e
e
r
r
s
s
i
i
o
o
n
n
4
4
.
.
1
1
5
5
3.4.10 Receive data on a Socket
Description
The RS9110-N-11-2X module delivers the data obtained on a socket to the Host
with this message. This is an asynchronous operation and NOT one that the host
can invoke in the module. It is sent from the module to the host when the
module receives data from a remote terminal. The data received by the module
is sent to the host through this command.
Message
AT+RSI_READ (returned in upper case)
Usage
AT+RSI_READ<hn><sz><Sip><Sport><stream>\r\n
Parameters
hn (1 byte) – TCP/UDP socket handle of an already open socket. Returned in
Hex.
Sz (2 bytes) – Number of bytes received. Sz = 0 indicates remote termination
for a TCP socket. Returned in hex. For example, 900 bytes (0x0384) would be
sent as <0x84> <0x03>
Sip (4 bytes) – Source IP address. Returned in hex. For example, if the IP
address is 192.168.1.1, then <0xC0><0xA8><0x01><0x01> is returned
Sport (2 bytes) – Source port. Returned in hex. For example, if the port number
is 8001 (0x1F41) , it is returned as <0x41> <0x1F>
Stream – data stream, returned in ASCII. Example, “abcd” would be sent as
<0x61><0x62><0x63><0x64>. A maximum of 1460 bytes can be received
through a TCP socket and 1472 bytes through a UDP socket, in one
AT+RSI_READ response. When the module sends data to the Host, byte stuffing
is NOT done by the module, and the data is sent as it was received by the
module from the wireless media. The <sz> field should be used to know how
many bytes of valid data is expected.
Example 1, if „abcd‟ is sent from remote terminal to module, on an UDP socket
with handle 1, from source ip 192.168.1.20 and source port 8001, the module
sends the following response to the host.
AT+RSI_READ 1 4 192 168 1 1 8001 abcd \r\n
………………………..
0x41 0x54 0x2B 0x52 0x53 0x49 0x5F 0x52 0x45 0x41 0x44 0x01 0x04 0x00
0xC0 0xA8 0x01 0x01 0x41 0x1F 0x61 0x62 0x63 0x64 0x0D 0x0A
Example 2, if „abcd‟ is sent from remote terminal to module, on a TCP socket
with handle 1, the module sends the following response to the host.