CDX DBC Signal Packing
Offsets identify the signal’s least significant bit using the internal DBC numbering: bit zero is the first byte’s least significant bit. Intel signals continue into increasing byte indices; Motorola signals continue into decreasing byte indices. Motorola offsets are not the DBC file’s external start-MSB notation. Surrounding bits are preserved.
Contents
Functions
| Function | Description |
|---|---|
| CDX_dbc_pack_u32_le | Pack an unsigned, little-endian signal of up to 32 bits. |
| CDX_dbc_pack_u64_le | Pack an unsigned, little-endian signal of up to 64 bits. |
| CDX_dbc_pack_u32_be | Pack an unsigned, big-endian signal of up to 32 bits. |
| CDX_dbc_pack_u64_be | Pack an unsigned, big-endian signal of up to 64 bits. |
Functions
CDX_dbc_pack_u32_le
Pack an unsigned, little-endian signal of up to 32 bits.
1CDX_STATUS CDX_dbc_pack_u32_le(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint32_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes, including CAN-FD data if present.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
- uint32_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:48
CDX_dbc_pack_u64_le
Pack an unsigned, little-endian signal of up to 64 bits.
1CDX_STATUS CDX_dbc_pack_u64_le(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint64_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes.
- uint16_t offset: Least significant bit position in internal DBC numbering.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
- uint64_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:59
CDX_dbc_pack_u32_be
Pack an unsigned, big-endian signal of up to 32 bits.
1CDX_STATUS CDX_dbc_pack_u32_be(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint32_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 32; the entire signal must fit.
- uint32_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:70
CDX_dbc_pack_u64_be
Pack an unsigned, big-endian signal of up to 64 bits.
1CDX_STATUS CDX_dbc_pack_u64_be(void *buffer, uint32_t size, uint16_t offset, uint8_t bits, uint64_t value)retval
CDX_STATUS_OK: Signal packed without modifying other bits.CDX_STATUS_BAD_PARAM: Invalid pointer, width or range; no data changed.
Parameters
- void * buffer: Writable destination; must be nonnull.
- uint32_t size: Destination size in bytes.
- uint16_t offset: Internal start-LSB position, not external Motorola start-MSB.
- uint8_t bits: Signal width, 1 through 64; the entire signal must fit.
- uint64_t value: Raw value; only its least significant bits are written.
Location: cdx_dbc_pack.h:81