move2docker/build/blocks/ccsds_udp_source_rate_idle_...

101 lines
4.4 KiB
XML

<?xml version="1.0"?>
<block>
<name>Rate controled UDP source with idle frames</name>
<key>ccsds_udp_source_rate_idle_b</key>
<category>[ccsds]</category>
<throttle>1</throttle>
<import>import ccsds</import>
<make>ccsds.udp_source_rate_idle_b($host_recv, $port_recv, $host_ctl, $port_ctl, $max_frame_length, $block_len, $num_blocks_floating, $idle_pattern)</make>
<param>
<name>Hostname (data)</name>
<key>host_recv</key>
<value>'localhost'</value>
<type>string</type>
</param>
<param>
<name>Port (data)</name>
<key>port_recv</key>
<type>int</type>
</param>
<param>
<name>Hostname (control)</name>
<key>host_ctl</key>
<value>'localhost'</value>
<type>string</type>
</param>
<param>
<name>Port (control)</name>
<key>port_ctl</key>
<type>int</type>
</param>
<param>
<name>Max Frame length (Bytes)</name>
<key>max_frame_length</key>
<value>1024</value>
<type>int</type>
</param>
<param>
<name>Block size (Bytes)</name>
<key>block_len</key>
<value>1024</value>
<type>int</type>
</param>
<param>
<name>Num. blocks floating</name>
<key>num_blocks_floating</key>
<value>10</value>
<type>int</type>
</param>
<param>
<name>Idle pattern</name>
<key>idle_pattern</key>
<value>[0x00, 0xFF,]*12</value>
<type>raw</type>
</param>
<check>$port_recv &gt; 0</check>
<check>$port_ctl &gt; 0</check>
<check>$max_frame_length &gt; 0</check>
<check>$block_len &gt; 0</check>
<check>$num_blocks_floating &gt; 0</check>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>byte</type>
</source>
<doc>
UDP source with rate control and idle pattern insertion
This block will keep 'Num. blocks floating' blocks of 'Block size' bytes in the downstream processing. It receives "block_out" messages from a downstream block to be notified once a block has left the processing chain at that block and a new one should be inserted by the source.
It receives datagrams of a maximum size of 'Max Frame length' Bytes over the UDP socket listening to the data hostname and port and buffers them internally. If the internal buffer holds more data than what could be send out in 1 block, it sends a control datagram with the 's' Byte (encoded in ASCII) to the control hostname and port. Once the buffer contains less data than required to fill a complete block, it will send a 'g' Byte (encoded in ASCII) to the control hostname and port.
If a new block has to be send out and there is not enough data in the internal buffer to complete the block, (multiple) copies of the idle patterns are inserted at the back of the buffer.
If an element in the buffer does not completely fit into the current block to be send it is split, such that the rest of the element is send as first item of the next block.
The only block so far that provides the "block_out" message is the output_counter block.
'Hostname (data)' and 'Port (data)':
Hostname and port for the UDP socket on which the data arrives and is stored in the internal buffer. The block will bind to this socket (UDP Server).
'Hostname (control)' and 'Port (control)':
Target hostname and port for the control datagrams 's' and 'g'. The block will only send to this socket, but not bind to it (UDP Client).
'Max Frame length':
Maximum frame (datagram) length in Bytes that can be received over the data socket. This value is only used for buffer allocation.
'Block size':
Number of bytes that constitute one data block. The value entered here must correspond to the block size parameter of the downstream block that provides the "block_out" messages or the flowgrapg between the two blocks will fill up, or run empty over time.
'Num. blocks floating':
Number of data blocks that should be in the flowgraph at the same time.
'Idle pattern':
Python vector of Bytes that form the idle pattern. Everytime a new data block has to be send out and there is not enough data in the internal buffer to fill this data block, one or multiple copies of the idle pattern are added to the end of the internal buffer in order to be able to complete the data block transmission. If transmitted, the idle pattern is always transmitted completely.
</doc>
</block>