Documentation ¶
Index ¶
- Constants
- func DecodeRaw(raw []byte, offset byte, bpcRaw, bpcChars int, parityEven bool) (chars []byte, parityOK []bool, lrcOK bool)
- func EncodeRaw(chars []byte, offset byte, bpcRaw, bpcChars int, parityEven bool) []byte
- type Device
- func (d *Device) Close() error
- func (d *Device) Erase(t1, t2, t3 bool) error
- func (d *Device) FirmwareVersion() (string, error)
- func (d *Device) IsHiCo() (bool, error)
- func (d *Device) Model() (string, error)
- func (d *Device) ReadISOTracks() ([]byte, error)
- func (d *Device) ReadRawTracks() ([3][]byte, error)
- func (d *Device) Reset() error
- func (d *Device) SetBitsPerChar(t1, t2, t3 int) error
- func (d *Device) SetBitsPerInch(t1, t2, t3 int) error
- func (d *Device) SetHiCo() error
- func (d *Device) SetLED(mode LEDMode) error
- func (d *Device) SetLoCo() error
- func (d *Device) TestCommunication() error
- func (d *Device) TestRAM() error
- func (d *Device) TestSensor() error
- func (d *Device) WriteISOTracks(t1, t2, t3 []byte) error
- func (d *Device) WriteRawTracks(t1, t2, t3 []byte) error
- type LEDMode
- type Status
Constants ¶
const ( VendorID uint16 = 0x0801 ProductID uint16 = 0x0003 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct { PreSendDelay time.Duration CheckTimeout, SwipeTimeout time.Duration // contains filtered or unexported fields }
func (*Device) Erase ¶
Erase clears the selected tracks on a card. Does not return until a card is swiped or d.SwipeTimeout is reached.
func (*Device) FirmwareVersion ¶
FirmwareVersion returns the device's reported firmware version.
func (*Device) ReadISOTracks ¶
ReadISOTracks reads ISO data from a card. Does not return until a card is swiped or d.SwipeTimeout is reached.
func (*Device) ReadRawTracks ¶
WriteRawTracks reads raw data from a card. Data can be decoded with DecodeRaw. Does not return until a card is swiped or d.SwipeTimeout is reached.
func (*Device) SetBitsPerChar ¶
SetBitsPerChar sets the number of bits (including parity) for each track.
func (*Device) SetBitsPerInch ¶
SetBitsPerInch sets the density of each track in BPI.
func (*Device) TestCommunication ¶
TestCommunication verifies the connection with the device.
func (*Device) TestSensor ¶
TestSensor verifies that the device's card sensing circuit is working. Does not return until a card is sensed or d.SwipeTimeout is reached.
func (*Device) WriteISOTracks ¶
WriteISOTracks writes ISO data to a card. Does not return until a card is swiped or d.SwipeTimeout is reached.
func (*Device) WriteRawTracks ¶
WriteRawTracks writes raw data to a card. Data can be encoded with EncodeRaw. Does not return until a card is swiped or d.SwipeTimeout is reached.