Home Contents | # magstripe.magdataChanged | Magstripe | Core4 Lua Event System

## SYNOPSIS

maghandle.magdataChanged = function(maghandle, rawdata) ...

## DESCRIPTION

This callback runs whenever new magnetic stripe data has been read from the card. It is called from within the event loop.

The parameters are maghandle, which is the original magstripe reader handle, and rawdata, a table containing the raw data bits from the card.

The rawdata table contains one entry for each track that was read. The key of each entry is the track number, the value is a string with the raw data bits from the card. The raw data bits need to be decoded with magstripe.decode() before they are useful.

The reader must be activated before this callback will be called.

## SEE ALSO

magstripe.decode