JoeScan
  home
our story
news  and events
contact us
    our products
how it works
applications support service

Finding Scanners on the Network


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.


Functions

JCAM_DLL_API int STDCALL jsFindAllScanners (jsResponsePacket responses[], const size_t nResponses)
 Attempts to discover all scanners on the network.
JCAM_DLL_API int STDCALL jsFindScannerByCableId (int const cableId, jsResponsePacket responses[], const size_t nResponses)
 Attempts to discover the scanner(s) on the network with the specified Cable ID.
JCAM_DLL_API int STDCALL jsFindScannerBySerialNumber (int const serialNumber, jsResponsePacket responses[], const size_t nResponses)
 Attempts to discover the scanner on the network with the specified serial number.

Function Documentation

JCAM_DLL_API int STDCALL 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:
responses An array for holding responses from the scanners on the network.
nResponses The number of elements in responses.
Returns:
The number of responses on success.

-1 on all failures.

JCAM_DLL_API int STDCALL 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:
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.
Returns:
The number of responses on success.

-1 on all failures.

JCAM_DLL_API int STDCALL 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:
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.
Returns:
The number of responses on success.

-1 on all failures.