Functions | |
| int | jsBeginSendParameterFileToScanner (JCONNECTION const jc, char const *const filename) |
Starts sending a parameter file to the scanhead. Must be followed with a called to jsEndSendParameterFileToScanner(). More... | |
| int | jsEndSendParametersToScanner (JCONNECTION const jc) |
Completes the sending of parameters. Should always and only be called after a call to jsBeginSendParameterFileToScanner() or jsBeginSendParametersToScanner(). More... | |
| int | jsSendParameterFileToScanner (JCONNECTION const jc, char const *const filename) |
| Sends a parameter file to the scanhead. More... | |
| int | jsSendParametersToScanner (JCONNECTION const jc, char const *const parameters) |
| Sends parameters to the scanhead. More... | |
| int | jsBeginSendParametersToScanner (JCONNECTION const jc, char const *const parameters) |
Starts sending a parameter string to the scanhead. Must be followed with a called to jsEndSendParametersToScanner(). More... | |
| int | jsGetParameterFileFromScanner (JCONNECTION const jc, char const *const filename) |
| Reads the current parameter file from the scanhead and writes them to the specified file. May not be called while the scanner is in Synchronized Scanning Mode. More... | |
| size_t | jsGetNumberOfErrorMessages (JCONNECTION const jc) |
Returns the number of error messages after a jsSendParameterFileToScanner() call returned OPERATION_FAILURE. More... | |
| char const *const | jsGetErrorMessage (JCONNECTION const jc, size_t i) |
| Returns the specified error message. More... | |
These functions are for sending, reading, and checking correctness of parameter files sent to the scanner.
This sample code opens a connection and sends parameters to the scanner.
Please, please check your error codes from the function. If there is a syntax error in the parameters, the parameters will not be saved to the scanner. You should tell users what the errors are so they can fix them. There are line numbers and everything.
Yes, I realize there are goto statments in this code. It makes things cleaner in this case.
| int jsBeginSendParameterFileToScanner | ( | JCONNECTION const | jc, |
| char const *const | filename | ||
| ) |
Starts sending a parameter file to the scanhead. Must be followed with a called to jsEndSendParameterFileToScanner().
When connecting to large group of scanners, it is much faster to call this for all the scanners first, and then a second loop call the jsEndSendParameterFileToScanner() function. May not be called while the scanner is in Synchronized Scanning Mode.
jsGetErrorMessage() #jsEndSendParameterFileToScanner() jsGetNumberOfErrorMessages() jsGetParameterFileFromScanner() | jc | The connection to the scanner. |
| filename | The name of the file to send to the scanner. |
SCANNER_FAILURE on all connection failures. INVALID_PARAMETER if jc or filename is NULL. | int jsBeginSendParametersToScanner | ( | JCONNECTION const | jc, |
| char const *const | parameters | ||
| ) |
Starts sending a parameter string to the scanhead. Must be followed with a called to jsEndSendParametersToScanner().
When connecting to large group of scanners, it is must faster to call this for all the scanners first, and then a second loop call the jsEndSendParametersToScanner() function. May not be called while the scanner is in Synchronized Scanning Mode.
jsGetErrorMessage() jsEndSendParametersToScanner() jsGetNumberOfErrorMessages() jsGetParameterFileFromScanner() | jc | The connection to the scanner. |
| filename | The name of the file to send to the scanner. |
SCANNER_FAILURE on all connection failures. INVALID_PARAMETER if jc or filename is NULL. | int jsEndSendParametersToScanner | ( | JCONNECTION const | jc | ) |
Completes the sending of parameters. Should always and only be called after a call to jsBeginSendParameterFileToScanner() or jsBeginSendParametersToScanner().
If OPERATION_FAILURE is returned, the error messages should be checked using jsGetNumberOfErrorMessages() and jsGetErrorMessage(). The error messages are stored inside the opaque JCONNECTION. May not be called while the scanner is in Synchronized Scanning Mode.
jsGetErrorMessage() jsBeginSendParameterFileToScanner() jsBeginSendParametersToScanner() jsGetNumberOfErrorMessages() jsGetParameterFileFromScanner() | jc | The connection to the scanner. |
SCANNER_FAILURE on all connection failures. INVALID_PARAMETER if jc or filename is NULL. OPERATION_FAILURE on all other failures, including parse and file I/O errors. | char const* const jsGetErrorMessage | ( | JCONNECTION const | jc, |
| size_t | i | ||
| ) |
Returns the specified error message.
Do not modify the returned string.
| jc | The connection to the scanner. |
| i | The index of the error message to retrieve. |
NULL if i is out of range or jc is NULL. | size_t jsGetNumberOfErrorMessages | ( | JCONNECTION const | jc | ) |
Returns the number of error messages after a jsSendParameterFileToScanner() call returned OPERATION_FAILURE.
| jc | The connection to the scanner. |
jc is NULL. | int jsGetParameterFileFromScanner | ( | JCONNECTION const | jc, |
| char const *const | filename | ||
| ) |
Reads the current parameter file from the scanhead and writes them to the specified file. May not be called while the scanner is in Synchronized Scanning Mode.
| jc | the connection to the scanner. |
| filename | The name of the file to save the parameters in. The file will be created if it doesn't exist. |
SCANNER_FAILURE on all connection failures. INVALID_PARAMETER if jc or filename is NULL. OPERATION_FAILURE on all other failures. | int jsSendParameterFileToScanner | ( | JCONNECTION const | jc, |
| char const *const | filename | ||
| ) |
Sends a parameter file to the scanhead.
If OPERATION_FAILURE is returned, the error messages should be checked using jsGetNumberOfErrorMessages() and jsGetErrorMessage(). The error messages are stored inside the opaque JCONNECTION. May not be called while the scanner is in Synchronized Scanning Mode.
jsGetErrorMessage() jsSendParametersToScanner() jsGetNumberOfErrorMessages() jsGetParameterFileFromScanner() | jc | The connection to the scanner. |
| filename | The name of the file to send to the scanner. |
SCANNER_FAILURE on all connection failures. INVALID_PARAMETER if jc or filename is NULL. OPERATION_FAILURE on all other failures, including parse and file I/O errors. | int jsSendParametersToScanner | ( | JCONNECTION const | jc, |
| char const *const | parameters | ||
| ) |
Sends parameters to the scanhead.
If OPERATION_FAILURE is returned, the error messages should be checked using jsGetNumberOfErrorMessages() and jsGetErrorMessage(). The error messages are stored inside the opaque JCONNECTION. May not be called while the scanner is in Synchronized Scanning Mode.
jsGetErrorMessage() jsGetNumberOfErrorMessages() jsSendParameterFileToScanner() jsGetParameterFileFromScanner() | jc | The connection to the scanner. |
| parameters | A NULL-terminated string with the parameters to send to the scanner. |
SCANNER_FAILURE on all connection failures. INVALID_PARAMETER if jc or parameters is NULL. OPERATION_FAILURE on all other failures, including parse and file I/O errors.