1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     ndm_IDaemon.h
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: 22530 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_NDM_IDAEMON_H_
17 #define NN_NDM_IDAEMON_H_
18 
19 #include <nn/types.h>
20 #include <nn/os/os_Event.h>
21 
22 
23 #ifdef __cplusplus
24 
25 namespace nn{
26 namespace ndm{
27 
28 class IDaemon
29 {
30 public:
31     enum Status
32     {
33         STATUS_WORKING,
34         STATUS_IDLE,
35         STATUS_SUSPENDING,
36         STATUS_SUSPENDED
37     };
38 
39     virtual Result Attach(nn::os::Event& event) = 0;
40     virtual Result Detach(void) = 0;
41 
42     // Permit daemon to run.
43     // The daemon permitted to run can start to use network functionality, such as wireless.
44     virtual Result Resume(void) = 0;
45 
46     // Halt the daemon.
47     // If daemon receives a request, it enters the STATUS_SUSPENDING state before returning the process.
48     // When communication has completely terminated, enters STATUS_SUSPENDED state.
49     virtual Result SuspendAsync(bool bImmediate) = 0;
50 
51     virtual Result QueryStatus(Status& status) = 0;
52 
QueryIsHalfAwakeTriggered(bool & bTriggered)53     virtual Result QueryIsHalfAwakeTriggered(bool& bTriggered)
54     {
55         bTriggered = false;
56         return ResultSuccess();
57     }
58 };
59 
60 }
61 }
62 
63 #endif // __cplusplus
64 
65 #endif // NN_NDM_IDAEMON_H_
66