def METHOD_NAME(session, conn_type, info, transport, await_reboot):
    need_reboot = conn_type == SmartCardConnection and (4, 0) <= info.version < (5, 5)
    if need_reboot and info.version[0] == 4:
        pytest.skip("Can't read config")
    def call():
        otp = session
        if need_reboot:
            protocol = session.backend.protocol
            if transport == TRANSPORT.NFC:
                protocol.connection.connection.disconnect()
                conn = protocol.connection
                conn.connection.connect()
            else:
                ManagementSession(protocol.connection).write_device_config(reboot=True)
                await_reboot()
                devs = list_all_devices([SmartCardConnection])
                if len(devs) != 1:
                    raise Exception("More than one YubiKey connected")
                dev, info2 = devs[0]
                if info.serial != info2.serial:
                    raise Exception("Connected YubiKey has wrong serial")
                conn = dev.open_connection(SmartCardConnection)
            otp = YubiOtpSession(conn)
            session.backend = otp.backend
        return otp.get_config_state()
    return call