[SUCS Devel] Door software

Justin Mitchell arthur at sucs.org
Mon Jul 30 12:30:23 BST 2007

On Mon, Jul 30, 2007 at 09:55:56AM +0100, James Frost wrote:
> On 7/30/07, Justin Mitchell <arthur at sucs.org> wrote:
> > the old card reader hardware read only track 2 (numeric only)
> >
> > which contains a start char, the card number, a seperator, and then
> > other junk and a stop char.
> >
> > the other junk tends to be stuff like expiry dates and isnt in
> > any predicatable format that i could see.
> >
> > so if you take only the stuff between the start char and the seperator
> > then you can cope with any card type.
> The current swipe card code (which Dave did, a while ago), looks for
> the card reader returning a value between these two markers:
> STARTPAT = "%N?;"
> ENDPAT = "?+N?"
> It then checks to see whether any of a set of numbers match any of the
> number it's read in. For instance, if it has 2222 in it anywhere, it's
> a student union card. If it has 633191 in it, it's apparently a
> WHSmiths card. And so on.

Well the data on the card is in 5 bit words, top bit being parity,
so this reader has translated that up into ascii space somewhere.

in the original stream, values 0 to 9 were digits '0' to '9',
value 11 was Start, 15 end, and 13 seperator.  the others i didnt encounter.

the wikip article suggests that the values would be remapped to 0x30 to 0x3f
so that start would be ';' stop '?' and seperator '='

but it should be pretty obvious if you print out the card data string

More information about the Devel mailing list