summaryrefslogtreecommitdiffstats
path: root/Src/Network/NetworkDeviceListener.h
blob: 719bc5fa08a836fdb346d345892a0710e005b3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
/*
 * Video On Demand Samples
 *
 * Copyright (C) 2015 Microchip Technology Germany II GmbH & Co. KG
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * You may also obtain this software under a propriety license from Microchip.
 * Please contact Microchip for further information.
 *
 */

/*----------------------------------------------------------*/
/*! \file
 *  \brief  This file contains the CNetworkDeviceListener class.
 */
/*----------------------------------------------------------*/
#ifndef _NETWORKDEVICELISTENER_H_
#define _NETWORKDEVICELISTENER_H_

#include <stdint.h>
#include "Types.h"

/*----------------------------------------------------------*/
/*! \brief This class defines callbacks methods which will be called by CNetworkDevice to any
 *         registered listener. Also this class implements empty implementation of each method.
 *         So the integrator has only to override methods, he is interessted in.
 */
/*----------------------------------------------------------*/
class CNetworkDeviceListener
{
public:
    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a sync event has been detected on the server network device.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnSync( void *source, bool isSynced );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a Network State event has been detected on the server network device.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param mpValChanged - true, there was a change in the Maximum Position Information. false, no change.
     *  \param systemNotOk - true, system state changes to NotOk. false, no change.
     *  \param mostAvailable - true, the MOST network is available. false, The MOST network is not available for sending control/packet data.
     *  \param availableSubState - 0=Regular, 2=Diagnosis, 4=RxOnBlocked, 6=ForcedNA, 0x10=Unstable, 0x11=Stable
     *  \param availableTransition - 0=Command, 1=RxActivity, 2=DiagnosisReady, 0x10=Normal, 0x11=SuddenSignalOff, 0x12=CriticalUnlock
     *                               0x13=ErrorSystem, 0xFF=NoTransition
     *  \param nodeAddress - The assigned MOST node address.
     *  \param nodePos - The position in the MOST ring.
     *  \param maxPos - The maximum amount of devices in the MOST ring.
     *  \param packetBW - The amount of bytes reserved for packet channel (MEP/MHP)
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnNetworkState( void *source, bool mpValChanged, bool systemNotOk,
        bool mostAvailable, uint8_t availableSubState, uint8_t availableTransition, uint16_t nodeAddress,
        uint8_t nodePos, uint8_t maxPos, uint16_t packetBW );



    virtual void OnInitCompleteV1( void *source );
    virtual void OnUnlockV1( void *source );
    virtual void OnNetOnV1( void *source, bool isMaster );
    virtual void OnShutDownV1( void *source );
    virtual void OnNprV1( void *source, uint8_t npr );
    virtual void OnMprV1( void *source, uint8_t oldMpr, uint8_t newMpr );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever the MOST had been tried to start.
     *  \param success - true, when the operation was successful.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118 D-Rev
     */
    /*----------------------------------------------------------*/
    virtual void OnNetworkStartupV3( void *source, bool success );


    
    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever the MOST had been tried to shutdown.
     *  \param success - true, when the operation was successful.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118  D-Rev
     */
    /*----------------------------------------------------------*/
    virtual void OnNetworkShutdownV3( void *source, bool success );
    

    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MAC address has been changed in the network.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \param macAddress1 - The 1st byte of the MAC address.
     *  \param macAddress2 - The 2nd byte of the MAC address.
     *  \param macAddress3 - The 3rd byte of the MAC address.
     *  \param macAddress4 - The 4th byte of the MAC address.
     *  \param macAddress5 - The 5th byte of the MAC address.
     *  \param macAddress6 - The 6th byte of the MAC address.
     *  \note This is event will be raised by all INIC APIS (V1 & V2).
     */
    /*----------------------------------------------------------*/
    virtual void OnMostMacAddress( void *source, bool success, uint16_t nodeAddress, uint8_t macAddress1,
        uint8_t macAddress2, uint8_t macAddress3, uint8_t macAddress4, uint8_t macAddress5, uint8_t macAddress6 );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a Device type has been detected.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \param deviceType - Identifier which sorts the MOST device to a specific function group.
     *  \note In this implementation the Device Type is simply derived from the Group Address set in the INIC config string!
     *  \note This is event will be raised by all INIC APIS (V1 & V2).
     */
    /*----------------------------------------------------------*/
    virtual void OnMostDeviceType( void *source, bool success, uint16_t nodeAddress, uint16_t deviceType );


    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever the TSI bus was opened.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnOpenTsiV1( void *source, bool success, uint16_t nodeAddress );

    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a TSI socket was created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param tsiPortInst - The use TSI port.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthMlb - The block width in bytes allocated on the MLB bus.
     *  \param mlbChannelAddress - The MLB channel address (even value).
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or closing this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateTsiSocketV1( void *source, bool success, uint16_t nodeAddr, V1TsiPortInstance_t tsiPortInst,
        EPDataType_t epType, EPDirection_t epDir, uint16_t blockWidthTsi, uint16_t socketHandle, uint32_t tag );

    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever the MLB bus was opened.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnOpenMlbV1( void *source, bool success, uint16_t nodeAddress );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MLB socket was created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthMlb - The block width in bytes allocated on the MLB bus.
     *  \param mlbChannelAddress - The MLB channel address (even value).
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or closing this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateMlbSocketV1( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint16_t blockWidthMlb, uint8_t mlbChannelAddress, uint16_t socketHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MOST socket was created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockwidthMost - The block width in bytes allocated on the MOST bus.
     *  \param connectionLabel - The MOST connection label, which this socket will be bound.
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or closing this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateMostSocketV1( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint16_t blockwidthMost, uint16_t connectionLabel, uint16_t socketHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever two MOST sockets where connected.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param inSocketHandle - The user given IN-handle.
     *  \param outSocketHandle - The user given OUT-handle.
     *  \param connectionHandle - Unique handle for this connection. Use this for disconnecting this connection again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnConnectSocketsV1( void *source, bool success, uint16_t nodeAddr, uint16_t inSocketHandle,
        uint16_t outSocketHandle, uint16_t connectionHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MOST socket was deestroyed.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \param handle - The unique handle for this socket. After this call, the handle is invalid.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnDestroySocketV1( void *source, bool success, uint16_t nodeAddr, uint16_t handle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MOST connection was disconnected.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \param handle - The unique handle for this connection. After this call, the handle is invalid.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 1 event. It is raised from e.g. OS81110
     */
    /*----------------------------------------------------------*/
    virtual void OnDisconnectSocketsV1( void *source, bool success, uint16_t nodeAddr, uint16_t handle, uint32_t tag );




    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a I2S port has been configured.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnOpenI2SPortV1( void *source, bool success, uint16_t nodeAddress, V1I2SPortClkDriveMode_t portMode,
        V1I2SStreamingDataFormat_t format, uint32_t tag );




    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a I2S socket has been created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param portInstance - The I2S port instance. 0 = Port A, 1 = Port B.
     *  \param epDir - he Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthI2S - The block width in bytes allocated on the I2S bus.
     *  \param pin - The physical I2S data pin of the INIC.
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or destroying this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateI2SSocketV1( void *source, bool success, uint16_t nodeAddr, EPDirection_t epDir,
        uint16_t blockWidthI2S, V1I2SPin_t pin, uint16_t socketHandle, uint32_t tag );




    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever the MLB bus was opened.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddress - The device with this MOST node address raised this event.
     *  \param mlbPortHandle - The device with this MOST node address raised this event.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnOpenMlbV3( void *source, bool success, uint16_t nodeAddress, uint16_t mlbPortHandle );




    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a USB socket was created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param endPointAddress - The USB endpoint address, which is now usable.
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or closing this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateUsbSocketV3( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint8_t endPointAddress, uint16_t socketHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a USB socket was created, which uses a Splitter or a Combiner.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param endPointAddress - The USB endpoint address, which is now usable.
     *  \param usbHandle - Unique handle for this USB socket. Do not use this for creating connections!
     *  \param splitterHandle - Unique handle for this Splitter socket. Use this for creating connections or closing this socket again!
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateSplittedUsbSocketV3( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint8_t endPointAddress, uint16_t usbHandle, uint16_t splitterHandle, uint32_t tag );


    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MLB socket was created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthMlb - The block width in bytes allocated on the MLB bus.
     *  \param mlbChannelAddress - The MLB channel address (even value).
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or closing this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateMlbSocketV3( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint16_t blockWidthMlb, uint8_t mlbChannelAddress, uint16_t socketHandle, uint32_t tag );


    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a  MLB socket was created, which uses a Splitter or a Combiner.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthMlb - The block width in bytes allocated on the MLB bus.
     *  \param mlbChannelAddress - The MLB channel address (even value).
     *  \param mlbSocketHandle - Unique handle for this socket. Use this for creating connections or closing this socket again.
     *  \param splitterHandle - Unique handle for this Splitter socket. Use this for creating connections or closing this socket again!
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateSplittedMlbSocketV3( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint16_t blockWidthMlb, uint8_t mlbChannelAddress, uint16_t mlbSocketHandle,
        uint16_t splitterHandle, uint32_t tag );


    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a MOST socket was created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this endpoint.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockwidthMost - The block width in bytes allocated on the MOST bus.
     *  \param connectionLabel - The MOST connection label, which this socket will be bound.
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or destroying this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateMostSocketV3( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        EPDirection_t epDir, uint16_t blockwidthMost, uint16_t connectionLabel, uint16_t socketHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever two MOST sockets where connected.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param epType - The data type, which then will be transmitted on this connection.
     *  \param inSocketHandle - The user given IN-handle.
     *  \param outSocketHandle - The user given OUT-handle.
     *  \param connectionHandle - Unique handle for this connection. Use this for destroying this connection again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnConnectSocketsV3( void *source, bool success, uint16_t nodeAddr, EPDataType_t epType,
        uint16_t inSocketHandle, uint16_t outSocketHandle, uint16_t connectionHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever MOST resources where destroyed.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param amountOfHandles - The amount of resources to be destroyed. (value will be between 1 to 3).
     *  \param pHandle - Pointer to the resource list
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnResourceDestroyV3( void *source, bool success, uint16_t nodeAddr, uint8_t amountOfHandles,
        const uint16_t *pHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a I2S port has been configured.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param portInstance - The I2S port instance. 0 = Port A, 1 = Port B.
     *  \param option - The I2S port option.
     *  \param mode - The I2S clock mode.
     *  \param delay - The I2S delay mode.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnConfigureI2SPortV3( void *source, bool success, uint16_t nodeAddr, uint8_t portInstance,
        V3I2SPortOption_t option, V3I2SClockMode_t mode, V3I2SDelayMode_t delay, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a I2S port has been created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param portInstance - The I2S port instance. 0 = Port A, 1 = Port B.
     *  \param clock - The I2S port speed in multiple of MOST base clock.
     *  \param align - The I2S data format alignment.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateI2SPortV3( void *source, bool success, uint16_t nodeAddr, uint8_t portInstance,
        V3I2SPortSpeed_t clock, V3I2SAlignment_t align, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a I2S socket has been created.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param portInstance - The I2S port instance. 0 = Port A, 1 = Port B.
     *  \param epDir - he Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthI2S - The block width in bytes allocated on the I2S bus.
     *  \param pin - The physical I2S data pin of the INIC.
     *  \param socketHandle - Unique handle for this socket. Use this for creating connections or destroying this socket again.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateI2SSocketV3( void *source, bool success, uint16_t nodeAddr, uint8_t portInstance,
        EPDirection_t epDir, uint16_t blockWidthI2S, V3I2SPin_t pin, uint16_t socketHandle, uint32_t tag );



    /*----------------------------------------------------------*/
    /*! \brief Callback, when ever a I2S socket has been created, which uses a Splitter or a Combiner.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \param portInstance - The I2S port instance. 0 = Port A, 1 = Port B.
     *  \param epDir - The Direction of the stream. (EPDIR_IN == Data from the INIC to the EHC, EPDIR_OUT == Data from the EHC to the INIC)
     *  \param blockWidthI2S - The block width in bytes allocated on the I2S bus.
     *  \param pin - The physical I2S data pin of the INIC.
     *  \param i2sSocketHandle - Unique handle for this socket. Use this for creating connections or destroying this socket again.
     *  \param splitterHandle - Unique handle for this Splitter socket. Use this for creating connections or closing this socket again!
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnCreateSplittedI2SSocketV3( void *source, bool success, uint16_t nodeAddr, uint8_t portInstance,
        EPDirection_t epDir, uint16_t blockWidthI2S, V3I2SPin_t pin, uint16_t i2sSocketHandle, uint16_t splitterHandle,
        uint32_t tag );


    /*----------------------------------------------------------*/
    /*! \brief Callback, when a Ring Break Diagnosis Result was received.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param nodeAddr - The device with this MOST node address raised this event.
     *  \praram result - The ring break diagnosis result 
     *  \param position - Relative position to the ring break.
     *  \param status - Gives information about the activity state.
     *  \param id - The RBD identifier as configured in config string.
     *  \note This is an INIC API Version 3 event. It is raised from e.g. OS81118
     */
    /*----------------------------------------------------------*/
    virtual void OnRbdResultV3( void *source, uint16_t nodeAddress, uint8_t result, uint8_t position, 
        uint8_t status, uint16_t id );


    /*----------------------------------------------------------*/
    /*! \brief Callback, when the MOST control channel receive thread has ended.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     */
    /*----------------------------------------------------------*/
    virtual void OnControlChannelReadEnd( void *source );


    /*----------------------------------------------------------*/
    /*! \brief This callback method is called whenever a MOST control message was sent or received.
     *  \note In order to be informed about this event, derive this class, implement this method and register the class with AddListener method of CNetwork class.
     *  \note The user may interpret the data and sent a corresponding MOST control message via CNetwork::SendMostControlMessage.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param sourceAddr - The MOST source address (may be not accurate)
     *  \param targetAddr - The MOST target address
     *  \param nFBlock - The MOST Function Block Identifier
     *  \param nInst - The MOST Function Block Instance Identifier
     *  \param nFunc - The MOST Function Block Function Identifier
     *  \param nPayloadLen - The amount of bytes stored in Payload
     *  \param Payload - The pointer to the payload byte array.
     * 
     */
    /*----------------------------------------------------------*/
    virtual void OnMostControlMessage( void *source, uint32_t sourceAddr, uint32_t targetAddr, uint32_t nFBlock,
        uint32_t nInst, uint32_t nFunc, uint8_t nOpType, uint32_t nPayloadLen, const uint8_t *Payload );
    
    /*----------------------------------------------------------*/
    /*! \brief This callback method is as result of the DeviceVersion query.
     *  \param source - Cast this pointer to (CNetworkDevice*), it points to server network device, which received this event.
     *  \param success - true, when the operation was successful.
     *  \param sourceAddr - The device with this MOST node address raised this event.
     *  \param productId - Unique identifier that represents the product name.
     *  \param fwVersion - INIC firmware version: Byte[3] Major, Byte[2] Minor, Byte[1] Release.
     *  \param buildVersion - Build version of the firmware.
     *  \param hwVersion - Chip revision number.
     *  \param diagnosisId - Unique diagnosis identifier of the device.
     *  \param tag - Any 32 bit value. This value was passed to the corresponding function call of the CNetworkDevice class.
     */
    /*----------------------------------------------------------*/
    virtual void OnDeviceVersion( void *source, bool success, uint32_t sourceAddr,
        uint32_t productId, uint32_t fwVersion, uint32_t buildVersion, uint8_t hwVersion, uint16_t diagnosisId, uint32_t tag );

};

#endif //_NETWORKDEVICELISTENER_H_