DEVICE DRIVERS
Magnetic Stripe Reader
34 M
X
800 SERIES PROGRAMMERS GUIDE
Magnetic Stripe
Reader
All M
x
800 series of terminals include a triple track magnetic stripe reader.
Accessing the Magnetic Stripe Reader requires linking with the shared library:
libvfimsr.so. The header file msrDevice.h is used by the application to
access the library.
Example Using the Card Reader
// This program reads the card reader device and prints the result to
STDOUT
main()
{ int result;
charbuffer[200];
result = msrOpen( O_RDONLY, NULL );
while(1) /* infinite loop */
{ memset(buffer, 0, sizeof(buffer));
int = msrRead(buffer,sizeof(buffer));
/* wait for input from card reader */
printf("msrRead returned %d bytes of data", result);
}
}