/*---------------------------------------------------------------------------* Project: RevolutionSDK Extension - netdemo File: macaddr.c Copyright 2007 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Log: macaddr.c,v $ Revision 1.1 2007/01/31 02:57:20 okubata_ryoma Moved from ncdmiscdemo $NoKeywords: $ *---------------------------------------------------------------------------*/ #include #include #include #define RESULT_SUCCESS 0 // // Sample code to get mac address in wireless connection hardware // void main(void) { s32 ret; // mac address in wireless connection hardware u8 wl_mac[NET_MACADDRESS_LENGTH]; // 6 bytes OSInit(); VIInit(); for (;;) { ret = NETGetWirelessMacAddress(wl_mac); if(ret >= RESULT_SUCCESS) { // OK!! go ahead. goto signal_green; } else { // error!! OSHalt("Error!!"); break; } // wait a moment or do other jobs VIWaitForRetrace(); } signal_green: OSReport("Wireless hardware mac address = %02x:%02x:%02x:%02x:%02x:%02x\n", wl_mac[0],wl_mac[1],wl_mac[2],wl_mac[3],wl_mac[4],wl_mac[5]); while (1) { VIWaitForRetrace(); } }