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

Fix validate_libFTD2XX_version #44

Open
ReubenHill opened this issue Apr 30, 2019 · 0 comments
Open

Fix validate_libFTD2XX_version #44

ReubenHill opened this issue Apr 30, 2019 · 0 comments

Comments

@ReubenHill
Copy link
Collaborator

ReubenHill commented Apr 30, 2019

validate_libFTD2XX_version uses the function FT_GetLibraryVersion to test version number but then test against using the driver version instead of the library version.

function validate_libFTD2XX_version(name, handle)
    f = Libdl.dlsym_e(handle, "FT_GetLibraryVersion")
    f == C_NULL && return false
    v = Ref{Cuint}()
    s = ccall(f, Culong, (Ref{Cuint},), v)
    s == C_NULL && return false
    if Sys.iswindows()
        return v[] >= 0x00021228 # <- THIS is incorrect.
    else
        return true         # OS X library returns version 0x0000000
    end
end

Windows testing suggests that the library version is v"3.2.14" (see #41) so the below should work instead

function validate_libFTD2XX_version(name, handle)
... # as above
    if Sys.iswindows()
        return v[] >= 0x00030214
    else
        return true         # OS X library returns version 0x0000000
    end
end
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

1 participant