Functions | |
int | jsSendProfileRequestN (JCONNECTION const jc, jsLaserIndex const laserIndex) |
Sends a request for a profile from the specified laser. More... | |
int | jsReadProfileN (JCONNECTION const jc, jsProfile *const profile) |
Reads a profile from the connection. More... | |
int | jsGetProfileN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsProfile *const profile) |
Requests and reads a profile from the specified laser. More... | |
int | jsGetProfileFromAllLasers (JCONNECTION const jc, jsProfile *const profiles, size_t const cProfiles) |
Requests and reads a profile from each laser the scanner has. More... | |
int | jsGetImageN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsImage *const image) |
Requests and reads an image with the specified laser on. More... | |
int | jsGetScanN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsScan *const scan) |
Requests and reads a scan with the specified laser on. More... | |
int | jsGetImageScanN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsImage *const image, jsScan *const scan) |
Requests and reads an image and scan with the specified laser on. More... | |
int | jsGetDiagnosticScan (JCONNECTION const jc, int const cameraExposure, int const laserExposure, const jsLaserIndex laserIndex, jsScan *const scan) |
Requests and reads a scan with the specified laser and camera timings. This function requires firmware revision 13817 and higher. More... | |
int | jsGetDiagnosticImageScan (JCONNECTION const jc, int const cameraExposure, int const laserExposure, const jsLaserIndex laserIndex, jsImage *const image, jsScan *const scan) |
Requests and reads an image and scan with the specified laser and camera timings. This function requires firmware revision 13817 and higher. More... | |
These functions allow you to choose which laser to use. While only the JS20-DL has more than one laser, you can use these functions with any JS20 so long as you specify the valid laser, LASER0
.
If you attempt to access an invalid laser, like LASER1
on a single-laser JS20, the connection will close. This is fail-fast behavior. If an empty jsProfile
were returned, people would spend all day trying to figure out why the profile had no data. Now, they'll simply spend all day trying to figure out why the connection died.
You may be thinking to yourself, “Why an enum
instead of an int
?” Good question. The answer is type safety. This way, you can't index an inappropriate laser like -3 - it simply won't compile. You'll have to actively work to index an inappropriate laser instead of having it accidentally happen.
If you still want to use an int
, put the enum
values into an array like this and pass in the value from the array:
int jsGetDiagnosticImageScan | ( | JCONNECTION const | jc, |
int const | cameraExposure, | ||
int const | laserExposure, | ||
const jsLaserIndex | laserIndex, | ||
jsImage *const | image, | ||
jsScan *const | scan | ||
) |
Requests and reads an image and scan with the specified laser and camera timings. This function requires firmware revision 13817 and higher.
jc | The connection to read the image and scan from. |
cameraExposure | The time in microseconds to expose the camera. |
laserExposure | The time in microseconds to expose the laser. |
laserIndex | Which laser to use for the image and scan. |
image | Where the image is stored. |
scan | Where the scan is stored. |
INVALID_PARAMETER
if jc
or scan
is NULL
. SCANNER_FAILURE
on all connection failures.May not be called while the scanner is in Synchronized Scanning Mode.
int jsGetDiagnosticScan | ( | JCONNECTION const | jc, |
int const | cameraExposure, | ||
int const | laserExposure, | ||
const jsLaserIndex | laserIndex, | ||
jsScan *const | scan | ||
) |
Requests and reads a scan with the specified laser and camera timings. This function requires firmware revision 13817 and higher.
jc | The connection to read the scan from. |
cameraExposure | The time in microseconds to expose the camera. |
laserExposure | The time in microseconds to expose the laser. |
laserIndex | Which laser to use for the scan. |
scan | Where the scan is stored. |
INVALID_PARAMETER
if jc
or scan
is NULL
. SCANNER_FAILURE
on all connection failures.May not be called while the scanner is in Synchronized Scanning Mode.
int jsGetImageN | ( | JCONNECTION const | jc, |
jsLaserIndex const | laserIndex, | ||
jsImage *const | image | ||
) |
Requests and reads an image with the specified laser on.
jc | The connection to read the image from. |
laserIndex | Which laser to use for the image. |
image | Where the image is stored. |
INVALID_PARAMETER
if jc
or image
is NULL
. SCANNER_FAILURE
on all connection failures.May not be called while the scanner is in Synchronized Scanning Mode.
int jsGetImageScanN | ( | JCONNECTION const | jc, |
jsLaserIndex const | laserIndex, | ||
jsImage *const | image, | ||
jsScan *const | scan | ||
) |
Requests and reads an image and scan with the specified laser on.
jc | The connection to read the image and scan from. |
laserIndex | Which laser to use for the image and scan. |
image | Where the image is stored. |
scan | Where the scan is stored. |
INVALID_PARAMETER
if jc
or scan
is NULL
. SCANNER_FAILURE
on all connection failures.May not be called while the scanner is in Synchronized Scanning Mode.
int jsGetProfileFromAllLasers | ( | JCONNECTION const | jc, |
jsProfile *const | profiles, | ||
size_t const | cProfiles | ||
) |
Requests and reads a profile from each laser the scanner has.
May not be called while the scanner is in Synchronized Scanning Mode.
If cProfiles
indicates profiles
doesn't have enough space, then extra profiles are discarded. Really, profiles
should point to an array with enough space for a profile from every laser.
jc | The connection to read the profiles from. |
profiles | Pointer to an array of jsProfile's . |
cProfiles | The number of jsProfile's that profiles points to. |
INVALID_PARAMETER
if jc
or profile
is NULL
. SCANNER_FAILURE
on all connection failures. SOCKET_TIMEOUT
if the read took longer than 5 seconds. int jsGetProfileN | ( | JCONNECTION const | jc, |
jsLaserIndex const | laserIndex, | ||
jsProfile *const | profile | ||
) |
Requests and reads a profile from the specified laser.
May not be called while the scanner is in Synchronized Scanning Mode.
jc | The connection to read a profile from. |
laserIndex | Which laser to use for the scan. |
profile | Where the profile is stored. |
INVALID_PARAMETER
if jc
or profile
is NULL
. SCANNER_FAILURE
on all connection failures. SOCKET_TIMEOUT
if the read took longer than 5 seconds. int jsGetScanN | ( | JCONNECTION const | jc, |
jsLaserIndex const | laserIndex, | ||
jsScan *const | scan | ||
) |
Requests and reads a scan with the specified laser on.
jc | The connection to read the scan from. |
laserIndex | Which laser to use for the scan. |
scan | Where the scan is stored. |
INVALID_PARAMETER
if jc
or scan
is NULL
. SCANNER_FAILURE
on all connection failures.May not be called while the scanner is in Synchronized Scanning Mode.
int jsReadProfileN | ( | JCONNECTION const | jc, |
jsProfile *const | profile | ||
) |
Reads a profile from the connection.
May not be called while the scanner is in Synchronized Scanning Mode.
A call to jsSendProfileRequestN()
must have been made to the specified JCONNECTION
before this function is called. Otherwise the call will block and eventually time out waiting for a profile that isn't coming.
Decrements the number of outstanding requests for this connection by one.
jc | The connection to read the profile from. |
profile | Where the profile is stored. |
INVALID_PARAMETER
if jc
or profile
is NULL
. SCANNER_FAILURE
on all connection failures. SOCKET_TIMEOUT
if the read took longer than 5 seconds. int jsSendProfileRequestN | ( | JCONNECTION const | jc, |
jsLaserIndex const | laserIndex | ||
) |
Sends a request for a profile from the specified laser.
May not be called while the scanner is in Synchronized Scanning Mode.
Nothing is read from the connection during this call. Increments the number of outstanding requests for this connection by one.
jc | The connection to send the request to. |
laserIndex | Which laser to use for the scan. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures.