|
@@ -30,6 +30,33 @@ extern "C" {
|
30
|
30
|
extern cmRtNetH_t cmRtNetNullHandle;
|
31
|
31
|
extern cmRtNetEndptH_t cmRtNetEndptNullHandle;
|
32
|
32
|
|
|
33
|
+
|
|
34
|
+ // selector id's for cmRtNetSyncMsg_t.selId.
|
|
35
|
+ typedef enum
|
|
36
|
+ {
|
|
37
|
+ kHelloSelNetId, // broadcast msg (label=node label, id=endpt cnt)
|
|
38
|
+ kNodeSelNetId, // define remote node (label=remote node label, id=endpt cnt)
|
|
39
|
+ kEndpointSelNetId, // define remote endpt (label=remote endpt label, id=endpt id)
|
|
40
|
+ kDoneSelNetId, // declare all endpts sent
|
|
41
|
+ kInvalidSelNetId
|
|
42
|
+ } cmRtNetSelId_t;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+ // Network synchronization message format.
|
|
46
|
+ // cmRtNetRC_t.hdr.selId == kNetSyncSelRtid.
|
|
47
|
+ typedef struct
|
|
48
|
+ {
|
|
49
|
+ cmRtSysMsgHdr_t hdr; // standard cmRtSys msg header
|
|
50
|
+ cmRtNetSelId_t selId; // message selector id (See kXXXSelNetId above)
|
|
51
|
+ const cmChar_t* label; // node or endpoint label
|
|
52
|
+ unsigned id; // endptCnt or endpoint id
|
|
53
|
+ unsigned rtSubIdx; // cmInvalidIdx or rtSubIdx
|
|
54
|
+ } cmRtNetSyncMsg_t;
|
|
55
|
+
|
|
56
|
+ // NOTE: Messages passed between cmRtNet nodes during the synchronization
|
|
57
|
+ // process use the cmRtNetSyncMsg_t format (w/ the body of label following
|
|
58
|
+ // the record. All other messages use cmRtNetMsg_t (cmRtSysMsg.h) format.
|
|
59
|
+
|
33
|
60
|
// 'cbFunc' will be called within the context of cmRtNetReceive() to receive
|
34
|
61
|
// incoming network messages.
|
35
|
62
|
cmRtNetRC_t cmRtNetAlloc( cmCtx_t* ctx, cmRtNetH_t* hp, cmUdpCallback_t cbFunc, void* cbArg );
|
|
@@ -67,7 +94,7 @@ extern "C" {
|
67
|
94
|
// This function must be polled to receive incoming network messages
|
68
|
95
|
// via the callback funcion 'cbFunc' as passed to cmRtNetAlloc().
|
69
|
96
|
// Note that all messages received via 'cbFunc' will be prefixed with
|
70
|
|
- // an cmRtNetMsg_t header (See cmRtSysMsg.h).
|
|
97
|
+ // an cmRtSysMsgHdr_t header (See cmRtSysMsg.h).
|
71
|
98
|
cmRtNetRC_t cmRtNetReceive( cmRtNetH_t h );
|
72
|
99
|
|
73
|
100
|
// Get an end point handle for use with cmRtNetSend.
|