User guide

Redpine Signals, Inc. Proprietary and Confidential. Page 154
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
For the 3000 bytes of the data the wrapper has to send 3 frames to the module.
The uDataoffset (refer to the figure above) shall depend on the socket type.
Frame1: uBufferLength = 1400 bytes
Frame2: uBufferLength = 1400 bytes
Frame3: uBufferLength = 200 bytes
4.10.5 Receive Data on a Socket
Description
The data received from the network is sent to the Host. This is not a command sent
by the Host to module, but the response to a slave read done by the Host to fetch
data received by the module. The Host should identify the type of the frame
received and interact with the corresponding socket application on the reception of
the data.
Relevance
This command is relevant when the TCP/IP stack is enabled.
Frame Body
struct TCP_EVT_Recv
{
UINT16 uSocketDescriptor;
UINT32 uBufferLength;
UINT16 uDataOffset;
struct sockaddr_in stFrom_Address;
UINT8 *pBuffer;
};
Structure Member
Name
Description
uSocketDescriptor
Socket descriptor created
UBufferLength
Length of the data received
UDataOffset
Offset of the data in the buffer.
To avoid redundant “memcpy”.
Similar to the send frame, the buffer
before the data offset would be used
for the UDP/TCP or IP processing.
Refer to the figure below.
stFrom_Address
From address of the received data
PBuffer
Pointer to the buffer comprising the