Control Code¶
GetSelectControlCode¶
- Overview
This API gets control code information from the device specified by the deviceHandle.
- Definition
CrError GetSelectControlCode(CrDeviceHandle deviceHandle, CrControlCode code, CrControlCodeInfo** info);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrControlCode |
code
value of control code to get.
Defined in CrControlCode.h as CrControlCode
|
Output parameters
Type |
Explanation |
|---|---|
CrControlCodeInfo** |
info
The control code infomation class pointer.
Developers should pass the address of a modifiable CrControlCodeInfo pointer.
The function will make a copy of the SDK-internal CrControlCodeInfo for the indicated deviceHandle. When function returns successfully, this parameter will point to the copy of CrControlCodeInfo list.
Defined in CrControlCode.h as class CrControlCodeInfo<_class_controlcode>.
|
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the information are returned successfully
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
- Related API
Special note (details)
GetSupportedControlCodes¶
- Overview
This API gets control codes information from the device specified by the deviceHandle.
- Definition
CrError GetSupportedControlCodes(CrDeviceHandle deviceHandle, CrControlCodeInfo** infos, CrInt32u* numOfInfos);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
Output parameters
Type |
Explanation |
|---|---|
CrControlCodeInfo** |
infos
Developers should pass the address of a modifiable CrControlCodeInfo pointer.
The function will make a copy of the SDK-internal CrControlCodeInfo for the indicated deviceHandle. When function returns successfully, this parameter will point to the copy of CrControlCodeInfo list.
Defined in CrControlCode.h as class CrControlCodeInfo<_class_controlcode>.
|
CrInt32u* |
numOfInfos
Number of CrControlCodeInfo class.
|
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the informations are returned successfully
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
Special note (details)
ReleaseControlCodes¶
- Overview
This API function releases the CrControlCodeInfo<_class_controlcode> list allocated by GetSelectControlCode() and GetSupportedControlCodes().
- Definition
CrError ReleaseControlCodes(CrDeviceHandle deviceHandle, CrControlCodeInfo* info);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrControlCodeInfo* |
info
The info pointer pointing to the list to be released.
|
- Output parameters
None
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the control code information list is released successfully
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
- Related API
- Special note (details)
This function releases the CrControlCodeInfo list that is associated with the specified device handle.
ExecuteControlCodeValue¶
- Overview
Requests the SDK to execute the selected control code for the corresponding device.
This API is valid when the CrControlCodeInfo<_class_controlcode> obtained by GetSelectControlCode() is an numeric type.
- Definition
CrError ExecuteControlCodeValue(CrDeviceHandle deviceHandle, CrControlCode code, CrInt64u value);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrControlCode |
code
This parameter sets the control code to be executed.
Defined in CrControlCode.h as CrControlCode
|
CrInt64u |
value
This parameter sets the value to be executed for control code.
|
- Output parameters
None
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the command is executed.
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
- Related API
Special note (details)
The return value of this function does not indicate whether the execution request was successful.
ExecuteControlCodeString¶
- Overview
Requests the SDK to execute the selected control code for the corresponding device.
This API is valid when the CrControlCodeInfo<_class_controlcode> obtained by GetSelectControlCode() is an string type.
- Definition
CrError ExecuteControlCodeString(CrDeviceHandle deviceHandle, CrControlCode code, CrInt16u length, const CrInt16u* value);
Input parameters
Type |
Explanation |
|---|---|
CrDeviceHandle |
deviceHandle |
CrControlCode |
code
This parameter sets the control code to be executed.
Defined in CrControlCode.h as CrControlCode
|
CrInt16u |
length
This parameter should be set to the length of the UTF-16 string specified in ‘value’ + 1(for null-terminate).
|
const CrInt16u* |
value
This parameter sets the UTF-16 string.
|
- Output parameters
None
Return value
Type |
Explanation |
|---|---|
CrError |
CrError_None If the command is executed.
CrError_Init if the SDK is uninitialized
CrError_Generic_InvalidHandle If the deviceHandle is an invalid handle
Other than errors above, see Status code & Error
|
- Related API
Special note (details)
The return value of this function does not indicate whether the execution request was successful.