From d88f67fe304941e86d2719ccd16a590e79237aad Mon Sep 17 00:00:00 2001 From: yellows8 Date: Wed, 13 Nov 2019 18:25:34 -0500 Subject: [PATCH] Added appletPushToAppletBoundChannel and appletTryPopFromAppletBoundChannel. --- nx/include/switch/services/applet.h | 15 +++++++++++++++ nx/source/services/applet.c | 3 +++ 2 files changed, 18 insertions(+) diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index 91330ccd..3a78d632 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -2130,6 +2130,21 @@ Result appletReadThemeStorage(void* buffer, size_t size, u64 offset, u64 *transf */ Result appletWriteThemeStorage(const void* buffer, size_t size, u64 offset); +/** + * @brief PushToAppletBoundChannel + * @note Only available with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [9.0.0+]. + * @note This uses \ref appletStorageClose automatically. + * @param[in] s Storage object. + */ +Result appletPushToAppletBoundChannel(AppletStorage *s); + +/** + * @brief TryPopFromAppletBoundChannel + * @note Only available with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [9.0.0+]. + * @param[out] s Storage object. + */ +Result appletTryPopFromAppletBoundChannel(AppletStorage *s); + /** * @brief Gets the DisplayLogicalResolution. * @note Only available with AppletType_SystemApplet, AppletType_LibraryApplet, or AppletType_OverlayApplet, on [8.0.0+]. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index f01c71e8..dd9cf6f9 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -2599,6 +2599,9 @@ Result appletWriteThemeStorage(const void* buffer, size_t size, u64 offset) { ); } +IPC_MAKE_CMD_IMPL_HOSVER(Result appletPushToAppletBoundChannel(AppletStorage *s), &g_appletIAppletCommonFunctions, 20, _appletCmdInStorage, (9,0,0), s) +IPC_MAKE_CMD_IMPL_HOSVER(Result appletTryPopFromAppletBoundChannel(AppletStorage *s), &g_appletIAppletCommonFunctions, 21, _appletCmdNoInOutStorage, (9,0,0), s) + IPC_MAKE_CMD_IMPL_HOSVER(Result appletGetDisplayLogicalResolution(s32 *width, s32 *height), &g_appletIAppletCommonFunctions, 40, _appletGetResolution, (8,0,0), width, height) Result appletSetDisplayMagnification(float x, float y, float width, float height) {