Example
#include <stdio.h> #include <conio.h> #include "mmsultra.h"
void main (void) |
|
{ | // Command calls status |
short sStatus = 0; | |
char cBuffer[100]; | // Internal scanner buffer |
int iInput = 0; | // Trigger input |
sStatus = scnOpenScanner(); | // Enable scanner |
if (sStatus ==
printf("Scanner
{
// Perform scan
printf("Press trigger to\nscan...\n"); iInput = _getch();
if (iInput == 0) { iInput = _getch(); if (iInput == 0x85) {
sStatus = scnTrigger(1); if (sStatus != 0)
printf("\nScanner
else { | // Get data from scan |
sStatus = scnGetScannedData(cBuffer); | |
if (sStatus <= 0) |
|
printf("Data retrieval | |
else { | // Beep for success |
spkBeep(1, 1000); | |
| // Display result |
printf("Scan data:\n | %s\n", cBuffer); |
printf("Bar code type: %d", sStatus); | |
} |
|
} |
|
} |
|
} |
|
} | // Disable scanner |
sStatus = scnCloseScanner(); |
}