Did something like this (but for U2F authentication). It's not that hard, but depending on the library you Do have to play around with C code a bit.

Thankfully, most libraries also come with a open source example on how to use them, most likely some test program that let's you exercise all (or most) hardware function.

So, first thing i usually do is to write a small, low level wrapper library around the original library by hacking up the example code. This will give me the option of abstracting away stuff like memory managment.

On this, my low level wrapper library, i run h2xs to turn it into a low level Perl module. Depending on what i want to do with that, most of the time i create a high level Perl module around THAT to have nice and easy access.

You can kind of see that in Crypt::U2F (which reminds me i have to fix some things and release a new version).

If there's interest, i'll be willing to write up a step-by-step description as a meditation. (Since it's a lot of work, knowing that there is at least one interested reader would be nice).

"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."

In reply to Re: Digilent Inc. Analog Discovery by cavac
in thread Digilent Inc. Analog Discovery by jmlynesjr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.