Function flattenUiPdoMapping

  • Flattens a PDO mapping into an array of [deviceRef, index, subindex] entries.

    This function iterates over both RX and TX PDOs in the provided pdoMapping and extracts the index and subindex from each 32-bit PDO entry using parsePdoSubItemValue.

    Returns

    An array where each item is a tuple [deviceRef, index, subindex].

    Example

    const deviceRef = 1;
    const flatArray = flattenUiPdoMapping(deviceRef, uiPdoMapping);
    // flatArray will contain tuples like [deviceRef, 0x2012, 0x01]

    Parameters

    • deviceRef: DeviceRef

      The reference to the device associated with this PDO mapping.

    • pdoMapping: UiPdoMapping

      The UI PDO mapping object containing RX and TX PDO entries.

    Returns [DeviceRef, number, number][]

Generated using TypeDoc