mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-30 06:25:20 -04:00
erpt: implement forced shutdown detection
This commit is contained in:
parent
ef0c15b764
commit
355010ad84
17 changed files with 645 additions and 53 deletions
|
@ -22,8 +22,9 @@ namespace ams::erpt::srv {
|
|||
|
||||
constexpr inline const char ReportOnSdStoragePath[] = "ersd";
|
||||
|
||||
constexpr inline const char ReportStoragePath[] = "save";
|
||||
constexpr inline const char JournalFileName[] = "save:/journal";
|
||||
constexpr inline const char ReportStoragePath[] = "save";
|
||||
constexpr inline const char JournalFileName[] = "save:/journal";
|
||||
constexpr inline const char ForcedShutdownContextFileName[] = "save:/forced-shutdown";
|
||||
|
||||
constexpr size_t ReportFileNameLength = 64;
|
||||
constexpr size_t AttachmentFileNameLength = 64;
|
||||
|
|
|
@ -16,4 +16,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <stratosphere/err/err_types.hpp>
|
||||
#include <stratosphere/err/err_error_context.hpp>
|
||||
#include <stratosphere/err/err_system_api.hpp>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* 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 <vapours.hpp>
|
||||
#include <stratosphere/err/err_types.hpp>
|
||||
|
||||
namespace ams::err {
|
||||
|
||||
ErrorCode ConvertResultToErrorCode(const Result &result);
|
||||
void GetErrorCodeString(char *dst, size_t dst_size, ErrorCode error_code);
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* 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 <vapours.hpp>
|
||||
|
||||
namespace ams::err {
|
||||
|
||||
using ErrorCodeCategory = u32;
|
||||
using ErrorCodeNumber = u32;
|
||||
|
||||
struct ErrorCode {
|
||||
static constexpr auto StringLengthMax = 15;
|
||||
|
||||
ErrorCodeCategory category;
|
||||
ErrorCodeNumber number;
|
||||
|
||||
constexpr ALWAYS_INLINE bool IsValid() const { return this->category > 0; }
|
||||
};
|
||||
|
||||
constexpr inline ErrorCode InvalidErrorCode = {
|
||||
.category = 0,
|
||||
.number = 0,
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue