User manual

DCN Next Generation Open Interface Release 2.4 Camera Control
en | 142
Bosch Communications Systems | 2007 February | SRS_CCINF | Du020905
APPENDIX C. EXAMPLES
In the example below the remote functions and update notifications, that are defined in this
document as constant values for the wFnId parameter of the message (see [SRS_INF]), are
presented as functions described in a ā€˜C’ syntax. The parameter structures of these functions
are according the input, output or notify structures described in the appropriate section.
For every function it is assumed that the function will create its structure, transport the
parameters to the CCU and wait for the result information coming from the CCU.
For both the remote functions and the update notifications the same names are used as their
identifier, but without the constant mark ā€œCā€ and using mixed case names. So, e.g. remote
function CC_C_START_CAMERA_APP shall as function be referenced as:
CC_Start_Camera_App (void);
Appendix C.1 Controlling CC application
This example shows the minimum steps to be taken for controlling the CC application
First we have to start controlling the CC application on the CCU.
typedef struct
{
WORD wLength;
BYTE byData[CC_C_MAX_DATA_LEN];
} CC_T_DATA_FRAME;
typedef struct
{
BOOLEAN byCameraActivity;
} CC_T_CAMERA_ACTIVITY;
WORD wError;
wError = CC_Start_Camera_App();
switch (wError)
{
case CC_E_INCONTROL_THIS_CHANNEL:
/* I have the CC app already under control */
/* Is that correct? Has the remote controller restarted? */
/* For the moment assume to be correct and continue */
break;
case CC_E_INCONTROL_OTHER_CHANNEL:
/* Another remote controller has control over the CC application */
/* report error and terminate */
........
break;
case CC_E_NOERROR:
/* function ended succesfully */
break;
default:
/* some unexpected error occurred, report the error */
........
break;
}
We have now established communication with the CC application on the CCU. Since
controlling has now started, update notifications may arrive. Therefore, we need the following
functions:
void CC_Receive_Data(CC_T_DATA_FRAME tDataFrame)
{
/* Handle data of tDataFrame */
}