Apply requested changes

This commit is contained in:
Joel16 2018-01-07 13:46:33 -06:00
parent c8cfa6de44
commit f04f045cf9
2 changed files with 19 additions and 19 deletions

View File

@ -10,8 +10,8 @@ typedef enum {
EXCLUSIVE_STATE_INFRASTRUCTURE = 1, EXCLUSIVE_STATE_INFRASTRUCTURE = 1,
EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS = 2, EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS = 2,
EXCLUSIVE_STATE_STREETPASS = 3, EXCLUSIVE_STATE_STREETPASS = 3,
EXCLUSIVE_STATE_STREETPASS_DATA = 4 EXCLUSIVE_STATE_STREETPASS_DATA = 4,
} NDM_ExclusiveState; } ndmExclusiveState;
/// Current states. /// Current states.
typedef enum { typedef enum {
@ -26,24 +26,24 @@ typedef enum {
STATE_INFRASTRUCTURE_FORCE_DISCONNECTING = 8, STATE_INFRASTRUCTURE_FORCE_DISCONNECTING = 8,
STATE_CEC_WORKING = 9, STATE_CEC_WORKING = 9,
STATE_CEC_FORCE_SUSPENDING = 10, STATE_CEC_FORCE_SUSPENDING = 10,
STATE_CEC_SUSPENDING = 11 STATE_CEC_SUSPENDING = 11,
} NDM_State; } ndmState;
// Daemons. // Daemons.
typedef enum { typedef enum {
DAEMON_CEC = 0, DAEMON_CEC = 0,
DAEMON_BOSS = 1, DAEMON_BOSS = 1,
DAEMON_NIM = 2, DAEMON_NIM = 2,
DAEMON_FRIENDS = 3 DAEMON_FRIENDS = 3,
} NDM_Daemon; } ndmDaemon;
/// Used to specify multiple daemons. /// Used to specify multiple daemons.
typedef enum { typedef enum {
DAEMON_MASK_CEC = 1 << DAEMON_CEC, DAEMON_MASK_CEC = 1 << DAEMON_CEC,
DAEMON_MASK_BOSS = 1 << DAEMON_BOSS, DAEMON_MASK_BOSS = 1 << DAEMON_BOSS,
DAEMON_MASK_NIM = 1 << DAEMON_NIM, DAEMON_MASK_NIM = 1 << DAEMON_NIM,
DAEMON_MASK_FRIENDS = 1 << DAEMON_FRIENDS DAEMON_MASK_FRIENDS = 1 << DAEMON_FRIENDS,
} NDM_Daemon_Mask; } ndmDaemonMask;
// Daemon status. // Daemon status.
typedef enum { typedef enum {
@ -51,7 +51,7 @@ typedef enum {
DAEMON_STATUS_IDLE = 1, DAEMON_STATUS_IDLE = 1,
DAEMON_STATUS_SUSPENDING = 2, DAEMON_STATUS_SUSPENDING = 2,
DAEMON_STATUS_SUSPENDED = 3 DAEMON_STATUS_SUSPENDED = 3
} NDM_Daemon_Status; } ndmDaemonStatus;
/// Initializes ndmu. /// Initializes ndmu.
Result ndmuInit(void); Result ndmuInit(void);
@ -61,9 +61,9 @@ void ndmuExit(void);
/** /**
* @brief Sets the network daemon to an exclusive state. * @brief Sets the network daemon to an exclusive state.
* @param state State specified in the NDM_ExclusiveState enumerator. * @param state State specified in the ndmExclusiveState enumerator.
*/ */
Result NDMU_EnterExclusiveState(NDM_ExclusiveState state); Result NDMU_EnterExclusiveState(ndmExclusiveState state);
/// Cancels an exclusive state for the network daemon. /// Cancels an exclusive state for the network daemon.
Result NDMU_LeaveExclusiveState(void); Result NDMU_LeaveExclusiveState(void);
@ -72,7 +72,7 @@ Result NDMU_LeaveExclusiveState(void);
* @brief Returns the exclusive state for the network daemon. * @brief Returns the exclusive state for the network daemon.
* @param state Pointer to write the exclsuive state to. * @param state Pointer to write the exclsuive state to.
*/ */
Result NDMU_GetExclusiveState(NDM_ExclusiveState *state); Result NDMU_GetExclusiveState(ndmExclusiveState *state);
/// Locks the exclusive state. /// Locks the exclusive state.
Result NDMU_LockState(void); Result NDMU_LockState(void);
@ -93,13 +93,13 @@ Result NDMU_ResumeScheduler(void);
* @brief Returns the current state for the network daemon. * @brief Returns the current state for the network daemon.
* @param state Pointer to write the current state to. * @param state Pointer to write the current state to.
*/ */
Result NDMU_GetCurrentState(NDM_State *state); Result NDMU_GetCurrentState(ndmState *state);
/** /**
* @brief Returns the daemon state. * @brief Returns the daemon state.
* @param state Pointer to write the daemons state to. * @param state Pointer to write the daemons state to.
*/ */
Result NDMU_QueryStatus(NDM_Daemon_Status *state); Result NDMU_QueryStatus(ndmDaemonStatus *status);
/** /**
* @brief Sets the scan interval. * @brief Sets the scan interval.

View File

@ -33,7 +33,7 @@ void ndmuExit(void)
ndmuHandle = 0; ndmuHandle = 0;
} }
Result NDMU_EnterExclusiveState(NDM_ExclusiveState state) Result NDMU_EnterExclusiveState(ndmExclusiveState state)
{ {
u32* cmdbuf=getThreadCommandBuffer(); u32* cmdbuf=getThreadCommandBuffer();
@ -60,7 +60,7 @@ Result NDMU_LeaveExclusiveState(void)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result NDMU_GetExclusiveState(NDM_ExclusiveState *state) Result NDMU_GetExclusiveState(ndmExclusiveState *state)
{ {
u32* cmdbuf=getThreadCommandBuffer(); u32* cmdbuf=getThreadCommandBuffer();
@ -125,7 +125,7 @@ Result NDMU_ResumeScheduler(void)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result NDMU_GetCurrentState(NDM_State *state) Result NDMU_GetCurrentState(ndmState *state)
{ {
u32* cmdbuf=getThreadCommandBuffer(); u32* cmdbuf=getThreadCommandBuffer();
@ -139,7 +139,7 @@ Result NDMU_GetCurrentState(NDM_State *state)
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }
Result NDMU_QueryStatus(NDM_Daemon_Status *state) Result NDMU_QueryStatus(ndmDaemonStatus *status)
{ {
u32* cmdbuf=getThreadCommandBuffer(); u32* cmdbuf=getThreadCommandBuffer();
@ -148,7 +148,7 @@ Result NDMU_QueryStatus(NDM_Daemon_Status *state)
Result ret=0; Result ret=0;
if(R_FAILED(ret=svcSendSyncRequest(ndmuHandle)))return ret; if(R_FAILED(ret=svcSendSyncRequest(ndmuHandle)))return ret;
*state = cmdbuf[2]; *status = cmdbuf[2];
return (Result)cmdbuf[1]; return (Result)cmdbuf[1];
} }