User manual

DCN Next Generation Open Interface Release 2.4 Message Distribution
en | 233
Bosch Communications Systems | 2007 February | SRS_MDINF | Du090902
/* do error handling */
}
else
{
switch (wNrOfInstances)
{
case 0: /* Something went wrong, handle error */
break;
case 1: /* OK */
break;
default:
/* two or more, stop rest until we have one left */
WORD wNewNrOfInstances = 0;
do
{
MD_StopMonMD(&wNewNrOfInstances);
} while (wNewNrOfInstances > 1);
break;
}
}
Now we can receive update notifications. We need a function to receive the update.
void MD_ReqButtonOnOff(MD_T_REQ_BUTTON_ON_OFF* ptReqButton)
{
switch (ptReqButton->byButtonType)
{
case MD_C_AUXILIARY_BUTTON:
if (ptReqButton->bOn)
{
/* Aux button pressed and held, switch on notebook
LED (and switch off other LEDs) */
MD_T_AUX_LED_CTL tAuxLedCtl;
tAuxLedCtl.wUnitId = ptReqButton->wUnitId;
tAuxLedCtl.byLedMask = MD_C_IN_NOTEBOOK_LED;
MD_AuxLedControl(&tAuxLedCtl);
/* handle message further */
}
else
{
/* Aux button released, switch off notebook
LED (and all other LEDs) */
MD_T_AUX_LED_CTL tAuxLedCtl;
tAuxLedCtl.wUnitId = ptReqButton->wUnitId;
tAuxLedCtl.byLedMask = 0;
MD_AuxLedControl(&tAuxLedCtl);
/* handle message further */
}
break;
case MD_C_SPEAKSLOWLY_BUTTON:
/* Handle message */
break;
case MD_C_HELP_BUTTON:
/* Handle message */
break;
}
}
Finally if we are no longer interested in update notifications, we can deregister with the CCU.
wError = MD_StopMonMD(&wNrOfInstances);
if (wError != MD_E_NOERROR)
{
/* do error handling */
}