pub fn read_version(&self) -> Result<VersionInfo> {
        let mut firmware_version: [u8; 80] = [0; 80];
        let mut dll_version: [u8; 80] = [0; 80];
        let mut api_version: [u8; 80] = [0; 80];
        let res = unsafe { j2534_PassThruReadVersion(self.interface.handle, self.id, firmware_version.as_mut_ptr() as *mut libc::c_char, dll_version.as_mut_ptr() as *mut libc::c_char, api_version.as_mut_ptr() as *mut libc::c_char) };
        if res != 0 {
            return Err(Error::from_code(res));
        }
        unsafe {
            Ok(VersionInfo {
                firmware_version: String::from(ffi::CStr::from_ptr(firmware_version.as_mut_ptr() as *mut libc::c_char).to_str()?),
                api_version: String::from(ffi::CStr::from_ptr(api_version.as_mut_ptr() as *mut libc::c_char).to_str()?),
                dll_version: String::from(ffi::CStr::from_ptr(dll_version.as_mut_ptr() as *mut libc::c_char).to_str()?),
            })
        }
    }
/// Reads the version info of the device
Reads the version info of the device
Reads the version info of the device
pub fn read_version(&self) -> Result<VersionInfo> {
        let mut firmware_version: [u8; 80] = [0; 80];
        let mut dll_version: [u8; 80] = [0; 80];
        let mut api_version: [u8; 80] = [0; 80];
        let res = unsafe { j2534_PassThruReadVersion(self.interface.handle, self.id, firmware_version.as_mut_ptr() as *mut libc::c_char, dll_version.as_mut_ptr() as *mut libc::c_char, api_version.as_mut_ptr() as *mut libc::c_char) };
        if res != 0 {
            return Err(Error::from_code(res));
        }
        unsafe {
            Ok(VersionInfo {
                firmware_version: String::from(ffi::CStr::from_ptr(firmware_version.as_mut_ptr() as *mut libc::c_char).to_str()?),
                api_version: String::from(ffi::CStr::from_ptr(api_version.as_mut_ptr() as *mut libc::c_char).to_str()?),
                dll_version: String::from(ffi::CStr::from_ptr(dll_version.as_mut_ptr() as *mut libc::c_char).to_str()?),
            })
        }
    }
pub fn read_version ( & self ) -> Result < VersionInfo > { let mut firmware_version : [ u8 ; 80 ] = [ 0 ; 80 ] ; let mut dll_version : [ u8 ; 80 ] = [ 0 ; 80 ] ; let mut api_version : [ u8 ; 80 ] = [ 0 ; 80 ] ; let res = unsafe { j2534_PassThruReadVersion ( self . interface . handle , self . id , firmware_version . as_mut_ptr ( ) as * mut libc :: c_char , dll_version . as_mut_ptr ( ) as * mut libc :: c_char , api_version . as_mut_ptr ( ) as * mut libc :: c_char ) } ; if res != 0 { return Err ( Error :: from_code ( res ) ) ; } unsafe { Ok ( VersionInfo { firmware_version : String :: from ( ffi :: CStr :: from_ptr ( firmware_version . as_mut_ptr ( ) as * mut libc :: c_char ) . to_str ( ) ? ) , api_version : String :: from ( ffi :: CStr :: from_ptr ( api_version . as_mut_ptr ( ) as * mut libc :: c_char ) . to_str ( ) ? ) , dll_version : String :: from ( ffi :: CStr :: from_ptr ( dll_version . as_mut_ptr ( ) as * mut libc :: c_char ) . to_str ( ) ? ) , } ) } }
Reads the version info of the device
Reads the version info of the device
&self
&self