UDP Receive
Receive UDP message from UDP host
- Library:
Simulink Support Package for Parrot Minidrones
Description
TheUDP Receiveblock receives UDP message from a UDP host.
The block output,Data作为一维vecto,发出UDP数据包数据r of a specified data type. The block output,Size, emits the size of the data in the UDP buffer. With each sample, the block outputs the bytes of a UDP message as a data vector of the size specified by theData size (N)parameter.
The data type of the block output,Data
, depends on theData typeparameter. The data type of the block output,Size
, isuint16
.Size
represents the total bytes. For example, if theData Type
is double and the number of elements (mentioned using theData size (N)
parameter) is 5, then the value ofSize
is 40, that is, 8*5 bytes.
The block receives the message on the port number specified in theLocal IP portparameter. Match the port number specified in theLocal IP portparameter with the remote port number of the sending host.
Parrot®minidrone is a little-endian device. TheUDP Receiveblock expects the byte order of the received UDP data to be little-endian.
Note
If you are having trouble using UDP to communicate with a computer, the antivirus or firewall software might be blocking UDP traffic. If so, configure the software to allow the traffic for a specific IP port number.