0

Hi I'm working on a project using a fingerprint reader. I would like to know if there is any way to detect incoming data from that device, what I want to do is: When data detected from the fingerprint reader show a form(the form show data from the user detected), but I been searching for methods, and all of them use libraries, if there any way to solve it, without libraries? Thanks.

The reader is a U.are.U. 4500, in using their SDK, but there is any method that check is the fingerprint reader is sending data.

I download LibUSB.net, I would to know if I can solve this problem using this librarie.

user2461687
  • 173
  • 1
  • 13
  • What have you got against libraries? Anything relatively arcane like this is bound to be (no pun intended) best handled by a library created specifically for the scenario (such as fingerprint reading). The maker of the hardware probably provides such, or at least recommends a package. – B. Clay Shannon-B. Crow Raven Mar 04 '16 at 18:35
  • I ask the provider but the only give a sample code (Very useful) but there's any function inside their sdk, for detecting the is the the fingerprint is conected – user2461687 Mar 04 '16 at 18:37
  • Show the sample code and the code you're using, and what you've tried to accomplish your objective. – B. Clay Shannon-B. Crow Raven Mar 04 '16 at 18:46
  • I only do the part for knowing if the USB fingerprint reader is connected – user2461687 Mar 04 '16 at 18:58
  • So if that's not working, show what you've got so far, and explain why it's not working. Do you get an err msg, or it just hangs, or...??? – B. Clay Shannon-B. Crow Raven Mar 04 '16 at 18:59
  • the part of detecting the fingerprint reader is working find – user2461687 Mar 04 '16 at 19:02
  • but what I want to do, is this: when I put the finger above the reader it automatically start to scan the finger, then it is sending data, and I want to know how to detect if I'm recieving data from that USB port, I also know how to detect the port where I've connected the reader – user2461687 Mar 04 '16 at 19:04
  • Okay, your question is a little discombobulating. Do you simply want to invoke a form when data is received, based on the precise data? Such as, if the fingerprint is for John Dillinger, it invokes a form with John Dillinger's data; if it's J.S. Bach's fingerpint, it shows his data, etc.? – B. Clay Shannon-B. Crow Raven Mar 04 '16 at 19:04
  • Yes, all the code is made, but showing tha data, but I want to show a form when I detect info from the selected USB port – user2461687 Mar 04 '16 at 19:08
  • So in the detect event invoke a form. – B. Clay Shannon-B. Crow Raven Mar 04 '16 at 19:08
  • yeah, but it is what I don't know how to do – user2461687 Mar 04 '16 at 19:10
  • I don't know how much knowledge you have of the way USB works, but it seems you want to use USB in a different way than it is designed to work. USB devices don't simply send information. They have a buffer and the host is the one asking for this information. Afaik there is no way around asking for data und waiting until data is returned (either synchronous or asynchronous depending how you want to). Detection meens asking the device if there is data in the buffer and either get the data or an timeout if there is no data. – dryman Mar 07 '16 at 15:26

1 Answers1

0

It sounds like you need something like this:

// event handler
protected void ScanDetected(sender object, args e)
{
    Fingerprint fp = //data received
    RespondToScan(fp);
}

internal void RespondToScan(Fingerprint _fp)
{
   Person who = GetPersonWithFingerprint(_fp);
   PersonForm pf = new PersonForm(who);
   pf.ShowDialog();
}

internal Person GetPersonWithFingerprint(Fingerprint _fp)
{
    Person person = null;
    if (lotsOfSquigglyLinesAndSuch)
    {
       person = new Person();
       person.FirstName = "John";
       person.LastName = "Dillinger";
       . . .
    }
    else if (someOtherCharacteristic)
    {
       . . .
    }
    return person;
}

// Form that will be invoked and display user's data:
class PersonForm: Form
. . .
string _firstname;
string _lastname;
public PersonForm(Person person)
{
    _firstname = person.FirstName;
    . . .             
}

private void FormShow(sender object, eventargs e)
{
    textboxFirstName.Text = _firstName;
    . . .  
}

// class to hold data
public class Person
{
    string FirstName { get; set; }
    string LastName { get; set; }
    Picture Mugshot { get; set; }
    . . .
}

This, of course, is just pseudocode to give you a general idea of how to proceed - provided I understand your situation correctly.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • Well I think I explain my question bad, here's what I want to do: 1. I already detected the usb port where my fingerprint reader is conneted 2. When the fingerprint send data, it doesn't matter what it send, show a form, it doesn't matter the data that the form shows – user2461687 Mar 04 '16 at 19:23