Click here to Skip to main content
15,900,906 members

Comments by Transitional (Top 5 by date)

Transitional 19-Feb-13 4:11am View    
CPallini Do you have any idea, why reading the card using the hid doesn't work for me. My device gets detected but I cannot read it, Filestream.BeginRead() doesn't get any data so it never returns ant the callback doesn't get hit.

I did the reading with raw input and it works fine.
Transitional 14-Feb-13 4:05am View    
The InputReportLength gets its value from the host

public HidpCaps Capabilities;

Int32 result = Hid.HidP_GetCaps(preparsedData, ref deviceInformation.Capabilities); // The HidP_getCaps returns the infromation to HisCaps class.

Debug.WriteLine("usbGenericHidCommunication:queryDeviceCapabilities() -> Input Report Byte Length: {0}", deviceInformation.Capabilities.InputReportByteLength); The InputReportByLength is 48


[StructLayout(LayoutKind.Sequential)]
public struct HidpCaps
{
public System.UInt16 Usage; // USHORT
public System.UInt16 UsagePage; // USHORT
public System.UInt16 InputReportByteLength;
public System.UInt16 OutputReportByteLength;
public System.UInt16 FeatureReportByteLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public System.UInt16[] Reserved; // USHORT Reserved[17];
public System.UInt16 NumberLinkCollectionNodes;
public System.UInt16 NumberInputButtonCaps;
public System.UInt16 NumberInputValueCaps;
public System.UInt16 NumberInputDataIndices;
public System.UInt16 NumberOutputButtonCaps;
public System.UInt16 NumberOutputValueCaps;
public System.UInt16 NumberOutputDataIndices;
public System.UInt16 NumberFeatureButtonCaps;
public System.UInt16 NumberFeatureValueCaps;
public System.UInt16 NumberFeatureDataIndices;
}
}
I wonder if canseek could be the problem, my filestream.canseek = false;
Transitional 13-Feb-13 10:26am View    
Yes I am reading it with de LibUsb library this is written in C. But I would Like to write my own using C#
Transitional 29-Jan-13 10:50am View    
if i understand what you are trying to say. than you should use %5

eq if 25 % 5 is zero than show on screen
Transitional 29-Jan-13 10:04am View    
the problem is i'm getting a lot of data that doesn't make sense. when i run the progranm i sometimes get all zero's and a few non zero values.

But they seems to change everytime I swipe the card. when I use the kernel driver i get something like ;00=000003=003=011220137?
But when i use my program the result is 10-00-0000-01-000-000-000-000-000-000-51-000-000-000-000-000-000-01

Al lot of zero's, so i think im doing something wrong.
And also there is a light on the swiper that turns on when the card is swiped, when I use the kernel driver it turn on and goes of if the card is swiped, but when i use my program it stays on for a while(about 45 seconds) and than goes off.