/*---------------------------------------------------------------------------* Project: Horizon File: nwm_ExtAPI.cpp Copyright (C)2009-2011 Nintendo Co., Ltd. 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. $Rev$ *---------------------------------------------------------------------------*/ #include #include #include #include #include #include #include "nwm_Ext.h" #include #include #include using namespace nn; using namespace nn::nwm::CTR; namespace nn { namespace nwm { namespace CTR { Result InitializeExtControl() { return detail::InitializeBase(&detail::Ext::s_Session, PORT_NAME_EXT); } Result FinalizeExtControl() { return detail::FinalizeBase(&detail::Ext::s_Session); } namespace Ext { Result GetMacAddress( Mac& mac ) { return nn::nwm::CTR::GetMacAddress( mac ); } Result GetState( u16* pState ) { return detail::Ext::GetState( pState ); } bool IsWifiOn() { return nn::nwm::CTR::IsWifiOn(); } Result GetLinkLevel( LinkLevel* pLinkLevel ) { if ( pLinkLevel ) { *pLinkLevel = nn::nwm::CTR::GetLinkLevel(); return ResultSuccess(); } else { return ResultInvalidPointer(); } } Result GetCommunicationMode( Mode* pMode ) { if ( pMode ) { *pMode = nn::nwm::CTR::GetCommunicationMode(); return ResultSuccess(); } else { return ResultInvalidPointer(); } } // 以下、MP用API Result OpenMpMode() { return detail::Ext::OpenMpMode(); } Result CloseMpMode() { return detail::Ext::CloseMpMode(); } Result UpdateMpLinkLevel( LinkLevel linkLevel ) { return detail::Ext::UpdateMpLinkLevel( linkLevel ); } Result NotifyWifiOffPreparationComplete() { return detail::Ext::NotifyWifiOffPreparationComplete(); } Result PrepareLegacyMode(u8 pParameters[32]) { return detail::Ext::PrepareLegacyMode(pParameters); } Result GetHardwareInfo(HardwareInfo &info) { return detail::Ext::GetHardwareInfo(&info); } Result SetWifiOn() { Result result; nn::cfg::Initialize(); #if 0 // デバッグモードフラグが有効な場合のみ、操作を行う。 if( nn::cfg::IsDebugMode() == true ) { #endif result = detail::Ext::PseudoToggleWifiButton(false); #if 0 } else { result = ResultNotAuthorized(); } #endif nn::cfg::Finalize(); return result; } Result SetWifiOff() { Result result; nn::cfg::Initialize(); #if 0 // デバッグモードフラグが有効な場合のみ、操作を行う。 if( nn::cfg::IsDebugMode() == true ) { #endif result = detail::Ext::PseudoToggleWifiButton(true); #if 0 } else { result = ResultNotAuthorized(); } #endif nn::cfg::Finalize(); return result; } Result SimulateFirmwareError() { Result result; nn::cfg::Initialize(); // デバッグモードフラグが有効な場合のみ、操作を行う。 if( nn::cfg::IsDebugMode() == true ) { result = detail::Ext::SimulateFirmwareError(); } else { result = ResultNotAuthorized(); } nn::cfg::Finalize(); return result; } } // namespace Ext } // namespace CTR } // namespace nwm } // namespace nn