2018-11-10 20:38:24 +00:00
|
|
|
/*
|
2021-10-04 20:59:10 +01:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2018-11-10 20:38:24 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stratosphere.hpp>
|
|
|
|
|
2019-10-24 10:30:10 +01:00
|
|
|
namespace ams::fatal::srv {
|
2019-07-19 03:09:35 +01:00
|
|
|
|
|
|
|
class FatalConfig {
|
|
|
|
private:
|
2020-08-04 03:52:53 +01:00
|
|
|
settings::system::SerialNumber serial_number{};
|
|
|
|
settings::system::FirmwareVersion firmware_version{};
|
|
|
|
u64 language_code{};
|
|
|
|
TimeSpan quest_reboot_interval{};
|
|
|
|
bool transition_to_fatal{};
|
|
|
|
bool show_extra_info{};
|
|
|
|
bool quest_flag{};
|
|
|
|
const char *error_msg{};
|
|
|
|
const char *error_desc{};
|
|
|
|
const char *quest_desc{};
|
|
|
|
TimeSpan fatal_auto_reboot_interval{};
|
|
|
|
bool fatal_auto_reboot_enabled{};
|
2019-07-19 03:09:35 +01:00
|
|
|
public:
|
|
|
|
FatalConfig();
|
|
|
|
|
2020-04-14 01:07:37 +01:00
|
|
|
const settings::system::SerialNumber &GetSerialNumber() const {
|
2019-07-19 03:09:35 +01:00
|
|
|
return this->serial_number;
|
|
|
|
}
|
|
|
|
|
2020-04-14 01:07:37 +01:00
|
|
|
const settings::system::FirmwareVersion &GetFirmwareVersion() const {
|
2019-07-19 03:09:35 +01:00
|
|
|
return this->firmware_version;
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpdateLanguageCode() {
|
|
|
|
setGetLanguageCode(&this->language_code);
|
|
|
|
}
|
|
|
|
|
|
|
|
u64 GetLanguageCode() const {
|
|
|
|
return this->language_code;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ShouldTransitionToFatal() const {
|
|
|
|
return this->transition_to_fatal;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ShouldShowExtraInfo() const {
|
|
|
|
return this->show_extra_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsQuest() const {
|
|
|
|
return this->quest_flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsFatalRebootEnabled() const {
|
|
|
|
return this->fatal_auto_reboot_enabled;
|
|
|
|
}
|
|
|
|
|
2020-08-04 03:52:53 +01:00
|
|
|
TimeSpan GetQuestRebootTimeoutInterval() const {
|
|
|
|
return this->quest_reboot_interval;
|
2019-07-19 03:09:35 +01:00
|
|
|
}
|
|
|
|
|
2020-08-04 03:52:53 +01:00
|
|
|
TimeSpan GetFatalRebootTimeoutInterval() const {
|
2020-08-04 03:25:59 +01:00
|
|
|
return this->fatal_auto_reboot_interval;
|
2019-07-19 03:09:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *GetErrorMessage() const {
|
|
|
|
return this->error_msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *GetErrorDescription() const {
|
|
|
|
if (this->IsQuest()) {
|
|
|
|
return this->quest_desc;
|
|
|
|
} else {
|
|
|
|
return this->error_desc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-10-01 03:00:47 +01:00
|
|
|
os::MultiWaitHolderType *GetFatalDirtyMultiWaitHolder();
|
2019-09-28 02:04:58 +01:00
|
|
|
void OnFatalDirtyEvent();
|
2019-07-19 03:09:35 +01:00
|
|
|
const FatalConfig &GetFatalConfig();
|
|
|
|
|
|
|
|
}
|