ADTF
3.18.2
|
Converter Base Contains the base methods used by all inheriting Converter classes. More...
Static Protected Member Functions | |
static a_util::result::Result | readSignal (uint8_t *buffer, size_t start_bit, size_t bit_length, T *value, Endianess endianess=get_platform_endianess()) |
Read value from bitfield. More... | |
static a_util::result::Result | writeSignal (uint8_t *buffer, size_t start_bit, size_t bit_length, T value, Endianess endianess=get_platform_endianess()) |
Write value to bitfield. More... | |
static a_util::result::Result | cutLeadingBits (uint64_t *value, size_t bit_length) |
Set the highest bits of a uint64_t value to zero. More... | |
static a_util::result::Result | copyBytesFromBuffer (uint8_t *buffer, uint64_t *value, size_t start_bit, size_t bit_length, uint64_t *ninth_byte, size_t *bytes_to_read) |
Copy bytes_to_read number of bytes from the buffer to value and ninth_byte. More... | |
Converter Base Contains the base methods used by all inheriting Converter classes.
Definition at line 74 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
|
inlinestaticprotected |
Copy bytes_to_read number of bytes from the buffer to value and ninth_byte.
Determines how many bytes need to be copied to receive a copy of all bits in the range described by start_bit and bit_length. The maximum for bit_length is 64, but for unaligned values the range may exceed 8 bytes. In this case, the required ninth byte will be copied to ninth_byte.
[in] | buffer | Pointer to the memory buffer to copy from. |
[out] | value | Pointer to the variable to store the copied value in. |
[in] | start_bit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | bit_length | Number of bits to read. |
[out] | ninth_byte | Pointer to the variable to eventually store a copied ninth byte in. |
[out] | bytes_to_read | Number of bytes that need to be copied to attain all requested bits. |
Definition at line 415 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
References a_util::memory::copy().
Referenced by ConverterBase< T >::readSignal(), and ConverterBase< T >::writeSignal().
|
inlinestaticprotected |
Set the highest bits of a uint64_t value to zero.
The number of bit_length lowest bits remain unchanged.
[out] | value | Pointer to the variable to trim. |
[in] | bit_length | Number of trailing bits to remain unchanged. |
Definition at line 385 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
Referenced by ConverterBase< T >::readSignal(), and ConverterBase< T >::writeSignal().
|
inlinestaticprotected |
Read value from bitfield.
Operating on a uint64_t copy to allow bit shifting and masking operations.
[in] | buffer | Pointer to the memory buffer to read from. |
[in] | start_bit | Bit position to start reading from. The least significant bit has the index 0. |
[in] | bit_length | Number of bits to read. |
[out] | value | Pointer to the variable to store the read value in. |
[in] | endianess | Parameter describing the endianess of the bitfield to read from. |
Definition at line 89 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
References a_util::memory::copy(), ConverterBase< T >::copyBytesFromBuffer(), ConverterBase< T >::cutLeadingBits(), and a_util::memory::get_platform_endianess().
Referenced by Converter< T, 0, 0 >::read(), Converter< T, 1, 0 >::read(), and Converter< T, 1, 1 >::read().
|
inlinestaticprotected |
Write value to bitfield.
Operating on a uint64_t copy to allow bit shifting and masking operations.
[in] | buffer | Pointer to the memory buffer to write to. |
[in] | start_bit | Bit position to start writing to. The least significant bit has the index 0. |
[in] | bit_length | Number of bits to write. |
[out] | value | Value to write to the bitfield. |
[in] | endianess | Parameter describing the endianess of the bitfield to write to. |
Definition at line 290 of file workspace/conan/dev_essential/1.3.3/dw/stable/package/37682420cd166e229516a41c8d6a139a0b13e1e1/include/ddl/codec/bitserializer.h.
References a_util::memory::copy(), ConverterBase< T >::copyBytesFromBuffer(), and ConverterBase< T >::cutLeadingBits().
Referenced by Converter< T, 0, 0 >::write(), Converter< T, 1, 0 >::write(), and Converter< T, 1, 1 >::write().