- maghandle:enable([mask])
- maghandle:trigger([mask])
- maghandle:disable()
SYNOPSIS
DESCRIPTION
By calling magstripe:enable(), the magstripe reader becomes active and will report new magstripe data whenever a card is read. The reader stays active until one of the other two forms is called.
The function magstripe:trigger() works similar to the first form, but the reader will read only a single card and will go inactive afterwards.
Use magstripe:disable() to deactivate an armed reader.
Whenever magnetic data is ready, the callback magstripe.magdataChanged() is called with the data that was read.
The optional mask parameter can be used to select which tracks must be read. It is an integer value, where bit 0 indicates track 1, bit 1 indicates track 2 and bit 2 indicates track 3. If the value is zero, the command disables the reader. By default, all tracks are read.