Example
#include <stdio.h> #include "mmsultra.h"
void main (void) |
|
{ | // Command calls status |
short sStatus = 0; | |
LPSCANINFO SScnconfig; | // Scanner data structure |
sStatus = scnOpenScanner(); | // Enable scanner |
if (sStatus ==
printf("Scanner
else {// Configure scanner sStatus = scnGetScanInfo(SScnconfig);
if (sStatus != 0) printf("Scanner is disabled\n");
else {
printf("Scanner is disabled\n"); else
{
printf("Scanning...\n"); | // Perform scan |
sStatus = scnTrigger(1); |
|
if (sStatus != 0) |
|
printf("Scan | |
else |
|
{ |
|
spkBeep(1, 1000); | // Check scanner buffer |
sStatus = scnScannerHit(); | |
if (sStatus == 0) |
|
printf("Scanner buffer is\nempty\n"); | |
else | // Display result |
printf("Bar code scanned was a %d", sStatus); | |
} |
|
} |
|
} |
|
} | // Disable scanner |
sStatus = scnCloseScanner(); |
}