Magnetic Card Reader/Writer
The magnetic card reader/writer enables reading to and writing from a magnetic stripe card.
Data Format
The data format follows the Magtek magnetic strip card specifications.
Quick Overview
Each magnetic card contains three data tracks that can be written to and read from. The data that can be stored on them is as follows:
Track | Capacity |
---|---|
1 | 79 alphanumeric characters |
2 | 40 numeric characters |
3 | 107 numeric characters |
All the tracks can also utilize the following control characters: % ^ ? ; =
.
Functions
Function | Returns | Description |
---|---|---|
write(number track_index, string data) | nil | Sets the buffer of data to be written to a track. Any card swiped after a track's buffer is written will have that track written to. The buffer(s) will remained filled until clear() is called. Note: Setting a buffer to an empty string will clear that track on any swipped cards. Nil will cause that buffer to be ignored. |
clear([number track_index]) | nil | Clears a specified buffer or all if one is not specified |
Events
Event | Return 1 | Return 2 | Return 3 | Return 4 | Description |
---|---|---|---|---|---|
mag_swipe | "mag_swipe" | string track_one | string track_two | string track_three | Queued when a mag card is swiped |