1 /* 2 Project: NitroSDK - CHT - demos - catch-min 3 File: wmscan.h 4 5 Copyright 2003-2008 Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Log: wmscan.h,v $ 14 Revision 1.2 2006/01/18 02:12:40 kitase_hirotake 15 do-indent 16 17 Revision 1.1 2005/07/27 07:44:06 seiki_masashi 18 New additions 19 20 $NoKeywords$ 21 */ 22 #include <nitro/types.h> 23 #include <nitro/wm.h> 24 25 typedef void (*WSStartScanCallbackFunc) (WMBssDesc *bssDesc); 26 27 enum 28 { 29 WS_SYSSTATE_STOP, // Wireless is stopped 30 WS_SYSSTATE_IDLE, // IDLE state 31 WS_SYSSTATE_SCANNING, // Scanning 32 WS_SYSSTATE_SCANIDLE, // Scanning is stopped 33 WS_SYSSTATE_BUSY, // Busy 34 WS_SYSSTATE_ERROR, // Error occurred 35 WS_SYSSTATE_FATAL // A FATAL error has occurred 36 }; 37 38 39 /*---------------------------------------------------------------------------* 40 Name: WS_Initialize 41 Description: Initializes wireless. 42 Arguments: buf: Buffer size passed to WM. A region the size of WM_SYSTEM_BUF_SIZE required. 43 dmaNo: The DMA number used by wireless. 44 Returns: If the process starts successfully, TRUE. 45 If it did not start, FALSE. 46 *---------------------------------------------------------------------------*/ 47 BOOL WS_Initialize(void *buf, u16 dmaNo); 48 49 /*---------------------------------------------------------------------------* 50 Name: WS_StartScan 51 Description: Starts scanning for a parent. 52 Arguments: callback: Callback when parent is found. 53 macAddr: Specifies the parent's MAC address. 54 When searching for all parents, specify FF:FF:FF:FF:FF:FF. 55 If the 'continuous' flag is set to TRUE, until WS_EndScan is called, 56 all valid channels will continue to be scanned. 57 If FALSE, while cycling between valid channels, 58 it will stop scanning after each scan and transition to the WS_SYSSTATE_SCANIDLE state. 59 Returns: If the process starts successfully, TRUE. 60 If it did not start, FALSE. 61 *---------------------------------------------------------------------------*/ 62 BOOL WS_StartScan(WSStartScanCallbackFunc callback, const u8 *macAddr, BOOL continuous); 63 64 /*---------------------------------------------------------------------------* 65 Name: WS_EndScan 66 Description: Function that terminates scanning. 67 Arguments: None. 68 Returns: If the process starts successfully, TRUE. 69 If it did not start, FALSE. 70 *---------------------------------------------------------------------------*/ 71 BOOL WS_EndScan(void); 72 73 /*---------------------------------------------------------------------------* 74 Name: WS_End 75 Description: Ends wireless communication. 76 Arguments: None. 77 Returns: If it succeeds returns TRUE. 78 *---------------------------------------------------------------------------*/ 79 BOOL WS_End(void); 80 81 /*---------------------------------------------------------------------------* 82 Name: WS_SetGgid 83 Description: Sets the game's group ID. 84 Call before making a connection to the parent device. 85 Arguments: ggid The game group ID to configure. 86 Returns: None. 87 *---------------------------------------------------------------------------*/ 88 void WS_SetGgid(u32 ggid); 89 90 /*---------------------------------------------------------------------------* 91 Name: WS_GetSystemState 92 Description: Gets the WS state. 93 Arguments: None. 94 Returns: The WS state. 95 *---------------------------------------------------------------------------*/ 96 int WS_GetSystemState(void); 97 98 /*---------------------------------------------------------------------------* 99 Name: WS_TurnOnPictoCatch 100 Description: Enables the Pictocatch feature. 101 This causes a callback function to be invoked when PictoChat is discovered while scanning with WS_StartScan. 102 103 Arguments: None. 104 Returns: None. 105 *---------------------------------------------------------------------------*/ 106 void WS_TurnOnPictoCatch(void); 107 108 /*---------------------------------------------------------------------------* 109 Name: WS_TurnOffPictoCatch 110 Description: Disables the pictocatch feature. 111 Arguments: None. 112 Returns: None. 113 *---------------------------------------------------------------------------*/ 114 void WS_TurnOffPictoCatch(void); 115