Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nx/include/switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ extern "C" {
#include "switch/services/avm.h"
#include "switch/services/mm.h"
#include "switch/services/omm.h"
#include "switch/services/idlesys.h"

#include "switch/display/binder.h"
#include "switch/display/parcel.h"
Expand Down
21 changes: 21 additions & 0 deletions nx/include/switch/services/idlesys.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @file idlesys.h
* @author MasaGratoR
* @copyright libnx Authors
*/

#pragma once

#include "../types.h"

/// Initialize idle:sys.
Result idlesysInitialize(void);

/// Exit idle:sys.
void idlesysExit(void);

/// Gets the Service for idle:sys.
Service* idlesysGetServiceSession(void);

/// Resets sleep counter.
Result idlesysReportUserIsActive();
Comment thread
masagrator marked this conversation as resolved.
Outdated
23 changes: 23 additions & 0 deletions nx/source/services/idlesys.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#define NX_SERVICE_ASSUME_NON_DOMAIN
#include "service_guard.h"
#include "services/idlesys.h"

static Service g_idlesysSrv;

NX_GENERATE_SERVICE_GUARD(idlesys);

Result _idlesysInitialize(void) {
return smGetService(&g_idlesysSrv, "idle:sys");
}

void _idlesysCleanup(void) {
serviceClose(&g_idlesysSrv);
}

Service* idlesysGetServiceSession(void) {
return &g_idlesysSrv;
}

Result idlesysReportUserIsActive() {
Comment thread
masagrator marked this conversation as resolved.
Outdated
return serviceDispatch(&g_idlesysSrv, 5);
}
Loading