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 // デーモンの動作を許可する。 43 // 動作を許可されたデーモンは無線などのネットワーク機能を使い始めることができる。 44 virtual Result Resume(void) = 0; 45 46 // デーモンの動作を停止する。 47 // デーモンは要求を受け付けたら処理を返す前に状態を STATUS_SUSPENDING にする。 48 // 完全に通信処理が終わったら状態を STATUS_SUSPENDED にする。 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