GigE |
GigE |
Syntax
INT is_BootBoost (HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParam)
Description
The function is_BootBoost() opens the camera at the system start and allows a faster access to the camera in the running application (see boot boost).
With version 4.50 new commands are added to the boot boost function so that the function can be synchronously enabled or disabled. This means that the function only returns when a change was performed for all affected cameras (IS_BOOTBOOST_CMD_ENABLE_AND_WAIT and IS_BOOTBOOST_CMD_DISABLE_AND_WAIT). Using the IS_BOOTBOOST_CMD_WAIT command allows to synchronize changes of the boot boost configuration to an application.
Note: The change of the camera ID only has an effect on the boot boost mode after reconnecting the camera. If you add a camera to the boot boost list by changing the camera ID, the camera must not be open. |
The nCommand input parameter is used to select the function mode. The pParam input parameter depends on the selected function mode. If you select functions for setting or returning a value, pParam contains a pointer to a variable of the UINT type. The size of the memory area to which pParam refers is specified in the cbSizeOfParam input parameter.
Input parameter
hCam |
Camera handle |
pParam |
Pointer to a function parameter, whose function depends on nCommand. |
cbSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
Contents of the IS_BOOTBOOST_ID structure
IS_BOOTBOOST_ID_MIN |
Smallest valid ID (1) |
IS_BOOTBOOST_ID_MAX |
Biggest valid ID (254) |
IS_BOOTBOOST_ID_NONE |
Special value for no ID (0) |
IS_BOOTBOOST_ID_ALL |
Special value for all IDs (255) |
Contents of the IS_BOOTBOOST_IDLIST structure
DWORD |
u32NumberOfEntries |
Number of listed objects |
IS_BOOTBOOST_ID |
aList |
List information |
Return values
IS_INVALID_PARAMETER |
One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode. |
IS_IO_REQUEST_FAILED |
An IO request from the uEye driver failed. Possibly the versions of the ueye_api.dll (API) and the driver file (ueye_usb.sys or ueye_eth.sys) do not match. |
IS_NO_SUCCESS |
General error message |
IS_NOT_SUPPORTED |
The camera model used here does not support this function or setting. |
IS_SUCCESS |
Function executed successfully |
IS_TIMED_OUT |
A timeout occurred. |
INT nRet = IS_SUCCESS;
// Enable boot boost mode
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_ENABLE, NULL, 0);
// Disable boot boost mode
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_DISABLE, NULL, 0);
UINT u32Enable = 0;
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_GET_ENABLED, (void*)&u32Enable, sizeof(u32Enable));
if (nRet == IS_SUCCESS)
{
if (u32Enable != 0)
{
// Boot boost is enabled
}
}
/* Use case: user changes camera ID */
void ChangeCameraID(HIDS hCam, INT nNewCameraID)
{
INT nRet = IS_SUCCESS;
UINT uTimeout_in_seconds = 30;
/* Disable boot boost mode in synchronous manner.
* Note that we explicitly specify a timeout of 30 seconds here. */
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_DISABLE_AND_WAIT, &uTimeout_in_seconds, sizeof(uTimeout_in_seconds));
if (nRet != IS_SUCCESS)
{
/* Handle error
* Note: nRet is IS_TIMED_OUT if the specified timeout elapsed
* before all cameras have left the boot boost mode. */
}
/* At this point we can rely on the fact that all cameras
* have left the boot boost mode. */
/* Change the camera ID */
nRet = is_SetCameraID(hCam, nNewCameraID);
if (nRet != IS_SUCCESS)
{
/* Handle error */
}
/* Enable boot boost mode in synchronous manner.
* Note that we do not explicitly specify a timeout here;
* the function will apply the default timeout of 60 seconds. */
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_ENABLE_AND_WAIT, NULL, 0);
if (nRet != IS_SUCCESS)
{
/* Handle error
* Note: nRet is IS_TIMED_OUT if the default timeout elapsed
* before all cameras have entered the boot boost mode. */
}
/* At this point we can rely on the fact that all cameras
* that are selected for boot boost
* have entered the boot boost mode
* (if the functions did not report an error code). */
}
INT nRet = IS_SUCCESS;
IS_BOOTBOOST_ID nBootboostValue = 0;
// Add camera ID 5
nBootboostValue = 5;
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_ADD_ID, (void*)&nBootboostValue, sizeof(nBootboostValue));
// Remove camera ID 5
nBootboostValue = 5;
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_REMOVE_ID, (void*)&nBootboostValue,
sizeof(nBootboostValue));
// Set all camera IDs (1 - 254)
nBootboostValue = IS_BOOTBOOST_ID_ALL;
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_ADD_ID, (void*)&nBootboostValue, sizeof(nBootboostValue));
/* Use case: user adds a camera ID to the boot boost list */
void SelectCameraIdForBootBoost(HIDS hCam, IS_BOOTBOOST_ID cameraIdToSelect)
{
INT nRet = IS_SUCCESS;
UINT uTimeout_in_seconds = 30;
/* Add the camera ID to the boot boost ID list. */
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_ADD_ID, &cameraIdToSelect, sizeof(cameraIdToSelect));
if (nRet != IS_SUCCESS)
{
/* Handle error */
}
/* Wait until the changed boot boost configuration was applied by all cameras,
* i.e. all cameras with the added camera ID are in boot boost mode.
* Note that we do not explicitly specify a timeout here;
* the function will apply the default timeout of 60 seconds. */
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_WAIT, NULL, 0);
if (nRet != IS_SUCCESS)
{
/* Handle error
* Note: nRet is IS_TIMED_OUT if the default timeout elapsed
* before all cameras have entered the boot boost mode. */
}
/* At this point we can rely on the fact that all cameras
* that are selected for boot boost have entered the boot boost mode
* (if the functions did not report an error code). */
}
INT nRet = IS_SUCCESS;
// The list has 3 entries
UINT nNumber = 3;
// Calculate the correct size in bytes of the boot boost list
UINT nSize = sizeof(IS_BOOTBOOST_IDLIST) + ((nNumber - 1) * sizeof(IS_BOOTBOOST_ID));
// This line is equivalent
nSize = IS_BOOTBOOST_IDLIST_HEADERSIZE + (nNumber * IS_BOOTBOOST_IDLIST_ELEMENTSIZE);
IS_BOOTBOOST_IDLIST *pBootBoostList = (IS_BOOTBOOST_IDLIST*)new BYTE[nSize];
// Add the IDs 1, 2 and 3
pBootBoostList->aList[0] = 1;
pBootBoostList->aList[1] = 2;
pBootBoostList->aList[2] = 3;
// Do not forget to declare the number of entries!
pBootBoostList->u32NumberOfEntries = 3;
// Set the list
INT nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_SET_IDLIST, (void*)pBootBoostList, nSize);
delete [] pBootBoostList;
pBootBoostList = NULL;
// Clear the list
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_CLEAR_IDLIST, NULL, 0);
INT nRet = IS_SUCCESS;
// Get the size of the boot boost list
UINT nNumber = 0;
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_GET_IDLIST_SIZE, (void*)&nNumber, sizeof(nNumber));
if ((nNumber > 0) && (nRet == IS_SUCCESS))
{
// Calculate the correct size in bytes of the boot boost list
UINT nSize = sizeof(IS_BOOTBOOST_IDLIST) + (nNumber * sizeof(IS_BOOTBOOST_ID));
// This line is equivalent
nSize = IS_BOOTBOOST_IDLIST_HEADERSIZE + (nNumber * IS_BOOTBOOST_IDLIST_ELEMENTSIZE);
IS_BOOTBOOST_IDLIST *pBootBoostList = (IS_BOOTBOOST_IDLIST*)new BYTE[nSize];
// Init the allocated list.
ZeroMemory(pBootBoostList, nSize);
// It is particularly important to tell is_BootBoost() how many items the list can take!
pBootBoostList->u32NumberOfEntries = nNumber;
// Get the list
nRet = is_BootBoost(0, IS_BOOTBOOST_CMD_GET_IDLIST, (void*)m_pBootBoostList, nSize);