1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>MPCallbackType</title>
9</head>
10
11<body>
12
13<h1>MPCallbackType</h1>
14
15<h2>Definition</h2>
16<dl><dd>
17<pre><code>
18#include &lt;revolution/mp.h&gt;
19
20#define MP_CB_GROUP_MASK            0xffff0000
21#define MP_CB_GROUP_PORT            0x00000000
22#define MP_CB_GROUP_ASYNC           0x00010000
23#define MP_CB_GROUP_INDICATION      0x00020000
24#define MP_CB_GROUP_MPDS            0x00030000
25
26typedef enum
27{
28    MP_PORT_CB_TYPE_NONE            = (MP_CB_GROUP_PORT  | 0x00), // Not used
29    MP_PORT_CB_TYPE_STARTUP         = (MP_CB_GROUP_PORT  | 0x01),
30    MP_PORT_CB_TYPE_CLEANUP         = (MP_CB_GROUP_PORT  | 0x02),
31    MP_PORT_CB_TYPE_DATA_RECEIVED   = (MP_CB_GROUP_PORT  | 0x03),
32    MP_PORT_CB_TYPE_CONNECTED       = (MP_CB_GROUP_PORT  | 0x04),
33    MP_PORT_CB_TYPE_DISCONNECTED    = (MP_CB_GROUP_PORT  | 0x05),
34    MP_ASYNC_CB_TYPE_DATA_SENT      = (MP_CB_GROUP_ASYNC | 0x01),
35    MP_ASYNC_CB_TYPE_BEACON_SENT    = (MP_CB_GROUP_ASYNC | 0x02),
36    MP_INDICATION_CB_TYPE_FATAL_ERROR = (MP_CB_GROUP_INDICATION | 0xff01),
37    MPDS_PORT_CB_TYPE_DATASET_RECEIVED = (MP_CB_GROUP_MPDS | 0x01)
38} MPCallbackType;
39</code></pre>
40</dd></dl>
41
42<H2>Description</H2>
43<p>
44This enumerator indicates the originator of the various MP library callbacks.<br>Used in the <CODE>type</CODE> argument with <a href="MPPortCallback.html"><code>MPPortCallback</code>()</a>. Also used in the <CODE>type</CODE> field of the <a href="MPCallbackInfo.html"><code>MPCallbackInfo</code></a> structure passed by the <CODE>code</CODE> argument with <a href="MPCallback.html"><code>MPCallback</code>()</a>.
45</p>
46<p>
47The <A href="./MPPortCallbackInfo.html"><CODE>MPPortCallbackInfo<CODE></A> member received by the port receive callback function <A href="./MPPortCallback.html"><CODE>MPPortCallback</CODE>()</A> varies, based on the type of the originator.
48</p>
49<TABLE border="1">
50  <TBODY>
51      <tr>
52<th><strong>Member</strong></th>
53<th><strong>Description</strong></th>
54      </tr>
55    <TR>
56<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_PORT_CB_TYPE_STARTUP</strong></em></td>
57<TD width="520">Notified to the Port Receive Callback.<br>Indicates that MP communications have started.</TD>
58    </TR>
59    <TR>
60<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_PORT_CB_TYPE_CLEANUP</strong></em></td>
61<TD width="520">Notified to the Port Receive Callback.<br>Indicates that MP communications have ended.</TD>
62    </TR>
63    <TR>
64<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_PORT_CB_TYPE_DATA_RECEIVED</strong></em></td>
65<TD width="520">Notified to the Port Receive Callback. No notification is sent to the callback function specified by the MPDS library.<br>Indicates that data has been received.</TD>
66    </TR>
67    <TR>
68<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_PORT_CB_TYPE_CONNECTED</strong></em></td>
69<TD width="520">Notified to the Port Receive Callback.<br>Indicates that connection has been made with a child device.</TD>
70    </TR>
71    <TR>
72<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_PORT_CB_TYPE_DISCONNECTED</strong></em></td>
73<TD width="520">Notified to the Port Receive Callback.<br>Indicates that connection has been ended from a child device.</TD>
74    </TR>
75    <TR>
76<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_ASYNC_CB_TYPE_DATA_SENT</strong></em></td>
77<TD width="520">Indicates that this is the callback for the <code><a href="MPSendAsync.html">MPSendAsync</a>()</code> function.</TD>
78    </TR>
79    <TR>
80<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_ASYNC_CB_TYPE_BEACON_SENT</strong></em></td>
81<TD width="520">Indicates that this is the callback for the <code><a href="MPUpdateBeaconAsync.html">MPUpdateBeaconAsync</a>()</code> function.</TD>
82    </TR>
83    <TR>
84<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MP_INDICATION_CB_TYPE_FATAL_ERROR</strong></em></td>
85<TD width="520">Notification is sent to the callback that was set with the <code><A href="MPSetIndicationConfig.html">MPSetIndicationConfig</a>()</code> function.<br>Indicates that an unrecoverable error has occurred.</TD>
86    </TR>
87    <TR>
88<td valign="top" width="120" bgcolor="#ffffe8"><em><strong>MPDS_PORT_CB_TYPE_DATASET_RECEIVED</strong></em></td>
89<TD width="520">Notification is sent to the port receipt callback specified by the MPDS library.<br>Indicates that new shared readable data has been created.</TD>
90    </TR>
91  </TBODY>
92</TABLE>
93
94<h2>See Also</h2>
95<p>
96<code><a href="./MPPortCallback.html">MPPortCallback</a>()</code>, <code><a href="./MPPortCallbackInfo.html">MPPortCallbackInfo</a></code>
97</p>
98
99<H2>Revision History</H2>
100<p>
1012007/11/28 Changed the name, <CODE>MPPortCallbackType</CODE>, to <CODE>MPCallbackType</CODE>.<br>2006/11/28 Initial version.
102</p>
103
104<hr><p>CONFIDENTIAL</p></body>
105</html>
106