User's Manual

MM Remote Interface Description en | 38
Bosch Security Systems B.V. | 2003 December | MM Remote Interface Description
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 is assumed that the function will create his structure, transport the parameters to the CCU
and waits for the result information coming from the CCU.
For both the remote functions as 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
MM_C_SET_SETTINGS shall be referenced as function as:
MM_Set_Settings (MM_T_CCU_GLOBAL_SETTINGS tMMSettings);
C.1. Microphone Management Control
This example shows the minimum steps to be taken for controlling the MM application.
First we have to start the MM application inside the CCU.
WORD wNrOfInstances;
error = MM_Start_MM(&wNrOfInstances);
if (error != MM_E_NOERROR)
{
/* do error handling */
}
else
{
switch (wNrOfInstances)
{
case 0 : /* something went wrong with registering for remote interface
so, do error handling */
break;
case 1 : /* OK */
break;
default : /* 2 or more. This means there are more remote controllers
identified by the CCU. Stop as many times as needed */
WORD wNewNumber;
do
{
MM_Stop_MM(&wNewNumber);
} while (wNewNumber > 1);
break;
}
}
If there are no errors on starting the MM application the next thing we are interested in are the settings.
Assume that we want the system to operate in a Operator with RTS list mode, 4 active mics and a maximum
RTS list length of 50. The first thing to do is retrieve the current settings, then check them against the wanted
settings and, if they are not the same, set the new settings.
The results in the following control flow:
/* declare variables */
MM_T_CCU_GLOBAL_SETTINGS tMMSettings;
BOOLEAN bMustSend = FALSE;
/* retrieve the current settings */
MM_Get_Settings(&tMMSettings);
/* and check if they are what we want *?
if (tMMSettings.wOperationMode != MM_C_OPERATOR_WITH_REQ_LIST)
{
tMMSettings.wOperationMode = MM_C_OPERATOR_WITH_REQ_LIST;
bMustSend = TRUE;
}
if (tMMSettings.wActiveMics != 4)
{
tMMSettings.wActiveMics = 4);
bMustSend = TRUE;
}
if (tMMSettings.wMaxRTSListLen != 50)
{