Example
#include <conio.h> #include <stdio.h> #include "mmsultra.h"
void main(void) |
|
{ | // Pointer to cBuffer |
char *pStatus2 = NULL; | |
char cBuffer[100]; | // Application buffer |
short sStatus1 = 0; | // Command calls status |
int iInput = 0; | // Trigger input |
sStatus1 = scnOpenScanner(); | // Enable scanner |
if (sStatus1 ==
printf("Scanner open | |
else | // Perform scan |
{ |
printf("Press trigger to\nscan...\n"); iInput = _getch();
if (iInput == 0)
{
iInput = _getch(); if (iInput == 0x85)
{
pStatus2 = scnGets(cBuffer); if (pStatus2 == NULL)
printf("Scanner buffer read error\n"); else
{
spkBeep(1, 1000); | // Beep for success |
| // Display result |
printf("Scan data:\n | %s\n", cBuffer); |
} |
|
} |
|
} |
|
} | // Disable scanner |
sStatus1 = scnCloseScanner(); |
}