NIM services: Difference between revisions
→SystemUpdateTaskInfo: throughput calc |
|||
(6 intermediate revisions by 4 users not shown) | |||
Line 98: | Line 98: | ||
| 46 || [3.0.0+] | | 46 || [3.0.0+] | ||
|- | |- | ||
| 47 || [4.0.0 | | 47 || [4.0.0-9.2.0] | ||
|- | |- | ||
| 48 || [4.0.0+] | | 48 || [4.0.0+] | ||
Line 217: | Line 217: | ||
|- | |- | ||
| 106 || [9.0.0+] | | 106 || [9.0.0+] | ||
|- | |||
| 107 || [10.0.0+] | |||
|- | |||
| 108 || [10.0.0+] | |||
|- | |||
| 109 || [10.0.0+] | |||
|- | |||
| 110 || [10.0.0+] | |||
|- | |||
| 111 || [10.0.0+] | |||
|- | |||
| 112 || [10.0.0+] | |||
|- | |||
| 113 || [10.0.0+] | |||
|- | |||
| 114 || [10.0.0+] | |||
|- | |||
| 115 || [10.0.0+] | |||
|- | |||
| 116 || [10.0.0+] | |||
|- | |||
| 118 || [10.0.0+] | |||
|} | |} | ||
Line 224: | Line 246: | ||
== CreateSystemUpdateTask == | == CreateSystemUpdateTask == | ||
Takes an input u32 firmware_variation, an u32 '''unk''', a [[NCM_services#ContentMetaKey|ContentMetaKey]], returns an output [[# | Takes an input u32 firmware_variation, an u32 '''unk''', a [[NCM_services#ContentMetaKey|ContentMetaKey]], returns an output [[#SystemUpdateTaskId]]. | ||
Official sw sets '''unk''' to: <code>unk = inflag & 1 ? 0xC : 0x4</code>. | Official sw sets '''unk''' to: <code>unk = inflag & 1 ? 0xC : 0x4</code>. | ||
== DestroySystemUpdateTask == | == DestroySystemUpdateTask == | ||
Takes an input [[# | Takes an input [[#SystemUpdateTaskId]], no output. | ||
== ListSystemUpdateTask == | == ListSystemUpdateTask == | ||
Takes a type-0x6 output buffer, for an array of [[# | Takes a type-0x6 output buffer, for an array of [[#SystemUpdateTaskId]]. Returns a s32 for total output entries. | ||
== GetSystemUpdateTaskInfo == | == GetSystemUpdateTaskInfo == | ||
Takes an input [[# | Takes an input [[#SystemUpdateTaskId]], returns an output [[#SystemUpdateTaskInfo]]. | ||
== CommitSystemUpdateTask == | == CommitSystemUpdateTask == | ||
Takes an input [[# | Takes an input [[#SystemUpdateTaskId]], no output. | ||
== GetNetworkInstallTaskInfo == | == GetNetworkInstallTaskInfo == | ||
Takes an input [[#NetworkInstallTask]], returns an output [[#NetworkInstallTaskInfo]]. | Takes an input [[#NetworkInstallTask]], returns an output [[#NetworkInstallTaskInfo]]. | ||
[10.0.0+] This now returns a total of 0x48-bytes of output instead of 0x40-bytes. | |||
== GetDownloadedSystemDataPath == | == GetDownloadedSystemDataPath == | ||
Takes an input u64 titleID, a [[# | Takes an input u64 titleID, a [[#SystemUpdateTaskId]], and an type-0x16 output buffer containing the [[Filesystem_services|ContentPath]]. | ||
Gets the FS ContentPath for the specified task and title. | Gets the FS ContentPath for the specified task and title. | ||
== IsExFatDriverIncluded == | == IsExFatDriverIncluded == | ||
Takes an input [[# | Takes an input [[#SystemUpdateTaskId]], returns an output u8 bool flag. | ||
== GetApplyDeltaTaskInfo == | == GetApplyDeltaTaskInfo == | ||
Line 382: | Line 406: | ||
This is the Send version of [[#Cmd71]]. | This is the Send version of [[#Cmd71]]. | ||
== | == SystemUpdateTaskId == | ||
This is | This is an 0x10 byte struct containing an nn::util::Uuid. | ||
== SystemUpdateTaskInfo == | == SystemUpdateTaskInfo == | ||
Line 392: | Line 416: | ||
! Description | ! Description | ||
|- | |- | ||
| 0x0 || 0x1 || | | 0x0 || 0x1 || InstallProgressState | ||
|- | |- | ||
| | | 0x4 || 0x4 || LastResult | ||
|- | |- | ||
| | | 0x8 || 0x8 || InstalledSize | ||
|- | |- | ||
| | | 0x10 || 0x8 || TotalSize | ||
|- | |- | ||
| | | 0x18 || 0x8 || [[NCM_services#ContentMetaKey|ContentMetaKey]] | ||
|- | |- | ||
| 0x28 || 0x8 || | | 0x28 || 0x8 || BytesInstalled | ||
|- | |- | ||
| 0x30 || 0x8 || | | 0x30 || 0x8 || ElapsedTimeNs | ||
|- | |- | ||
| 0x38 || | | 0x38 || 0x1 || SystemUpdateTaskApplyInfo | ||
|} | |} | ||
This is a 0x28-byte struct. [3.0.0+] This is a 0x38-byte struct. [5.0.0+] This is a 0x40-byte struct. | This is a 0x28-byte struct. [3.0.0+] This is a 0x38-byte struct. [5.0.0+] This is a 0x40-byte struct. | ||
The 0x10-bytes at +0x8 are returned by [[NS_Services#GetDownloadProgress]]. | The first 0x18-bytes are obtained from [[NCM_services#GetProgress]] and the 0x10-bytes at +0x8 are returned by [[NS_Services#GetDownloadProgress]]. | ||
The two u64s at +0x28/+0x30 are used by [[NS_Services|NS]] to calculate "ThroughputKBps" for a SystemPlayReport. | The two u64s at +0x28/+0x30 are obtained from [[NCM_services#GetThroughput]] and used by [[NS_Services|NS]] to calculate "ThroughputKBps" for a SystemPlayReport. | ||
The byte at +0x38 is obtained from [[NCM_services#GetSystemUpdateTaskApplyInfo]]. | |||
== NetworkInstallTask == | == NetworkInstallTask == | ||
Line 512: | Line 534: | ||
|- | |- | ||
| 1 || [3.0.0+] RequestCachedDeviceAuthenticationToken | | 1 || [3.0.0+] RequestCachedDeviceAuthenticationToken | ||
|- | |||
| 2 || [10.0.0+] RequestEdgeToken | |||
|- | |||
| 3 || [10.0.0+] RequestCachedEdgeToken | |||
|- | |- | ||
| 100 || RequestRegisterDeviceAccount | | 100 || RequestRegisterDeviceAccount | ||
Line 579: | Line 605: | ||
|- | |- | ||
| 3 || [6.0.0+] RegisterDebugResponse | | 3 || [6.0.0+] RegisterDebugResponse | ||
|- | |||
| 4 || [10.0.0+] IsLargeResourceAvailable | |||
|} | |} | ||
Line 800: | Line 828: | ||
| 0x5 || 0x1 || Padding | | 0x5 || 0x1 || Padding | ||
|- | |- | ||
| 0x6 || 0x2 || u16 | | 0x6 || 0x2 || u16 meta_size. Must be <=0x1000. | ||
|- | |- | ||
| 0x8 || 0x8 || s64 | | 0x8 || 0x8 || s64 data_size. Must not be negative. During message-specific handling with request/reply this must also match the expected value (except for ID 0x0 which is ignored in this case). | ||
|} | |} | ||
After the header is the associated data for | After the header is the associated data for meta_size and data_size. The functions which generate the header always leave meta_size at value 0, when receiving the data for meta_size the received data is unused. | ||
The first message used by the client with SystemUpdate is ID 0x1. | The first message used by the client with SystemUpdate is ID 0x1. | ||
Line 815: | Line 843: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! ID || Request | ! ID || Request data_size / data || Reply data_size / data || Description | ||
|- | |- | ||
| 0x0 || 0x0 || 0x0 || Tells the server to exit. When handling this the handler func will immediately return 0, without sending a reply. | | 0x0 || 0x0 || 0x0 || Tells the server to exit. When handling this the handler func will immediately return 0, without sending a reply. | ||
|- | |- | ||
| 0x1 || [[NCM_services#ContentMetaKey|ContentMetaKey]] || | | 0x1 || [[NCM_services#ContentMetaKey|ContentMetaKey]] || [[CNMT#Content_Records|PackagedContentInfo]] || Gets the PackagedContentInfo with type==Meta for the specified ContentMetaKey. The SystemUpdate client uses the ContentMetaKey from [[#Cmd69]]. | ||
|- | |- | ||
| 0x2 || 0x18-bytes: [[NCM_services#ContentId|ContentId]], u8 flag, u8 pad[7]. When flag is 0, during the transfer [[#SendSystemUpdateTaskInfo]] [[NS_Services#SystemUpdateProgress|SystemUpdateProgress]] | | 0x2 || 0x18-bytes: [[NCM_services#ContentId|ContentId]], u8 flag, u8 pad[7]. When flag is 0, during the transfer [[#SendSystemUpdateTaskInfo]] [[NS_Services#SystemUpdateProgress|SystemUpdateProgress]] current_size is increased using the size of the current chunk. Once the transfer is finished, the end result is that it would be increased by the total content-size. The only time the nim client sets this flag to 1 with SystemUpdate is with the SystemUpdate Meta content. || Size from [[NCM_services#GetSizeFromContentId|GetSizeFromContentId]] with data from [[NCM_services#ReadContentIdFile|ReadContentIdFile]]. || Gets the entire content data for the specified ContentId. The client uses each received chunk of data during the transfer with [[NCM_services|WritePlaceHolder]]. | ||
|- | |- | ||
| 0x3 || 0x10-byte input for [[ETicket_services|es]] GetCommonTicketAndCertificateSize/GetCommonTicketAndCertificateData. || 0x8-bytes: two size u32s. Then two blocks of data with the sizes specified by the u32s. The server loads the sizes and data from [[ETicket_services|es]] GetCommonTicketAndCertificateSize/GetCommonTicketAndCertificateData. || The two blocks of data are used as the buffers for [[ETicket_services|es]] ImportTicket by the client. This is used for transferring the specified Application Patch CommonTicket. | | 0x3 || 0x10-byte input for [[ETicket_services|es]] GetCommonTicketAndCertificateSize/GetCommonTicketAndCertificateData. || 0x8-bytes: two size u32s. Then two blocks of data with the sizes specified by the u32s. The server loads the sizes and data from [[ETicket_services|es]] GetCommonTicketAndCertificateSize/GetCommonTicketAndCertificateData. || The two blocks of data are used as the buffers for [[ETicket_services|es]] ImportTicket by the client. This is used for transferring the specified Application Patch CommonTicket. | ||
|- | |- | ||
| 0x4 || s64 | | 0x4 || s64 total_size || 0x0 || The input data is copied into the server state, for [[#SendSystemUpdateTaskInfo]] [[NS_Services#SystemUpdateProgress|SystemUpdateProgress]] total_size. | ||
|} | |} | ||
[[Category:Services]] | [[Category:Services]] |