import struct


def convert_wire_value(value: int) -> int:
    """Convert endianness of given 32-bit value.

    Big Endian values become Little Endian and Little Endian values become Big Endian.

    Specifically for use when reading wire_out values from OK device or simulator
    """
    converted_value: int = struct.unpack("<I", struct.pack(">I", value))[0]
    return converted_value