Update nifm.c

This commit is contained in:
exelix 2019-03-08 17:45:05 +01:00
parent cc18ea8cd3
commit 19dc760d52

View File

@ -12,8 +12,8 @@
typedef enum { typedef enum {
NifmServiceType_NotInitialized = 0, NifmServiceType_NotInitialized = 0,
NifmServiceType_User = 1, NifmServiceType_User = 1,
NifmServiceType_Applet = 2, NifmServiceType_System = 2,
NifmServiceType_System = 3, NifmServiceType_Admin = 3,
} NifmServiceType; } NifmServiceType;
static NifmServiceType g_nifmServiceType = NifmServiceType_NotInitialized; static NifmServiceType g_nifmServiceType = NifmServiceType_NotInitialized;
@ -31,13 +31,13 @@ Result nifmInitialize(void) {
if (serviceIsActive(&g_nifmSrv)) if (serviceIsActive(&g_nifmSrv))
return 0; return 0;
Result rc = smGetService(&g_nifmSrv, "nifm:s"); Result rc = smGetService(&g_nifmSrv, "nifm:a");
g_nifmServiceType = NifmServiceType_System; g_nifmServiceType = NifmServiceType_Admin;
if (R_FAILED(rc)) if (R_FAILED(rc))
{ {
rc = smGetService(&g_nifmSrv, "nifm:a"); rc = smGetService(&g_nifmSrv, "nifm:s");
g_nifmServiceType = NifmServiceType_Applet; g_nifmServiceType = NifmServiceType_System;
} }
if (R_FAILED(rc)) if (R_FAILED(rc))
@ -142,7 +142,7 @@ Result nifmIsWirelessCommunicationEnabled(bool* out) {
} }
Result nifmSetWirelessCommunicationEnabled(bool enable) { Result nifmSetWirelessCommunicationEnabled(bool enable) {
if (g_nifmServiceType < NifmServiceType_Applet) if (g_nifmServiceType < NifmServiceType_System)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
IpcCommand c; IpcCommand c;