Functions | |
int | jsFindAllScanners (jsResponsePacket responses[], const size_t nResponses) |
Attempts to discover all scanners on the network. More... | |
int | jsFindScannerByCableId (int const cableId, jsResponsePacket responses[], const size_t nResponses) |
Attempts to discover the scanner(s) on the network with the specified Cable ID. More... | |
int | jsFindScannerBySerialNumber (int const serialNumber, jsResponsePacket responses[], const size_t nResponses) |
Attempts to discover the scanner on the network with the specified serial number. More... | |
Scanner discovery follows a request/response model, whereby the user's application requests scanners that meet certain criteria (it can also request all available scanners), and the scanner(s) respond to the request by sending their ID information. The responses are not guaranteed to be returned in real-time; they're sent via UDP. Consequently, after the request, the functions used for discovering scanners block for approximately one second in order to reasonably ensure that all scanners get their responses in.
If there is a failure, everything will automatically be cleaned up. WSAGetLastError()
can be called to get a more specific reason for failure according to Microsoft's documentation.
Internet-use fields will be explicit as to whether or not they are in network byte order.
int jsFindAllScanners | ( | jsResponsePacket | responses[], |
const size_t | nResponses | ||
) |
Attempts to discover all scanners on the network.
Up to nResponses
from the scanners will be stored in responses
.
Blocks for approximately one second while waiting for responses from the scanners.
responses | An array for holding responses from the scanners on the network. |
nResponses | The number of elements in responses . |
int jsFindScannerByCableId | ( | int const | cableId, |
jsResponsePacket | responses[], | ||
const size_t | nResponses | ||
) |
Attempts to discover the scanner(s) on the network with the specified Cable ID.
If there is more than one scanner with the same Cable ID, they will both respond.
Up to nResponses
from the scanners will be stored in responses
.
Blocks for approximately one second while waiting for responses from the scanners.
cableId | The cable ID of the scanner(s) you want to discover. |
responses | An array for holding responses from the scanners on the network. |
nResponses | The number of elements in responses . |
int jsFindScannerBySerialNumber | ( | int const | serialNumber, |
jsResponsePacket | responses[], | ||
const size_t | nResponses | ||
) |
Attempts to discover the scanner on the network with the specified serial number.
Since serial numbers are unique, there should only ever be one scanner responding to this search.
Up to nResponses
from the scanners will be stored in responses
.
Blocks for approximately one second while waiting for responses from the scanners.
serialNumber | The serial number of the scanner you want to discover. |
responses | An array for holding responses from the scanners on the network. |
nResponses | The number of elements in responses . |