Class Encoder
Defined in File encoder.hpp
Class Documentation
-
class Encoder
Encodes network messages into FromHost blocks.
Public Functions
-
void set_data_format(int format)
Sets the data format of the encoder.
- Parameters:
format -- FromHost data format supported by firmware.
-
void set_destination_parameters(uint8_t *dest_start, uint32_t dest_size)
set address and size of buffer where encoded messages are written.
- Parameters:
dest_start -- start address of output buffer.
dest_size -- size of output buffer.
-
size_t compute_max_msg_occupancy(size_t size) const
- Parameters:
size -- input message size.
- Returns:
size of encoded message.
-
int compute_full_blocks(size_t size) const
- Parameters:
size -- input message size.
- Returns:
number of full FromHost blocks.
-
size_t compute_final_bytes(size_t size) const
- Parameters:
size -- input message size.
- Returns:
number of bytes in the last block of the encoded message.
-
uint64_t encode_and_write_msg(uint64_t elink, const uint8_t *source, size_t size, uint32_t dest_offset)
encodes the input and write it in the output buffer.
- Parameters:
elink -- of the incoming message.
source -- address of the incoming message.
size -- of the incoming message.
dest_offset -- current write pointer offset in the output buffer.
- Returns:
new write pointer as byte index.
-
void set_data_format(int format)