![]() |
|
|||||||||||||||||||||||||||||||||||||||||||||
Here are the valid indexes:
#include "jcam_dll.h" #include <stdio.h> using namespace joescan; int main(int argc, char * argv[]) { JCONNECTION jc; if((jc = jsOpenConnection("192.168.1.205")) == NULL) { printf("Couldn't open connection.\n"); goto CLEANUP; } switch(jsGetScannerStatusFromScanner(jc)) { case INVALID_PARAMETER: printf("Invalid Parameter.\n"); goto CLEANUP; case SCANNER_FAILURE: printf("Scanner Failure in jsGetScannerStatusFromScanner ().\n"); goto CLEANUP; default: printf("Got status from scanner.\n"); break; } size_t i = 0; int value; char statusDescription[128]; bool finished = false; while(finished == false) { switch(jsGetStatusDescriptionFromScanner(jc, i, statusDescription, 128)) { case INVALID_PARAMETER: printf("Invalid Parameter.\n"); break; case SCANNER_FAILURE: printf("Scanner Failure in jsGetStatusDescriptionFromScanner().\n"); goto CLEANUP; default: break; } switch(jsGetScannerStatusValue (jc, i, &value)) { case INVALID_PARAMETER: printf("%2d Invalid parameter -- Out of bounds index.\n", i); finished = true; break; default: printf("%2d %s %d\n", i, statusDescription, value); break; } ++i; } CLEANUP: jsCloseConnection(jc); jc = NULL; return 0; }
Functions | |
| JCAM_DLL_API int STDCALL | jsGetScannerStatusFromScanner (JCONNECTION const jc) |
Reads status from the scanner into a data structure inside the opaque JCONNECTION. | |
| JCAM_DLL_API int STDCALL | jsGetScannerStatusValue (JCONNECTION const jc, size_t i, int *value) |
Gets the specified status value from the data structure inside the JCONNECTION. | |
| JCAM_DLL_API int STDCALL | jsGetStatusDescriptionFromScanner (JCONNECTION const jc, UINT32 i, char *const description, UINT32 description_length) |
| Reads a descriptive text string from the scanner for the particular status index. | |
| JCAM_DLL_API int STDCALL jsGetScannerStatusFromScanner | ( | JCONNECTION const | jc | ) |
Reads status from the scanner into a data structure inside the opaque JCONNECTION.
| jc | The connection to the scanner. |
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE if the connection closes.
| JCAM_DLL_API int STDCALL jsGetScannerStatusValue | ( | JCONNECTION const | jc, | |
| size_t | i, | |||
| int * | value | |||
| ) |
Gets the specified status value from the data structure inside the JCONNECTION.
| jc | The connection to the scanner. | |
| i | The index of the status value to retrieve. | |
| value | Pointer to an int that will hold the value. |
INVALID_PARAMETER if jc or value is NULL, or if i is out of range.
| JCAM_DLL_API int STDCALL jsGetStatusDescriptionFromScanner | ( | JCONNECTION const | jc, | |
| UINT32 | i, | |||
| char *const | description, | |||
| UINT32 | description_length | |||
| ) |
Reads a descriptive text string from the scanner for the particular status index.
The description length should be a minimum of 128 characters. After this call, description will be properly null-terminated. If description isn't long enough, the result will be truncated, but still properly null-terminated. The first valid index is 0, the last valid index is 12.
Invalid indexes will return the string "ERROR unsuported status type".
| jc | The connection to the scanner. | |
| i | The index of the status name to retrieve. | |
| description | The character buffer that will contain the status name. | |
| description_length | The number of characters that description points to. |
INVALID_PARAMETER if jc or description is NULL, or if i is out of range.
SCANNER_FAILURE if the connection closes.