JCam DLL API Reference
Finding Scanners on the Network

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...
 

Detailed Description

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.

Function Documentation

◆ jsFindAllScanners()

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.

Parameters
responsesAn array for holding responses from the scanners on the network.
nResponsesThe number of elements in responses.
Returns
The number of responses on success.
-1 on all failures.

◆ jsFindScannerByCableId()

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.

Parameters
cableIdThe cable ID of the scanner(s) you want to discover.
responsesAn array for holding responses from the scanners on the network.
nResponsesThe number of elements in responses.
Returns
The number of responses on success.
-1 on all failures.

◆ jsFindScannerBySerialNumber()

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.

Parameters
serialNumberThe serial number of the scanner you want to discover.
responsesAn array for holding responses from the scanners on the network.
nResponsesThe number of elements in responses.
Returns
The number of responses on success.
-1 on all failures.