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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>WMPortRecvCallback</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">WMPortRecvCallback</h1>
15
16<h2>Definition</h2>
17
18<dl>
19  <dd>
20<CODE>#include &lt;nitro/wm.h&gt;</CODE><BR>
21  <PRE><CODE>typedef struct WMPortRecvCallback
22{
23    u16             apiid;
24    u16             errcode;
25    u16             state;
26    u16             port;
27    WMMpRecvBuf*    recvBuf;
28    u16*            data;
29    u16             length;
30    u16             aid;
31    u8              macAddress[6];
32    u16             seqNo;
33    void*           arg;
34    u16             myAid;
35    u16             connectedAidBitmap;
36    u8              ssid[24];
37    u16             reason;
38    u16             rssi;
39    u16             maxSendDataSize;
40    u16             maxRecvDataSize;
41
42}WMPortRecvCallback;</CODE></PRE>
43  </dd>
44
45</dl><h2>Elements</h2>
46<TABLE width="100%">
47  <TBODY>
48    <TR>
49<TD width="200"><CODE>apiid</CODE></TD>
50<TD width="800">ID of the API that acts as the source for the callback generation. It is equivalent to the <A href="WMApiid.html"><code>WMApiid</code></A> enumerated type. This argument is fixed to <code>WM_APIID_PORT_RECV</code>.</TD>
51    </TR>
52    <TR>
53<TD width="200"><CODE>errcode</CODE></TD>
54<TD width="800">Result of the asynchronous process. It is equivalent to the <A href="WMErrCode.html"><code>WMErrCode</code></A> enumerated type.</TD>
55    </TR>
56    <TR>
57<TD width="200"><CODE>state</CODE></TD>
58<TD width="800">If <CODE>errcode</CODE> is <CODE>WM_ERRCODE_SUCCESS</CODE>, the <A href="WMStateCode.html">WM Cause Code</A> generated by the callback is stored. There are five possible causes:.<BR><br><CODE>WM_STATECODE_PORT_INIT</CODE>, <CODE>WM_STATECODE_PORT_RECV</CODE>, <CODE>WM_STATECODE_CONNECTED</CODE>, <CODE>WM_STATECODE_DISCONNECTED</CODE>, <CODE>WM_STATECODE_DISCONNECTED_FROM_MYSELF</CODE></TD>
59    </TR>
60    <TR>
61<TD width="200"><CODE>port</CODE></TD>
62<TD width="800">Port that received the data.</TD>
63    </TR>
64    <TR>
65<TD width="200"><CODE>recvBuf</CODE></TD>
66<TD width="800">Prepared for compatibility with <a href="WMstartMPCallback.html"><code>WMStartMPCallback</code></a>.</TD>
67    </TR>
68    <TR>
69<TD width="200"><CODE>data</CODE></TD>
70<TD width="800">Address of the buffer that received the data.</TD>
71    </TR>
72    <TR>
73<TD width="200"><CODE>length</CODE></TD>
74<TD width="800">Length of the received data.</TD>
75    </TR>
76    <TR>
77<TD width="200"><CODE>aid</CODE></TD>
78<TD width="800">AID of the source that sent the received data. Note that the <code>WM_STATECODE_CONNECTED</code> acknowledgement also contains the AID of the other machine. If a parent machine, it is fixed at 0 (the parent's AID).</TD>
79    </TR>
80    <TR>
81<TD width="200"><CODE>macAddress</CODE></TD>
82<TD width="800">If <CODE>state</CODE> is <CODE>WM_STATECODE_DISCONNECTED</CODE> or <CODE>WM_STATECODE_DISCONNECTED_FROM_MYSELF</CODE>, stores the connected or disconnected child's MAC address.</TD>
83    </TR>
84    <TR>
85<TD width="200"><CODE>seqNo</CODE></TD>
86<TD width="800">Sequence number.</TD>
87    </TR>
88    <TR>
89<TD width="200"><CODE>arg</CODE></TD>
90<TD width="800">Argument that is specified by the <a href="WM_SetPortCallback.html"><code>WM_SetPortCallback</code></a> function.</TD>
91    </TR>
92    <TR>
93<TD width="200"><CODE>myAid</CODE></TD>
94<TD width="800">This machine's AID.</TD>
95    </TR>
96    <TR>
97<TD width="200"><CODE>connectedAidBitmap</CODE></TD>
98<TD width="800">AID bitmap during connection is stored.</TD>
99    </TR>
100    <TR>
101<TD width="200"><CODE>ssid</CODE></TD>
102<TD width="800">SSID specified by the child using <a href="WM_StartConnect.html"><code>WM_StartConnect</code></a>. Only valid during parent's <code>WM_STATECODE_CONNECTED</code> acknowledgement.</TD>
103    </TR>
104    <TR>
105<TD width="200"><CODE>reason</CODE></TD>
106<TD width="800">Code showing the reason for disconnection when the state is <CODE>WM_STATECODE_DISCONNECTED</CODE> or <CODE>WM_STATECODE_DISCONNECTED_FROM_MYSELF</CODE>. This member is used internally in the library for debugging.</TD>
107    </TR>
108    <TR>
109<TD width="200"><CODE>rssi</CODE></TD>
110<TD width="800">Stores the signal intensity when data is received.</TD>
111    </TR>
112    <TR>
113<TD width="200"><CODE>maxSendDataSize</CODE></TD>
114<TD width="800">The size specified for send data.<BR>Stores the parent device send data size when operating as a parent, or the child send data size when operating as a child.</TD>
115    </TR>
116    <TR>
117<TD width="200"><CODE>maxRecvDataSize</CODE></TD>
118<TD width="800">The size specified for received data.<BR>Stores the child device send data size when operating as a parent, or the parent send data size when operating as a child.</TD>
119    </TR>
120  </TBODY>
121</TABLE>
122
123<H2>Description</H2>
124<P>
125This structure is passed to the callback function that is set by the <A href="wm/WM_SetPortCallback.html"><code>WM_SetPortCallback</code></a> function.
126</P>
127
128<H2>Revision History</H2>
129<P>
1302009/01/27 Deleted the rsv member, and added the rssi, maxSendDataSize, and maxSendDataSize members.<BR> 006/02/17 Revised the description of codes returned in <CODE>state</CODE>.<BR>2005/11/14 Restored the description of the rsv members, which was mistakenly deleted.<BR>2005/10/31 Added the connectedAidBitmap and reason members.<BR>2005/02/01 Added a description of the myAid and ssid members.<BR>2004/10/05 Standardized MAC addresses as u8 type arrays.<BR>2004/09/13 Changed <CODE>WM_STATECODE_CHILD_CONNECTED</CODE> to <CODE>WM_STATECODE_CONNECTED</CODE>.<BR> 2004/08/11 Initial version.<BR>
131</P>
132<hr><p>CONFIDENTIAL</p></body>
133</html>
134