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.2.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>WM_SetWEPKey</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">WM_SetWEPKey <img src="../../image/NTR.gif"><img src="../../image/TWL.gif"></H1> 15<h2>Syntax</h2> 16<dl> 17 <dd><PRE><CODE>#include <nitro/wm.h> 18 19<A href="WMErrCode.html">WMErrCode</A> WM_SetWEPKey( 20 <A href="WMCallbackFunc.html">WMCallbackFunc</A> callback , 21 u16 wepmode , 22 const u16* wepkey 23); 24</CODE></PRE></dd> 25</dl> 26 27<h2>Arguments</h2> 28<TABLE width="100%"> 29 <tbody> 30 <TR> 31<TD width="200"><CODE>callback</CODE></TD> 32<TD width="800">Designates the callback function to call when the asynchronous process completes. This callback is called from within the interrupt handler.</TD> 33 </TR> 34 <TR> 35<TD width="200"><CODE>wepmode</CODE></TD> 36<TD width="800">Designates the operations mode of the encryption communications feature. Use a value from 0-3, as shown below. 37<UL><LI>0 : No encryption features<BR> 38<LI>1 : RC4 ( 40-bit) encryption mode <BR> 39<LI>2 : RC4 ( 104-bit) encryption mode <BR> 40<LI>3 : RC4 (128-bit) encryption mode 41 </UL></TD> 42 </TR> 43 <TR> 44<TD width="200"><CODE>wepkey</CODE></TD> 45<TD width="800">Designates a pointer to the encryption key data (80 bytes).<BR>The key data is made up of 4 data items, each of which are 20 bytes. Of each 20 bytes, 46<UL><LI>In 40-bit mode, 5 bytes 47<LI>In 104-bit mode, 13 bytes 48<LI>In 128-bit mode, 16 bytes 49 </UL> 50are used.<BR>Note that this data is forcibly cached.</TD> 51 </TR> 52 </tbody> 53</table> 54 55<h2>Return Values</h2> 56<p>Returns the results of the <CODE><A href="WMErrCode.html">WMErrCode</A></CODE> enumerated type process.</p> 57 58<H2>Description</H2> 59<P>Configures the encryption feature and the encryption keys. It is executable when WM is in an <A href="wm_state_diagram.html">IDLE state</A>. If the return value of the function was <code>WM_ERRCODE_OPERATING</code>, the callback is generated after the encryption feature configuration process has completed. This function performs that same processing as <A href="WM_SetWEPKeyEx.html"><code>WM_SetWEPKeyEx</code></A> when <em><strong>wepkey</strong></em> is set to 0. Encryption using WEP key is applied to authentication during connection and to data sent and received in infrastructure mode. The <em><strong><code>wepmode</code></strong></em> setting on the sender and receiver must match. Be aware that when connecting the parent that performed the WEP encryption configuration as a child via this function, once the WEP configurations have been performed with this function, the <EM><STRONG><code>authMode</code></STRONG></EM> of the <code><A href="WM_StartConnectEx.html">WM_StartConnectEx</A></code> function must be designated as shared key authentication (<code>WM_AUTHMODE_SHARED_KEY</code>). 60</P> 61 62<H2>Notes</H2> 63<P>The <CODE>wepkey</CODE> data is forcibly stored in the internal cache. To avoid overwriting surrounding memory regions, be sure to pass data that is 32-byte aligned.<BR>See the Wireless Communication Library Manual (AboutWirelessManager.pdf) for additional details.</P> 64 65<h2>See Also</h2> 66<p><A href="WM_SetWEPKeyEx.html"><code>WM_SetWEPKeyEx</code></A><BR> <A href="WM_StartConnectEx.html"><code>WM_StartConnectEx</code></A></p> 67 68<H2>Revision History</H2> 69<P> 702008/12/17 Added a note about how data passed in arguments is forcibly cached internally.<BR>2005/06/08 Added the fact that the callback is called from the interrupt handler.<BR>2005/03/07 Made addition to Description.<BR>2005/03/02 Added mention of the specifiable range of the wepmode argument.<BR>2004/10/22 Changed the type of return values.<BR>Initial version.<BR> 71</P> 72<hr><p>CONFIDENTIAL</p></body> 73</html> 74