diff options
Diffstat (limited to 'src/core/hle/service/ndm')
-rw-r--r-- | src/core/hle/service/ndm/ndm.cpp | 20 | ||||
-rw-r--r-- | src/core/hle/service/ndm/ndm.h | 42 | ||||
-rw-r--r-- | src/core/hle/service/ndm/ndm_u.cpp | 44 |
3 files changed, 47 insertions, 59 deletions
diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp index bc9c3413d..9f1536aef 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp @@ -2,23 +2,21 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ndm/ndm.h" #include "common/common_types.h" #include "common/logging/log.h" -#include "core/hle/service/service.h" -#include "core/hle/service/ndm/ndm.h" #include "core/hle/service/ndm/ndm_u.h" +#include "core/hle/service/service.h" namespace Service { namespace NDM { -enum : u32 { - DEFAULT_RETRY_INTERVAL = 10, - DEFAULT_SCAN_INTERVAL = 30 -}; +enum : u32 { DEFAULT_RETRY_INTERVAL = 10, DEFAULT_SCAN_INTERVAL = 30 }; static DaemonMask daemon_bit_mask = DaemonMask::Default; static DaemonMask default_daemon_bit_mask = DaemonMask::Default; -static std::array<DaemonStatus, 4> daemon_status = { DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle }; +static std::array<DaemonStatus, 4> daemon_status = {DaemonStatus::Idle, DaemonStatus::Idle, + DaemonStatus::Idle, DaemonStatus::Idle}; static ExclusiveState exclusive_state = ExclusiveState::None; static u32 scan_interval = DEFAULT_SCAN_INTERVAL; static u32 retry_interval = DEFAULT_RETRY_INTERVAL; @@ -72,7 +70,8 @@ void UnlockState(Service::Interface* self) { void SuspendDaemons(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 bit_mask = cmd_buff[1] & 0xF; - daemon_bit_mask = static_cast<DaemonMask>(static_cast<u32>(default_daemon_bit_mask) & ~bit_mask); + daemon_bit_mask = + static_cast<DaemonMask>(static_cast<u32>(default_daemon_bit_mask) & ~bit_mask); for (size_t index = 0; index < daemon_status.size(); ++index) { if (bit_mask & (1 << index)) { daemon_status[index] = DaemonStatus::Suspended; @@ -229,8 +228,7 @@ void Init() { } void Shutdown() { - } -}// namespace NDM -}// namespace Service +} // namespace NDM +} // namespace Service diff --git a/src/core/hle/service/ndm/ndm.h b/src/core/hle/service/ndm/ndm.h index 5c2b968dc..fb574541d 100644 --- a/src/core/hle/service/ndm/ndm.h +++ b/src/core/hle/service/ndm/ndm.h @@ -12,36 +12,26 @@ class Interface; namespace NDM { -enum class Daemon : u32 { - Cec = 0, - Boss = 1, - Nim = 2, - Friend = 3 -}; +enum class Daemon : u32 { Cec = 0, Boss = 1, Nim = 2, Friend = 3 }; enum class DaemonMask : u32 { - None = 0, - Cec = (1 << static_cast<u32>(Daemon::Cec)), - Boss = (1 << static_cast<u32>(Daemon::Boss)), - Nim = (1 << static_cast<u32>(Daemon::Nim)), - Friend = (1 << static_cast<u32>(Daemon::Friend)), + None = 0, + Cec = (1 << static_cast<u32>(Daemon::Cec)), + Boss = (1 << static_cast<u32>(Daemon::Boss)), + Nim = (1 << static_cast<u32>(Daemon::Nim)), + Friend = (1 << static_cast<u32>(Daemon::Friend)), Default = Cec | Friend, - All = Cec | Boss | Nim | Friend + All = Cec | Boss | Nim | Friend }; -enum class DaemonStatus : u32 { - Busy = 0, - Idle = 1, - Suspending = 2, - Suspended = 3 -}; +enum class DaemonStatus : u32 { Busy = 0, Idle = 1, Suspending = 2, Suspended = 3 }; enum class ExclusiveState : u32 { - None = 0, - Infrastructure = 1, + None = 0, + Infrastructure = 1, LocalCommunications = 2, - Streetpass = 3, - StreetpassData = 4, + Streetpass = 3, + StreetpassData = 4, }; /** @@ -205,7 +195,6 @@ void SetRetryInterval(Service::Interface* self); */ void GetRetryInterval(Service::Interface* self); - /** * NDM::OverrideDefaultDaemons service function * Inputs: @@ -233,7 +222,8 @@ void ResetDefaultDaemons(Service::Interface* self); * 1 : Result, 0 on success, otherwise error code * 2 : Daemon bit mask * Note: - * Gets the current default daemon bit mask. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS) + * Gets the current default daemon bit mask. The default value is (DAEMONMASK_CEC | + * DAEMONMASK_FRIENDS) */ void GetDefaultDaemons(Service::Interface* self); @@ -252,5 +242,5 @@ void Init(); /// Shutdown NDM service void Shutdown(); -}// namespace NDM -}// namespace Service +} // namespace NDM +} // namespace Service diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index 3ff0744ee..f5c7a341a 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -9,28 +9,28 @@ namespace Service { namespace NDM { const Interface::FunctionInfo FunctionTable[] = { - {0x00010042, EnterExclusiveState, "EnterExclusiveState"}, - {0x00020002, LeaveExclusiveState, "LeaveExclusiveState"}, - {0x00030000, QueryExclusiveMode, "QueryExclusiveMode"}, - {0x00040002, LockState, "LockState"}, - {0x00050002, UnlockState, "UnlockState"}, - {0x00060040, SuspendDaemons, "SuspendDaemons"}, - {0x00070040, ResumeDaemons, "ResumeDaemons"}, - {0x00080040, SuspendScheduler, "SuspendScheduler"}, - {0x00090000, ResumeScheduler, "ResumeScheduler"}, - {0x000A0000, nullptr, "GetCurrentState"}, - {0x000B0000, nullptr, "GetTargetState"}, - {0x000C0000, nullptr, "<Stubbed>"}, - {0x000D0040, QueryStatus, "QueryStatus"}, - {0x000E0040, GetDaemonDisableCount, "GetDaemonDisableCount"}, - {0x000F0000, GetSchedulerDisableCount,"GetSchedulerDisableCount"}, - {0x00100040, SetScanInterval, "SetScanInterval"}, - {0x00110000, GetScanInterval, "GetScanInterval"}, - {0x00120040, SetRetryInterval, "SetRetryInterval"}, - {0x00130000, GetRetryInterval, "GetRetryInterval"}, - {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, - {0x00150000, ResetDefaultDaemons, "ResetDefaultDaemons"}, - {0x00160000, GetDefaultDaemons, "GetDefaultDaemons"}, + {0x00010042, EnterExclusiveState, "EnterExclusiveState"}, + {0x00020002, LeaveExclusiveState, "LeaveExclusiveState"}, + {0x00030000, QueryExclusiveMode, "QueryExclusiveMode"}, + {0x00040002, LockState, "LockState"}, + {0x00050002, UnlockState, "UnlockState"}, + {0x00060040, SuspendDaemons, "SuspendDaemons"}, + {0x00070040, ResumeDaemons, "ResumeDaemons"}, + {0x00080040, SuspendScheduler, "SuspendScheduler"}, + {0x00090000, ResumeScheduler, "ResumeScheduler"}, + {0x000A0000, nullptr, "GetCurrentState"}, + {0x000B0000, nullptr, "GetTargetState"}, + {0x000C0000, nullptr, "<Stubbed>"}, + {0x000D0040, QueryStatus, "QueryStatus"}, + {0x000E0040, GetDaemonDisableCount, "GetDaemonDisableCount"}, + {0x000F0000, GetSchedulerDisableCount, "GetSchedulerDisableCount"}, + {0x00100040, SetScanInterval, "SetScanInterval"}, + {0x00110000, GetScanInterval, "GetScanInterval"}, + {0x00120040, SetRetryInterval, "SetRetryInterval"}, + {0x00130000, GetRetryInterval, "GetRetryInterval"}, + {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, + {0x00150000, ResetDefaultDaemons, "ResetDefaultDaemons"}, + {0x00160000, GetDefaultDaemons, "GetDefaultDaemons"}, {0x00170000, ClearHalfAwakeMacFilter, "ClearHalfAwakeMacFilter"}, }; |