Function isPdoMappingEntry

  • Checks if a string is a valid representation of a CANopen PDO mapping entry.

    A valid entry is a 32-bit hexadecimal value representing:

    • Index (16 bits)
    • Subindex (8 bits)
    • Bit Length (8 bits)

    It accepts formats with or without the '0x' prefix (e.g., "0x60400010" or "60400010").

    Returns

    true if the string follows the PDO mapping entry hex format, false otherwise.

    Example

    isPdoMappingEntry('0x60400010'); // true
    isPdoMappingEntry('60400010'); // true
    isPdoMappingEntry('invalid'); // false

    Parameters

    • value: string

      The string to validate.

    Returns boolean

Generated using TypeDoc