diff --git a/branches/1stNUP_for_2ndNUP/sources/ConsoleBackup/ConsoleBackup.cpp b/branches/1stNUP_for_2ndNUP/sources/ConsoleBackup/ConsoleBackup.cpp index f6d15c0..16160c7 100644 --- a/branches/1stNUP_for_2ndNUP/sources/ConsoleBackup/ConsoleBackup.cpp +++ b/branches/1stNUP_for_2ndNUP/sources/ConsoleBackup/ConsoleBackup.cpp @@ -139,6 +139,9 @@ extern "C" void nnMain(void) s_HwUtility.InitializeForBackup(); common::HardwareStateManager manager(s_HwUtility); + // 無線OFF + s_HwUtility.SetWifiOff(); + // 情報出力 COMMON_LOGGER("CTR Console Backup %s-%s-%s\n", CONSOLE_REPAIR_VERSION_MAJOR, CONSOLE_REPAIR_VERSION_MINOR, CONSOLE_REPAIR_VERSION_MICRO); COMMON_LOGGER("System Ver. %d.%d.%d-%d\n", @@ -246,7 +249,8 @@ extern "C" void nnMain(void) operationMessage, s_HwUtility.GetRegion(), s_HwUtility.GetSerialNumber(), - s_HwUtility.HasReadFriendCode() + s_HwUtility.HasReadFriendCode(), + s_HwUtility.IsWifiOn() ); if (GetBackupMode() == BACKUP_MODE_DELETE_IF_FAILED) diff --git a/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/ConsoleRestore.cpp b/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/ConsoleRestore.cpp index 09039b5..877ce47 100644 --- a/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/ConsoleRestore.cpp +++ b/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/ConsoleRestore.cpp @@ -160,6 +160,9 @@ extern "C" void nnMain(void) s_HwUtility.InitializeForRestore(); common::HardwareStateManager manager(s_HwUtility); + // 無線ON + s_HwUtility.SetWifiOn(); + // 情報出力 COMMON_LOGGER("CTR Console Restore %s-%s-%s\n", CONSOLE_REPAIR_VERSION_MAJOR, CONSOLE_REPAIR_VERSION_MINOR, CONSOLE_REPAIR_VERSION_MICRO); COMMON_LOGGER("System Ver. %d.%d.%d-%d\n", s_HwUtility.GetCupMajorVersion(), diff --git a/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/Controller.cpp b/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/Controller.cpp index 6a16d7b..e9fe7b9 100644 --- a/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/Controller.cpp +++ b/branches/1stNUP_for_2ndNUP/sources/ConsoleRestore/Controller.cpp @@ -1489,6 +1489,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector* s_OperationMessage; bool s_ReadFriendCode; +bool s_IsWifiOn; } @@ -66,7 +67,21 @@ void SetTextWriterCore() { GetTextWriter()->Print("\n"); + f32 cursorX = GetTextWriter()->GetCursorX(); + f32 cursorY = GetTextWriter()->GetCursorY(); GetTextWriter()->Printf("System Ver. %d.%d.%d-%d\n", s_CupMajor, s_CupMinor, s_CupMicro, s_NupMajor); + GetTextWriter()->SetCursorX(cursorX); + GetTextWriter()->SetCursorY(cursorY); + if(s_IsWifiOn) + { + GetTextWriter()->Printf(" WiFi ON\n"); + } + else + { + GetTextWriter()->SetTextColor(nn::util::Color8(80, 80, 80, 255)); + GetTextWriter()->Printf(" WiFi OFF\n"); + GetTextWriter()->SetTextColor(nn::util::Color8(255, 255, 255, 255)); + } GetTextWriter()->Printf("System Region %s\n", nn::cfg::CTR::GetRegionCodeA3(s_Region)); GetTextWriter()->Printf("Serial No. %s\n", s_SerialNo); GetTextWriter()->Printf("Device ID %llu\n", s_DeviceId); @@ -114,7 +129,8 @@ void DrawSystemState ::std::vector& operationMessage, nn::cfg::CTR::CfgRegionCode region, u8* serialNo, - bool readFriendCode + bool readFriendCode, + bool isWifiOn ) { @@ -134,6 +150,7 @@ void DrawSystemState s_SerialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN] = '\0'; s_OperationMessage = &operationMessage; s_ReadFriendCode = readFriendCode; + s_IsWifiOn = isWifiOn; // デフォルトで上画面に描画するもの diff --git a/branches/1stNUP_for_2ndNUP/sources/common/DrawSystemState.h b/branches/1stNUP_for_2ndNUP/sources/common/DrawSystemState.h index db575fe..e103a66 100644 --- a/branches/1stNUP_for_2ndNUP/sources/common/DrawSystemState.h +++ b/branches/1stNUP_for_2ndNUP/sources/common/DrawSystemState.h @@ -73,7 +73,8 @@ void DrawSystemState ::std::vector& operationMessage, nn::cfg::CTR::CfgRegionCode region, u8* s_SerialNo, - bool readFriendCode + bool readFriendCode, + bool isWifiOn ); } diff --git a/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.cpp b/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.cpp index 0f5fa76..6ad1ee7 100644 --- a/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.cpp +++ b/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.cpp @@ -73,4 +73,14 @@ void HardwareStateManager::GetVersionData(common::VerDef* version) return m_pUtil->GetVersionData(version); } +void HardwareStateManager::SetWifiOn() +{ + m_pUtil->SetWifiOn(); +} + +void HardwareStateManager::SetWifiOff() +{ + m_pUtil->SetWifiOff(); +} + } diff --git a/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.h b/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.h index 1483dff..d5c292f 100644 --- a/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.h +++ b/branches/1stNUP_for_2ndNUP/sources/common/HardwareStateManager.h @@ -38,6 +38,8 @@ public: nn::Handle GetMcuHandle(); void GetSerialNumber(u8** serial, size_t* size); void GetVersionData(common::VerDef* version); + void SetWifiOn(); + void SetWifiOff(); private: NN_PADDING4; diff --git a/branches/1stNUP_for_2ndNUP/sources/common/Util.cpp b/branches/1stNUP_for_2ndNUP/sources/common/Util.cpp index d46e743..0a3ba6f 100644 --- a/branches/1stNUP_for_2ndNUP/sources/common/Util.cpp +++ b/branches/1stNUP_for_2ndNUP/sources/common/Util.cpp @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------* +/*---------------------------------------------------------------------------* Project: Horizon File: Util.cpp @@ -28,6 +28,9 @@ #include #include +#include +#include + #include "Util.h" #include "FileName.h" #include "CommonLogger.h" @@ -130,6 +133,9 @@ void Util::Initialize() // バージョンの取得 common::GetSystemVersion(&m_VerData, m_Region); + // nwmの初期化 + nn::nwm::InitializeExtControl(); + // MACアドレスの取得 nn::nwm::Mac mac; @@ -151,9 +157,28 @@ void Util::FinalizeForRestore() void Util::Finalize() { + nn::nwm::FinalizeExtControl(); nn::mcu::CTR::FinalizeHwCheck(&m_McuSession); } +void Util::SetWifiOn() +{ + COMMON_LOGGER_RESULT_IF_FAILED( + nn::nwm::Ext::SetWifiOn()); +} + +void Util::SetWifiOff() +{ + COMMON_LOGGER_RESULT_IF_FAILED( + nn::nwm::Ext::SetWifiOff()); +} + +// 無線状態を取得する +bool Util::IsWifiOn() +{ + return nn::nwm::IsWifiOn(); +} + // NULL終端されたシリアルナンバーを受け取る // NULL終端された場所にチェックデジットを付加して新たにNULL終端する void Util::AddCheckDigit(char* serial) diff --git a/branches/1stNUP_for_2ndNUP/sources/common/Util.h b/branches/1stNUP_for_2ndNUP/sources/common/Util.h index ebcf875..8e9329d 100644 --- a/branches/1stNUP_for_2ndNUP/sources/common/Util.h +++ b/branches/1stNUP_for_2ndNUP/sources/common/Util.h @@ -30,6 +30,7 @@ namespace common class Util { public: + Util(); virtual ~Util(); @@ -39,6 +40,15 @@ public: void FinalizeForBackup(); void FinalizeForRestore(); + // 無線状態をONにする + void SetWifiOn(); + + // 無線状態をOFFにする + void SetWifiOff(); + + // 無線状態を取得する + bool IsWifiOn(); + // シリアルナンバーにモジュラス10 ウェイト3・1(M10W31)でチェックデジットを付加する static void AddCheckDigit(char* serial);