ndm.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. // Copyright 2016 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. namespace Service {
  7. class Interface;
  8. namespace NDM {
  9. enum class Daemon : u32 {
  10. Cec = 0,
  11. Boss = 1,
  12. Nim = 2,
  13. Friend = 3
  14. };
  15. enum class DaemonMask : u32 {
  16. None = 0,
  17. Cec = (1 << static_cast<u32>(Daemon::Cec)),
  18. Boss = (1 << static_cast<u32>(Daemon::Boss)),
  19. Nim = (1 << static_cast<u32>(Daemon::Nim)),
  20. Friend = (1 << static_cast<u32>(Daemon::Friend)),
  21. Default = Cec | Friend,
  22. All = Cec | Boss | Nim | Friend
  23. };
  24. enum class DaemonStatus : u32 {
  25. Busy = 0,
  26. Idle = 1,
  27. Suspending = 2,
  28. Suspended = 3
  29. };
  30. enum class ExclusiveState : u32 {
  31. None = 0,
  32. Infrastructure = 1,
  33. LocalCommunications = 2,
  34. Streetpass = 3,
  35. StreetpassData = 4,
  36. };
  37. /**
  38. * NDM::EnterExclusiveState service function
  39. * Inputs:
  40. * 0 : Header code [0x00010042]
  41. * 1 : Exclusive State
  42. * 2 : 0x20
  43. * Outputs:
  44. * 1 : Result, 0 on success, otherwise error code
  45. */
  46. void EnterExclusiveState(Service::Interface* self);
  47. /**
  48. * NDM::LeaveExclusiveState service function
  49. * Inputs:
  50. * 0 : Header code [0x00020002]
  51. * 1 : 0x20
  52. * Outputs:
  53. * 1 : Result, 0 on success, otherwise error code
  54. */
  55. void LeaveExclusiveState(Service::Interface* self);
  56. /**
  57. * NDM::QueryExclusiveMode service function
  58. * Inputs:
  59. * 0 : Header code [0x00030000]
  60. * Outputs:
  61. * 1 : Result, 0 on success, otherwise error code
  62. * 2 : Current Exclusive State
  63. */
  64. void QueryExclusiveMode(Service::Interface* self);
  65. /**
  66. * NDM::LockState service function
  67. * Inputs:
  68. * 0 : Header code [0x00040002]
  69. * Outputs:
  70. * 1 : Result, 0 on success, otherwise error code
  71. */
  72. void LockState(Service::Interface* self);
  73. /**
  74. * NDM::UnlockState service function
  75. * Inputs:
  76. * 0 : Header code [0x00050002]
  77. * Outputs:
  78. * 1 : Result, 0 on success, otherwise error code
  79. */
  80. void UnlockState(Service::Interface* self);
  81. /**
  82. * NDM::SuspendDaemons service function
  83. * Inputs:
  84. * 0 : Header code [0x00060040]
  85. * 1 : Daemon bit mask
  86. * Outputs:
  87. * 1 : Result, 0 on success, otherwise error code
  88. */
  89. void SuspendDaemons(Service::Interface* self);
  90. /**
  91. * NDM::ResumeDaemons service function
  92. * Inputs:
  93. * 0 : Header code [0x00070040]
  94. * 1 : Daemon bit mask
  95. * Outputs:
  96. * 1 : Result, 0 on success, otherwise error code
  97. */
  98. void ResumeDaemons(Service::Interface* self);
  99. /**
  100. * NDM::SuspendScheduler service function
  101. * Inputs:
  102. * 0 : Header code [0x00080040]
  103. * Outputs:
  104. * 1 : Result, 0 on success, otherwise error code
  105. */
  106. void SuspendScheduler(Service::Interface* self);
  107. /**
  108. * NDM::ResumeScheduler service function
  109. * Inputs:
  110. * 0 : Header code [0x00090000]
  111. * Outputs:
  112. * 1 : Result, 0 on success, otherwise error code
  113. */
  114. void ResumeScheduler(Service::Interface* self);
  115. /**
  116. * NDM::QueryStatus service function
  117. * Inputs:
  118. * 0 : Header code [0x000D0040]
  119. * 1 : Daemon
  120. * Outputs:
  121. * 1 : Result, 0 on success, otherwise error code
  122. * 2 : Daemon status
  123. */
  124. void QueryStatus(Service::Interface* self);
  125. /**
  126. * NDM::GetDaemonDisableCount service function
  127. * Inputs:
  128. * 0 : Header code [0x000E0040]
  129. * 1 : Daemon
  130. * Outputs:
  131. * 1 : Result, 0 on success, otherwise error code
  132. * 2 : Current process disable count
  133. * 3 : Total disable count
  134. */
  135. void GetDaemonDisableCount(Service::Interface* self);
  136. /**
  137. * NDM::GetSchedulerDisableCount service function
  138. * Inputs:
  139. * 0 : Header code [0x000F0000]
  140. * Outputs:
  141. * 1 : Result, 0 on success, otherwise error code
  142. * 2 : Current process disable count
  143. * 3 : Total disable count
  144. */
  145. void GetSchedulerDisableCount(Service::Interface* self);
  146. /**
  147. * NDM::SetScanInterval service function
  148. * Inputs:
  149. * 0 : Header code [0x00100040]
  150. * 1 : Interval (default = 30)
  151. * Outputs:
  152. * 1 : Result, 0 on success, otherwise error code
  153. */
  154. void SetScanInterval(Service::Interface* self);
  155. /**
  156. * NDM::GetScanInterval service function
  157. * Inputs:
  158. * 0 : Header code [0x00110000]
  159. * Outputs:
  160. * 1 : Result, 0 on success, otherwise error code
  161. * 2 : Interval (default = 30)
  162. */
  163. void GetScanInterval(Service::Interface* self);
  164. /**
  165. * NDM::SetRetryInterval service function
  166. * Inputs:
  167. * 0 : Header code [0x00120040]
  168. * 1 : Interval (default = 10)
  169. * Outputs:
  170. * 1 : Result, 0 on success, otherwise error code
  171. */
  172. void SetRetryInterval(Service::Interface* self);
  173. /**
  174. * NDM::GetRetryInterval service function
  175. * Inputs:
  176. * 0 : Header code [0x00130000]
  177. * Outputs:
  178. * 1 : Result, 0 on success, otherwise error code
  179. * 2 : Interval (default = 10)
  180. */
  181. void GetRetryInterval(Service::Interface* self);
  182. /**
  183. * NDM::OverrideDefaultDaemons service function
  184. * Inputs:
  185. * 0 : Header code [0x00140040]
  186. * 1 : Daemon bit mask
  187. * Outputs:
  188. * 1 : Result, 0 on success, otherwise error code
  189. */
  190. void OverrideDefaultDaemons(Service::Interface* self);
  191. /**
  192. * NDM::ResetDefaultDaemons service function
  193. * Inputs:
  194. * 0 : Header code [0x00150000]
  195. * Outputs:
  196. * 1 : Result, 0 on success, otherwise error code
  197. */
  198. void ResetDefaultDaemons(Service::Interface* self);
  199. /**
  200. * NDM::GetDefaultDaemons service function
  201. * Inputs:
  202. * 0 : Header code [0x00160000]
  203. * Outputs:
  204. * 1 : Result, 0 on success, otherwise error code
  205. * 2 : Daemon bit mask
  206. * Note:
  207. * Gets the current default daemon bit mask. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS)
  208. */
  209. void GetDefaultDaemons(Service::Interface* self);
  210. /**
  211. * NDM::ClearHalfAwakeMacFilter service function
  212. * Inputs:
  213. * 0 : Header code [0x00170000]
  214. * Outputs:
  215. * 1 : Result, 0 on success, otherwise error code
  216. */
  217. void ClearHalfAwakeMacFilter(Service::Interface* self);
  218. /// Initialize NDM service
  219. void Init();
  220. /// Shutdown NDM service
  221. void Shutdown();
  222. }// namespace NDM
  223. }// namespace Service