Bosch DCN Next Generation Instrukcja Użytkownika Strona 232

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 296
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 231
DCN Next Generation Open Interface Release 2.4 Message Distribution
en | 232
Bosch Communications Systems | 2007 February | SRS_MDINF | Du090902
APPENDIX C. EXAMPLES
In the example below the remote functions, 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 or output
structures described in the appropriate section.
For every function it is assumed that the function will create these structures (if needed),
transport the parameters to the CCU, waits for the result information coming from the CCU and
deletes the created structures if not needed anymore.
For the remote functions the same names are used as their identifier, but without the constant
mark “C” and using mixed case names. So, e.g. remote function
MD_C_SEND_MESSAGE_TO_UNITS shall be referenced as function as:
MD_SendMessageToUnits(MD_T_SEND_MESS* ptSendMessage);
Appendix C.1 Sending a Message
This example shows the steps to be taken for using the MD application.
In this example, we will send a message to a list of interpreter units. We will assume that these
units exist.
WORD wError;
typedef struct
{
DCNC_LCD_TEXT_BLOCK tText;
WORD wRcvType;
WORD wDuration;
WORD wNumOfUnits;
WORD wUnitList[DBSC_MAX_ACT_UNIT];
} MD_T_SEND_MESS;
typedef struct
{
WORD wUnitId;
BYTE byButtonType;
BOOLEAN bOn;
} MD_T_REQ_BUTTON_ON_OFF;
typedef struct
{
WORD wUnitId;
BYTE byLedMask;
} MD_T_AUX_LED_CTL;
MD_T_SEND_MESS tSendMessage;
tSendMessage.wUnitList[0] = 1; // List with unit id's of interpreters.
tSendMessage.wUnitList[1] = 2;
tSendMessage.wUnitList[2] = 3;
tSendMessage.wUnitList[3] = 4;
tSendMessage.wNumOfUnits = 4;
tSendMessage.tText[0] = "Line 1";
tSendMessage.tText[1] = "Line 2";
tSendMessage.tText[2] = "Line 3";
tSendMessage.tText[3] = "Line 4";
tSendMessage.tText[4] = ""; // Fifth line is a terminating line
tSendMessage.wRcvType = MD_C_RCV_INTERPRETER; /* Send to interpreters. */
tSendMessage.wDuration = 0; /* Only needed for hall displays */
/* Send the message to the listed interpreters. */
wError = MD_SendMessageToUnits(&tSendMessage);
if (wError != MD_E_NOERROR)
{
/* do error handling */
}
If we are interested in receiving update notifications, we must register with the CCU.
WORD wNrOfInstances = 0;
wError = MD_StartMonMD(&wNrOfInstances);
if (wError != MD_E_NOERROR)
{
Przeglądanie stron 231
1 2 ... 227 228 229 230 231 232 233 234 235 236 237 ... 295 296

Komentarze do niniejszej Instrukcji

Brak uwag