@flux-control/effect-modbus-rs
    Preparing search index...

    Function resolveSerialPortPath

    • Gives a serial port path that modbus-rs accepts.

      Stable device links, such as /dev/serial/by-id/..., can be longer than MAX_SERIAL_PORT_PATH. Such a link points to a short device path, so a long path is replaced with its target. This function resolves one snapshot. Transport services keep a short alias to the configured path for reconnects.

      Parameters

      • portPath: string

        The configured serial port path.

      Returns Promise<string>

      The configured path, or the target of a long path.

      An error with the MODBUS_INVALID_ARGUMENT code when the path and its target are both too long. The same error occurs when a long link has no target, for example while its device is unplugged. Retry policies do not retry this error. A later open succeeds after the device returns.