All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Ranostay <matt.ranostay@konsulko.com>
To: "Gaëtan Carlier" <gcembed@gmail.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: Add support of Wiegand card reader
Date: Tue, 10 Apr 2018 20:37:50 -0700	[thread overview]
Message-ID: <CAJCx=gnN2sBUAOPZEfj=z35YVJjENjP=cLCS3JS73suL-pwfBA@mail.gmail.com> (raw)
In-Reply-To: <07edbbde-ac69-82c1-948b-a14f217cd467@gmail.com>

On Tue, Apr 10, 2018 at 1:57 AM, Ga=C3=ABtan Carlier <gcembed@gmail.com> wr=
ote:
> Hello,
> Thank you for your reply.
>
> On 04/10/2018 01:26 AM, Matt Ranostay wrote:
>> On Mon, Apr 9, 2018 at 7:05 AM, Ga=C3=ABtan Carlier <gcembed@gmail.com> =
wrote:
>>> Hello,
>>> I would like to add support of Wiegand card reader [1]. Where can I pla=
ce it : drivers/iio/access/wiegand.c or drivers/iio/security/wiegand.c?
>>
>> Question here is why is this ideal for iio versus using the input subsys=
tem?
> What can I send to userspace from a bitstream using Input subsystem ?
> Datas on Wiegand depend on readers used/setup. The best is to send bitstr=
eam directly to userspace and let user split bitstream into facilty/area co=
de, card ID, ...
> My idea is to send a structure with
>     * number of bits read
>     * if two parity bits are valid
>     * the bitstream itself saved in a 64 bit unsigned integer (or a buffe=
r of chars) including or not the parity bits (I still have to decide). I do=
n't see readers with more than 60 bits.
>
> I already start writting driver based on humidity/dht11.c that uses simil=
ar timings.

Another question is what would your struct iio_chan_spec definition
look like? Namely the .type assignments

>
>>
>> Also a few issues/points:
>>
>> * What is the interface to the Wiegand data? If it is inputting on a
>> GPIO that is for sure not going to be real time enough to get valid
>> data
> Wiegand protocol uses two data lines. Both data lines are pulled-up. When=
 a 0 must be send, D0 line is set low, when a 1 must be sent, D1 line is se=
t low. D0 and D1 line can never be set low at the same time. Reader will co=
nvert ID of the card into binary data flow of 26, 34, .... 60 bits.
> The length of a data flow is configured in the reader and all readers con=
nected on the same Wiegand bus have generally the same length.
>
>> * Aren't there multiple Wiegand transport standards?
> Yes they are several data length.
>
>> * Most keyreaders I've seen are emulated as keyboard devices so they
>> use the input subsystem.
> If they are emulated as keyboard, they don't use Wiegand anymore ! Wiegan=
d is still often used for hotels, ...
>
>> * Also if the data being output is ASCII data, then I'm not sure that
>> fits anywhere in iioData received from Wiegand bus are bits. They are no=
t packed in 8 bits or any other size.
>
>>
>> - Matt
>>
>>
>>>
>>> Thank you for your help?
>>> Best regards,
>>> Ga=C3=ABtan.
>>>
>>> [1] https://en.wikipedia.org/wiki/Wiegand_interface
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> Regards,
> Ga=C3=ABtan.

  reply	other threads:[~2018-04-11  3:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 14:05 Add support of Wiegand card reader Gaëtan Carlier
2018-04-09 23:26 ` Matt Ranostay
2018-04-10  8:57   ` Gaëtan Carlier
2018-04-11  3:37     ` Matt Ranostay [this message]
2018-04-11  8:36       ` Gaëtan Carlier
2018-04-12  3:41         ` Matt Ranostay
2018-04-12 11:24           ` Jonathan Cameron
2018-04-12 11:30             ` Lars-Peter Clausen
2018-04-12 12:20             ` Gaëtan Carlier
2018-04-12 20:59               ` Matt Ranostay
2018-04-13  8:11                 ` Gaëtan Carlier
2018-04-13 18:44                   ` Matt Ranostay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJCx=gnN2sBUAOPZEfj=z35YVJjENjP=cLCS3JS73suL-pwfBA@mail.gmail.com' \
    --to=matt.ranostay@konsulko.com \
    --cc=gcembed@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.