1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     ndm_UserControl.cpp
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 23325 $
14  *---------------------------------------------------------------------------*/
15 
16 #include <nn/srv.h>
17 #include <nn/util.h>
18 #include <nn/os/os_HandleManager.h>
19 #include <nn/ndm/CTR/ndm_Types.h>
20 #include <nn/ndm/ndm_Result.h>
21 #include <nn/ndm/ndm_DebugControl.h>
22 #include <nn/ndm/CTR/ndm_Interface.h>
23 
24 
25 namespace nn {
26 namespace ndm {
27     using namespace CTR;
28     using namespace CTR::detail;
29 
GetCurrentState(void)30 State GetCurrentState( void )
31 {
32     s32 s;
33     NN_UTIL_PANIC_IF_FAILED(Interface::GetCurrentState(&s));
34     return static_cast<State>(s);
35 }
36 
GetTargetState(void)37 State GetTargetState( void )
38 {
39     s32 s;
40     NN_UTIL_PANIC_IF_FAILED(Interface::GetTargetState(&s));
41     return static_cast<State>(s);
42 }
43 
GetStateChangedEvent(nn::os::Event & event)44 void GetStateChangedEvent( nn::os::Event& event )
45 {
46     Handle hEvent;
47     NN_UTIL_PANIC_IF_FAILED(Interface::GetStateChangedEvent(&hEvent));
48     nn::os::HandleManager::AttachHandle(&event, hEvent);
49 }
50 
GetDaemonStatus(DaemonName name)51 IDaemon::Status GetDaemonStatus( DaemonName name )
52 {
53     s32 s;
54     NN_UTIL_PANIC_IF_FAILED(Interface::QueryStatus(name, &s));
55     return static_cast<IDaemon::Status>(s);
56 }
57 
GetDaemonDisableCount(DaemonName name,s32 & count,s32 & countTotal)58 void GetDaemonDisableCount( DaemonName name, s32& count, s32& countTotal )
59 {
60     NN_UTIL_PANIC_IF_FAILED(Interface::GetDaemonDisableCount(name, &count, &countTotal));
61 }
62 
GetSchedulerDisableCount(s32 & count,s32 & countTotal)63 void GetSchedulerDisableCount( s32& count, s32& countTotal )
64 {
65     NN_UTIL_PANIC_IF_FAILED(Interface::GetSchedulerDisableCount(&count, &countTotal));
66 }
67 
GetScanInterval(void)68 s32 GetScanInterval( void )
69 {
70     s32 interval;
71     NN_UTIL_PANIC_IF_FAILED(Interface::GetScanInterval(&interval));
72     return interval;
73 }
74 
SetScanInterval(s32 interval)75 void SetScanInterval( s32 interval )
76 {
77     NN_UTIL_PANIC_IF_FAILED(Interface::SetScanInterval(interval));
78 }
79 
GetRetryInterval(void)80 s32 GetRetryInterval( void )
81 {
82     s32 interval;
83     NN_UTIL_PANIC_IF_FAILED(Interface::GetRetryInterval(&interval));
84     return interval;
85 }
86 
SetRetryInterval(s32 interval)87 void SetRetryInterval( s32 interval )
88 {
89     NN_UTIL_PANIC_IF_FAILED(Interface::SetRetryInterval(interval));
90 }
91 
92 } // end of namespace ndm
93 } // end of namespace nn
94