PSC services: Difference between revisions
No edit summary |
|||
| Line 187: | Line 187: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 10100 || | | 10100 || [[#SaveReport]] | ||
|- | |- | ||
| 10101 || [6.0.0+] | | 10101 || [6.0.0+] [[#SaveReportWithUser]] | ||
|- | |- | ||
| 10200 || [6.0.0+] | | 10200 || [6.0.0+] [[#SaveReportForAntiPiracy]] | ||
|- | |- | ||
| 10201 || [6.0.0+] | | 10201 || [6.0.0+] [[#SaveReportWithUserForAntiPiracy]] | ||
|- | |- | ||
| 10300 || [15.0.0+] | | 10300 || [15.0.0+] [[#SendReportWithUser]] | ||
|- | |- | ||
| 11000 || [6.0.0+] | | 11000 || [6.0.0+] [[#NotifyUserList]] | ||
|- | |- | ||
| 11001 || [6.0.0+] | | 11001 || [6.0.0+] [[#NotifyUserDeleted]] | ||
|- | |- | ||
| 11002 || [6.0.0+] | | 11002 || [6.0.0+] [[#NotifyUserRegistered]] | ||
|- | |- | ||
| 11003 || [6.0.0-10.2.0] | | 11003 || [6.0.0-10.2.0] [[#NotifyUserClosed]] | ||
|- | |- | ||
| 11004 || [6.0.0-10.2.0] | | 11004 || [6.0.0-10.2.0] [[#NotifyUserOpened]] | ||
|- | |- | ||
| 11005 || [11.0.0+] | | 11005 || [11.0.0+] [[#NotifyUserClosedWithApplicationId]] | ||
|- | |- | ||
| 11006 || [11.0.0+] | | 11006 || [11.0.0+] [[#NotifyUserOpenedWithApplicationId]] | ||
|- | |- | ||
| 11100 || [6.0.0+] | | 11100 || [6.0.0+] NotifyCompletedNetworkRequestChanged | ||
|- | |- | ||
| 11200 || [6.0.0+] | | 11200 || [6.0.0+] NotifyFriendPresenceChanged | ||
|- | |- | ||
| 11300 || [6.0.0+] | | 11300 || [6.0.0+] NotifyNotificationConnectivityChanged | ||
|- | |- | ||
| 11400 || [6.0.0+] | | 11400 || [6.0.0+] NotifyDeviceOperationModeChanged | ||
|- | |- | ||
| 11500 || [6.0.0+] | | 11500 || [6.0.0+] NotifySystemPowerStateChanged | ||
|- | |- | ||
| 11600 || [6.0.0+] | | 11600 || [6.0.0+] NotifyAppletLaunched | ||
|- | |- | ||
| 11601 || [6.0.0+] | | 11601 || [6.0.0+] NotifyAppletExited | ||
|- | |- | ||
| 11602 || [6.0.0+] | | 11602 || [6.0.0+] NotifyForegroundAppletChanged | ||
|- | |- | ||
| 11700 || [6.0.0+] | | 11700 || [6.0.0+] NotifyControllerCountChanged | ||
|- | |- | ||
| 11800 || [6.0.0+] | | 11800 || [6.0.0+] NotifyAudioInStarted | ||
|- | |- | ||
| 11801 || [6.0.0+] | | 11801 || [6.0.0+] NotifyAudioInStopped | ||
|- | |- | ||
| 11810 || [8.0.0+] | | 11810 || [8.0.0+] NotifyLaunchApplicationStorage | ||
|- | |- | ||
| 11811 || [8.0.0+] | | 11811 || [8.0.0+] NotifyApplicationRightsInfo | ||
|- | |- | ||
| 12000 || [8.0.0+] | | 12000 || [8.0.0+] [[#RegisterWatchdog]] | ||
|- | |- | ||
| 12001 || [8.0.0+] | | 12001 || [8.0.0+] [[#UnregisterWatchdog]] | ||
|- | |- | ||
| 13000 || [8.0.0+] [[# | | 13000 || [8.0.0+] [[#GetSyslogLogger]] | ||
|- | |- | ||
| 13001 || [8.0.0+] | | 13001 || [8.0.0+] [[#SaveSyslogReport]] | ||
|- | |- | ||
| 20100 || | | 20100 || [[#PopReport]] | ||
|- | |- | ||
| 20200 || | | 20200 || [[#GetPushEventReadableHandle]] | ||
|- | |- | ||
| 20300 || [6.0.0+] | | 20300 || [6.0.0+] [[#Shutdown]] | ||
|- | |- | ||
| 20400 || [6.0.0+] | | 20400 || [6.0.0+] [[#PopLostByBufferShortageInfo]] | ||
|- | |- | ||
| 20401 || [6.0.0+] | | 20401 || [6.0.0+] [[#GetBufferUsageInfo]] | ||
|- | |- | ||
| 20402 || [7.0.0+] | | 20402 || [7.0.0+] [[#SetDurationReportChatteringDetectionThreshold]] | ||
|- | |- | ||
| 20500 || [8.0.0+] | | 20500 || [8.0.0+] [[#GetWatchdogStatistics]] | ||
|- | |- | ||
| 20600 || [15.0.0+] | | 20600 || [15.0.0+] NotifyForegroundTransmissionResult | ||
|} | |} | ||
== | == SaveReport == | ||
Takes a type-0x9 input buffer containing the [[# | Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''' and a type-0x5 input buffer containing the [[#SystemReport]]. No output. | ||
<code>nn::srepo::detail::VerifyEventId</code> is then used with the [[#EventId]], throwing error on failure. | |||
The | The [[#SystemReport]] is used with <code>nn::srepo::detail::VerifyReport</code> and with last param = 0x8000, throwing error on failure. | ||
Lastly, the actual processing func is called, returning the Result from here. Besides various cmd input being passed to this etc, this also passes the output from <code>nn::util::GenerateUuid()</code> to this. | Lastly, the actual processing func is called, returning the Result from here. Besides various cmd input being passed to this etc, this also passes the output from <code>nn::util::GenerateUuid()</code> to this. | ||
== | == SaveReportWithUser == | ||
Takes a type-0x9 input buffer containing the [[# | Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''', a type-0x5 input buffer containing the [[#SystemReport]] and an input [[Account_services#Uid|Uid]]. No output. | ||
Same as [[# | Same as [[#SaveReport]] except instead of calling the processing func with Uid=all-zero, the input Uid is passed instead (which must be non-zero). | ||
== | == SaveReportForAntiPiracy == | ||
Takes a type-0x9 input buffer containing the [[# | Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''' and a type-0x5 input buffer containing the [[#SystemReport]]. No output. | ||
Same as [[# | Same as [[#SaveReport]] except the [[#SystemReport]] Version field is 1 instead of 0. | ||
== | == SaveReportWithUserForAntiPiracy == | ||
Takes a type-0x9 input buffer containing the [[# | Takes a type-0x9 input buffer containing the [[#EventId]], an input u64 '''ApplicationId''', a type-0x5 input buffer containing the [[#SystemReport]] and an input [[Account_services#Uid|Uid]]. No output. | ||
Same as [[# | Same as [[#SaveReportWithUser]] except the [[#SystemReport]] Version field is 1 instead of 0. | ||
== | == SendReportWithUser == | ||
Takes | Takes an input [[Account_services#Uid|Uid]], an input u64 '''ApplicationId''', an input bool (padded to u64), two input u32s, a type-0x9 input buffer and a TransferMemory handle. Returns an output [[#IAsyncContext]]. | ||
The mapped TransferMemory buffer is used with <code>nn::srepo::detail::VerifyReport</code>, returning an error on failure. | The mapped TransferMemory buffer is used with <code>nn::srepo::detail::VerifyReport</code>, returning an error on failure. | ||
== | == NotifyUserList == | ||
Takes a type-0x9 input buffer containing an array of | Takes a type-0x9 input buffer containing an array of [[Account_services#Uid|Uid]]. No output. | ||
The Sf handler code (func which calls the serv obj vfunc) will throw an error if the buffer size is >0x8F (that is, >8 entries). | The Sf handler code (func which calls the serv obj vfunc) will throw an error if the buffer size is >0x8F (that is, >8 entries). | ||
| Line 298: | Line 298: | ||
This gets data from a state list, then clears the is_initialized flag for each entry. Lastly when the input array count is non-zero, this loops through the input array writing each entry into the aforementioned state list. If this would run out of space, it would skip writing that entry and still continue - however this shouldn't be possible with the above Sf check. Then this returns 0. | This gets data from a state list, then clears the is_initialized flag for each entry. Lastly when the input array count is non-zero, this loops through the input array writing each entry into the aforementioned state list. If this would run out of space, it would skip writing that entry and still continue - however this shouldn't be possible with the above Sf check. Then this returns 0. | ||
== | == NotifyUserDeleted == | ||
Takes | Takes an input [[Account_services#Uid|Uid]]. No output. | ||
This calls the same state-reset func as [[# | This calls the same state-reset func as [[#NotifyUserList]], except this passes the input Uid instead. Then this returns 0. | ||
== | == NotifyUserRegistered == | ||
Takes | Takes an input [[Account_services#Uid|Uid]]. No output. | ||
This calls the same state-writing func as [[# | This calls the same state-writing func as [[#NotifyUserList]], except this passes the input Uid instead. Then this returns 0. | ||
== | == NotifyUserClosed == | ||
Takes | Takes an input [[Account_services#Uid|Uid]]. No output. | ||
== | == NotifyUserOpened == | ||
Takes | Takes an input [[Account_services#Uid|Uid]]. No output. | ||
== NotifyUserClosedWithApplicationId == | |||
Takes an input [[Account_services#Uid|Uid]] and an input u64 '''ApplicationId'''. No output. | |||
== | == NotifyUserOpenedWithApplicationId == | ||
Takes | Takes an input [[Account_services#Uid|Uid]] and an input u64 '''ApplicationId'''. No output. | ||
== RegisterWatchdog == | |||
Takes a type-0x9 input buffer, an input s64 "nn::TimeSpanType" and an input u64. Returns an output [[#WatchdogHandle]]. | |||
== | == UnregisterWatchdog == | ||
Takes | Takes an input [[#WatchdogHandle]]. No output. | ||
== GetSyslogLogger == | |||
== | |||
Takes a type-0x5 input buffer. No output. | Takes a type-0x5 input buffer. No output. | ||
[9.0.0+] No input. Returns | [9.0.0+] No input. Returns three output u32s, an [[#ISyslogLogger]] and a SharedMemory handle. | ||
The SharedMemory is mapped with the returned size and with permissions=RW. | The SharedMemory is mapped with the returned size and with permissions=RW. | ||
== | == SaveSyslogReport == | ||
Takes | Takes an input u128 "nn::util::Uuid". No output. | ||
== | == PopReport == | ||
Takes a type-0xA output buffer and a type-0x6 output buffer. Returns | Takes a type-0xA output buffer and a type-0x6 output buffer. Returns an output [[Account_services#Uid|Uid]]. | ||
[6.0.0+] This now returns an additional | [6.0.0+] This now returns an additional output u64 '''ApplicationId''' and an output u128 "nn::util::Uuid". | ||
[10.0.0+] This now returns an additional | [10.0.0+] This now returns an additional output u64 and two output u32s. | ||
This is only usable with srepo:a. | This is only usable with srepo:a. | ||
== | == GetPushEventReadableHandle == | ||
No input. Returns an output Event handle. | No input. Returns an output Event handle. | ||
This is only usable with srepo:a. | This is only usable with srepo:a. | ||
== Shutdown == | |||
== | |||
No input/output. | No input/output. | ||
== | == PopLostByBufferShortageInfo == | ||
Takes an input u32 | Takes an input u32. Returns two output u64s. | ||
The input | The input u32 must be <=1. This gets data from a state array with the specified index. | ||
== | == GetBufferUsageInfo == | ||
No input. Returns two output u64s. | No input. Returns two output u64s. | ||
The first u64 is a constant value, while the second u64 is from state. | The first u64 is a constant value, while the second u64 is from state. | ||
== | == SetDurationReportChatteringDetectionThreshold == | ||
Takes an input s64 and u64. No output. | Takes an input s64 "nn::TimeSpanType" and an input u64. No output. | ||
The input s64 must be >=1. The two input fields are written into global state, and various state is also cleared. | The input s64 must be >=1. The two input fields are written into global state, and various state is also cleared. | ||
== | == GetWatchdogStatistics == | ||
No input. Returns | No input. Returns an output [[#WatchdogStatistics]]. | ||
This gets two u64s from global state. | This gets two u64s from global state. | ||
== | == NotifyForegroundTransmissionResult == | ||
Takes | Takes an input u128 "nn::util::Uuid" and an input [[#ResultHolder]]. No output. | ||
This goes through the global list of [[#IAsyncContext]] looking for an entry with data matching the input struct, then writes the input | This goes through the global list of [[#IAsyncContext]] looking for an entry with data matching the input struct, then writes the input [[#ResultHolder]] into that [[#IAsyncContext]]. This Result would then be returned by [[#GetResult]] - the Event from [[#GetSystemEvent]] is also signaled. | ||
This always returns 0. | This always returns 0. | ||
| Line 398: | Line 389: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || [[#ReallocateBuffer|ReallocateBuffer]] | ||
|} | |} | ||
=== | === ReallocateBuffer === | ||
No input. Returns two output u32s. | No input. Returns two output u32s. | ||
This does the same entry-allocation in sharedmem as [[# | This does the same entry-allocation in sharedmem as [[#GetSyslogLogger]]. | ||
== IAsyncContext == | == IAsyncContext == | ||