mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Added appletGetCradleStatus and appletGetBootMode. Added _appletCmdNoInOutU8 for internal use, which _appletCmdNoInOutBool now uses. Fixed docs.
This commit is contained in:
parent
79fa22fdbd
commit
93eaa74131
@ -11,6 +11,7 @@
|
|||||||
#include "../services/apm.h"
|
#include "../services/apm.h"
|
||||||
#include "../services/pdm.h"
|
#include "../services/pdm.h"
|
||||||
#include "../services/caps.h"
|
#include "../services/caps.h"
|
||||||
|
#include "../services/pm.h"
|
||||||
#include "../kernel/tmem.h"
|
#include "../kernel/tmem.h"
|
||||||
#include "../kernel/event.h"
|
#include "../kernel/event.h"
|
||||||
|
|
||||||
@ -136,7 +137,7 @@ typedef enum {
|
|||||||
AppletTvPowerStateMatchingMode_Unknown1 = 1, ///< Unknown.
|
AppletTvPowerStateMatchingMode_Unknown1 = 1, ///< Unknown.
|
||||||
} AppletTvPowerStateMatchingMode;
|
} AppletTvPowerStateMatchingMode;
|
||||||
|
|
||||||
/// Type values for \ref PerformSystemButtonPressingIfInFocus.
|
/// Type values for \ref appletPerformSystemButtonPressingIfInFocus.
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AppletSystemButtonType_HomeButtonShortPressing = 1, ///< Short-pressing with the HOME-button.
|
AppletSystemButtonType_HomeButtonShortPressing = 1, ///< Short-pressing with the HOME-button.
|
||||||
AppletSystemButtonType_HomeButtonLongPressing = 2, ///< Long-pressing with the HOME-button.
|
AppletSystemButtonType_HomeButtonLongPressing = 2, ///< Long-pressing with the HOME-button.
|
||||||
@ -242,6 +243,18 @@ AppletThemeColorType appletGetThemeColorType(void);
|
|||||||
*/
|
*/
|
||||||
Result appletHomeButtonReaderLockAccessorGetEvent(Event *out_event);
|
Result appletHomeButtonReaderLockAccessorGetEvent(Event *out_event);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the CradleStatus.
|
||||||
|
* @param[out] status Output Dock status.
|
||||||
|
*/
|
||||||
|
Result appletGetCradleStatus(u8 *status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the BootMode which originated from \ref pmbmGetBootMode.
|
||||||
|
* @param[out] mode \ref PmBootMode
|
||||||
|
*/
|
||||||
|
Result appletGetBootMode(PmBootMode *mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Pushes a storage to the general channel. Used for sending requests to qlaunch.
|
* @brief Pushes a storage to the general channel. Used for sending requests to qlaunch.
|
||||||
* @note This is not usable under an Application, however it is usable under a LibraryApplet.
|
* @note This is not usable under an Application, however it is usable under a LibraryApplet.
|
||||||
@ -910,14 +923,14 @@ Result appletGetGpuErrorDetectedSystemEvent(Event *out_event);
|
|||||||
/**
|
/**
|
||||||
* @brief Gets the \ref AppletIdentityInfo for the MainApplet.
|
* @brief Gets the \ref AppletIdentityInfo for the MainApplet.
|
||||||
* @note Only available with AppletType_LibraryApplet.
|
* @note Only available with AppletType_LibraryApplet.
|
||||||
* @param[out] \ref AppletIdentityInfo
|
* @param[out] info \ref AppletIdentityInfo
|
||||||
*/
|
*/
|
||||||
Result appletGetMainAppletIdentityInfo(AppletIdentityInfo *info);
|
Result appletGetMainAppletIdentityInfo(AppletIdentityInfo *info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the \ref AppletIdentityInfo for the CallerApplet.
|
* @brief Gets the \ref AppletIdentityInfo for the CallerApplet.
|
||||||
* @note Only available with AppletType_LibraryApplet.
|
* @note Only available with AppletType_LibraryApplet.
|
||||||
* @param[out] \ref AppletIdentityInfo
|
* @param[out] info \ref AppletIdentityInfo
|
||||||
*/
|
*/
|
||||||
Result appletGetCallerAppletIdentityInfo(AppletIdentityInfo *info);
|
Result appletGetCallerAppletIdentityInfo(AppletIdentityInfo *info);
|
||||||
|
|
||||||
@ -933,7 +946,7 @@ Result appletGetCallerAppletIdentityInfoStack(AppletIdentityInfo *stack, s32 cou
|
|||||||
/**
|
/**
|
||||||
* @brief Gets the \ref AppletIdentityInfo for the NextReturnDestinationApplet.
|
* @brief Gets the \ref AppletIdentityInfo for the NextReturnDestinationApplet.
|
||||||
* @note Only available with AppletType_LibraryApplet on [4.0.0+].
|
* @note Only available with AppletType_LibraryApplet on [4.0.0+].
|
||||||
* @param[out] \ref AppletIdentityInfo
|
* @param[out] info \ref AppletIdentityInfo
|
||||||
*/
|
*/
|
||||||
Result appletGetNextReturnDestinationAppletIdentityInfo(AppletIdentityInfo *info);
|
Result appletGetNextReturnDestinationAppletIdentityInfo(AppletIdentityInfo *info);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "services/applet.h"
|
#include "services/applet.h"
|
||||||
#include "services/apm.h"
|
#include "services/apm.h"
|
||||||
#include "services/caps.h"
|
#include "services/caps.h"
|
||||||
|
#include "services/pm.h"
|
||||||
#include "services/sm.h"
|
#include "services/sm.h"
|
||||||
#include "runtime/env.h"
|
#include "runtime/env.h"
|
||||||
#include "runtime/hosversion.h"
|
#include "runtime/hosversion.h"
|
||||||
@ -744,7 +745,7 @@ static Result _appletCmdNoInOut32(Service* srv, u32 *out, u64 cmd_id) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Result _appletCmdNoInOutBool(Service* srv, bool *out, u64 cmd_id) {
|
static Result _appletCmdNoInOutU8(Service* srv, u8 *out, u64 cmd_id) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
|
||||||
@ -774,13 +775,20 @@ static Result _appletCmdNoInOutBool(Service* srv, bool *out, u64 cmd_id) {
|
|||||||
rc = resp->result;
|
rc = resp->result;
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && out) {
|
if (R_SUCCEEDED(rc) && out) {
|
||||||
*out = resp->out!=0;
|
*out = resp->out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Result _appletCmdNoInOutBool(Service* srv, bool *out, u64 cmd_id) {
|
||||||
|
u8 tmp=0;
|
||||||
|
Result rc = _appletCmdNoInOutU8(srv, &tmp, cmd_id);
|
||||||
|
if (R_SUCCEEDED(rc) && out) *out = tmp!=0;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static Result _appletCmdInU8(Service* srv, u8 inval, u64 cmd_id) {
|
static Result _appletCmdInU8(Service* srv, u8 inval, u64 cmd_id) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -1140,6 +1148,17 @@ static Result _appletGetPerformanceMode(u32 *out) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result appletGetCradleStatus(u8 *status) {
|
||||||
|
return _appletCmdNoInOutU8(&g_appletICommonStateGetter, status, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result appletGetBootMode(PmBootMode *mode) {
|
||||||
|
u8 tmp=0;
|
||||||
|
Result rc = _appletCmdNoInOutU8(&g_appletICommonStateGetter, &tmp, 8);
|
||||||
|
if (R_SUCCEEDED(rc) && mode) *mode = tmp;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static Result _appletGetCurrentFocusState(u8 *out) {
|
static Result _appletGetCurrentFocusState(u8 *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
Loading…
Reference in New Issue
Block a user