Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows and LibUsb factory extensions don't match #213

Open
BryanCrotaz opened this issue Jun 28, 2021 · 2 comments
Open

Windows and LibUsb factory extensions don't match #213

BryanCrotaz opened this issue Jun 28, 2021 · 2 comments

Comments

@BryanCrotaz
Copy link

Signatures of Windows and LibUsb extensions don't match:

Windows version will accept List<FilterDeviceDefinition> but LibUsb will only accept ReadOnlyList<FilterDeviceDefinition>

Suggest changing LibUsb to accept IEnumerable<FilterDeviceDefinition> filterDeviceDefinitions which is backwards compatible.

public static IDeviceFactory CreateWindowsUsbDeviceFactory(
        this IEnumerable<FilterDeviceDefinition> filterDeviceDefinitions,
        ILoggerFactory loggerFactory = null,
        GetConnectedDeviceDefinitionsAsync getConnectedDeviceDefinitionsAsync = null,
        GetUsbInterfaceManager getUsbInterfaceManager = null,
        Guid? classGuid = null,
        ushort? readBufferSize = null,
        ushort? writeBufferSize = null
    )

public static IDeviceFactory CreateLibUsbDeviceFactory(
            this IReadOnlyList<FilterDeviceDefinition> filterDeviceDefinitions,
            ILoggerFactory loggerFactory = null,
            int? timeout = null,
            ushort? writeBufferSize = null,
            ushort? readBufferSize = null,
            Func<ConnectedDeviceDefinition, CancellationToken, Task<bool>> supportsDevice = null
            )
@MelbourneDeveloper
Copy link
Owner

They are different beasts really. It's more that the lib USB one needs a refactor and I couldn't really do that until lib USB dotnet is stable.

@MelbourneDeveloper
Copy link
Owner

You shouldn't need to worry about the optional parameters too much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants