<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CFSworks</id>
	<title>Nintendo Switch Brew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://switchbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CFSworks"/>
	<link rel="alternate" type="text/html" href="https://switchbrew.org/wiki/Special:Contributions/CFSworks"/>
	<updated>2026-04-09T03:32:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10713</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10713"/>
		<updated>2021-02-27T16:00:36Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Beacon */ DTIM count is a countdown (in beacon frames) until the DTIM is reset; it&amp;#039;s not static&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes a PID-descriptor, a reserved input u64 and an input u32. Returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes a PID-descriptor and a reserved input u64. Returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#GetGroupInfo2]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#GetLinkLevel]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#ClearAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]] and a type-0x22 output buffer containing an array of [[#ScanResult]]. Returns an output s32 &#039;&#039;&#039;TotalOut&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]]. No output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer. No output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 &#039;&#039;&#039;Frequency&#039;&#039;&#039;, a s16 &#039;&#039;&#039;Channel&#039;&#039;&#039;, an u32 &#039;&#039;&#039;MessageFlag&#039;&#039;&#039; and a type-0x21 input buffer. No output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 &#039;&#039;&#039;MessageFlag&#039;&#039;&#039; and a type-0x22 output buffer. Returns a [[#MacAddress_2|MacAddress]], an u16 &#039;&#039;&#039;Frequency&#039;&#039;&#039;, a s16 &#039;&#039;&#039;Channel&#039;&#039;&#039;, an u32 &#039;&#039;&#039;OutSize&#039;&#039;&#039; and a s32.&lt;br /&gt;
&lt;br /&gt;
The OutSize is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from MessageFlag: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]]. No output.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#GetGroupInfo2]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#GetLinkLevel]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input. Returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input. Returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer. Returns two output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer. Returns two output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo2 ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input. Returns an output [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== GetLinkLevel ===&lt;br /&gt;
No input. Returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input. Returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]]. Returns an output s32 &#039;&#039;&#039;TotalOut&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID-descriptor, a reserved input u64 and an input u64. Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#GetLinkLevel]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Wrapped master key. When zero, set to randomly-generated data. This is decrypted with a &amp;quot;static AES key&amp;quot; and used to derive the 4 encryption keys for the session.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation to derive keys B and D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdRcd.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used to derive encryption keys A and C. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
Key A derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two vendor-specific Nintendo information elements with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each IE has a 2-byte ID following the OUI. These Nintendo IEs are not used when standard WPA2-PSK is being used.&lt;br /&gt;
&lt;br /&gt;
The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo IEs in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 0 ====&lt;br /&gt;
&lt;br /&gt;
The first Nintendo IE (ID 0x0600) contains the following fixed parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Fixed 0x20; perhaps a version or other magic number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || [[#GroupInfo|SecurityType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || [[#GroupInfo|StaticAesKeyIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Fixed zero; padding byte.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian (i.e. byte-reversed) version of [[#GroupInfo|LocalCommunicationId]]. This is the only context where LocalCommunicationId is reversed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Wrapped master key. Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 0x4 || If encryption is enabled, a randomly-generated nonce, else nothing. Appending 8 zero bytes to this yields the AES-GCM IV.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || If encryption is enabled, the AES-GCM MAC tag, else nothing. All bytes prior to this (fixed 0x20 through nonce) are the additional authenticated data. All bytes after this are encrypted with key B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After this, TLV tagged parameters occur. Each TLV tag is formatted as:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Tag type&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Length&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Data for the tag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Additional network parameters: 0xAB 0xCD. A=[[#GroupInfo]]+0x82, B=[[#GroupInfo|MemberCountMax]], C=[[#GroupInfo|NetworkMode]], D=[[#GroupInfo|PerformanceRequirement]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8 || Flags: Bitwise-or of (1&amp;lt;&amp;lt;f) for each entry in [[#GroupInfo]]+0x40&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 1 ====&lt;br /&gt;
&lt;br /&gt;
The second Nintendo IE (ID 0x0601) contains only TLVs. If encryption is enabled, a 0x4-byte nonce and 0x10-byte AES-GCM tag are written first, as above, and the TLVs are encrypted. Key C is used.&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Varies || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10710</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10710"/>
		<updated>2021-02-26T17:10:12Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Type 0x01: Battery Status */ First byte actually indicates cable status&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Component&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Part&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|SoC&lt;br /&gt;
|Realtek&lt;br /&gt;
|RTD1195 (PB)&lt;br /&gt;
|Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
|DDR3 RAM&lt;br /&gt;
|Winbond&lt;br /&gt;
|W631GG6MB-15&lt;br /&gt;
|128 MiB&lt;br /&gt;
|-&lt;br /&gt;
|NAND Flash&lt;br /&gt;
|Winbond&lt;br /&gt;
|W29N01HVSINA&lt;br /&gt;
|128 MiB&lt;br /&gt;
|-&lt;br /&gt;
|WNIC&lt;br /&gt;
|Realtek&lt;br /&gt;
|RTL8188E&lt;br /&gt;
|Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
|MCU&lt;br /&gt;
|STMicroelectronics&lt;br /&gt;
|STM32F&lt;br /&gt;
|Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
|IMU&lt;br /&gt;
|STMicroelectronics&lt;br /&gt;
|LSM6DSL&lt;br /&gt;
|Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
|Li-ion pouch cell&lt;br /&gt;
|Nintendo branded; OEM unknown&lt;br /&gt;
|HAC-038&lt;br /&gt;
|3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
|Camera&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown&lt;br /&gt;
|Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x10&lt;br /&gt;
|Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|0x20&lt;br /&gt;
|Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|0x2&lt;br /&gt;
|Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x32&lt;br /&gt;
|0xC&lt;br /&gt;
|Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+Summary of ports&lt;br /&gt;
!Protocol&lt;br /&gt;
!Endpoint&lt;br /&gt;
!Port&lt;br /&gt;
!Description&lt;br /&gt;
![[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Management&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; |TCP&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Switch&lt;br /&gt;
|5201&lt;br /&gt;
|[[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
|0x0001&lt;br /&gt;
|-&lt;br /&gt;
|5202&lt;br /&gt;
|RCD handshake service (non-pairing only)&lt;br /&gt;
|0x0001&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Kart&lt;br /&gt;
|5103&lt;br /&gt;
|&amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
|0x0100&lt;br /&gt;
|-&lt;br /&gt;
|5106&lt;br /&gt;
|&amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
|0x0102&lt;br /&gt;
|-&lt;br /&gt;
|5107&lt;br /&gt;
|Unknown (&amp;quot;Event&amp;quot;?) RCD service&lt;br /&gt;
|0x0103&lt;br /&gt;
|-&lt;br /&gt;
|UDP&lt;br /&gt;
|Kart&lt;br /&gt;
|5004&lt;br /&gt;
|Time synchronization&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Video&lt;br /&gt;
|-&lt;br /&gt;
|UDP&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Switch&lt;br /&gt;
|5016+kartid&lt;br /&gt;
|&amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|TCP&lt;br /&gt;
|5032+kartid&lt;br /&gt;
|&amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
|N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Control&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |UDP&lt;br /&gt;
|Kart&lt;br /&gt;
|5102&lt;br /&gt;
|Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|Switch&lt;br /&gt;
|5116+kartid&lt;br /&gt;
|Telemetry&lt;br /&gt;
|N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x20&lt;br /&gt;
|SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
|0x20&lt;br /&gt;
|0x20&lt;br /&gt;
|LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x1&lt;br /&gt;
|boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
|system_major_version&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x29&lt;br /&gt;
|Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x80&lt;br /&gt;
|Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
|0x80&lt;br /&gt;
|0x2&lt;br /&gt;
|Value length&lt;br /&gt;
|-&lt;br /&gt;
|0x82&lt;br /&gt;
|0xE&lt;br /&gt;
|Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
|0x90&lt;br /&gt;
|Varies&lt;br /&gt;
|Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x2&lt;br /&gt;
|Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x2&lt;br /&gt;
|&amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x6&lt;br /&gt;
|0x2&lt;br /&gt;
|&amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|0x8&lt;br /&gt;
|Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x80&lt;br /&gt;
|Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One of the known parameters is &amp;quot;product_code&amp;quot; which includes the kart&#039;s character as 1 byte, and includes a string with the value of the kart&#039;s serial number on the bottom of the kart (white-label barcode).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x80&lt;br /&gt;
|Fixed 0x010000; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x03; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x7&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x24; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0xC&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x01; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x11&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x14; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x20&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0100; padding&lt;br /&gt;
|-&lt;br /&gt;
|0x22&lt;br /&gt;
|0x1&lt;br /&gt;
|Character ID; 0x01 = Mario, 0x02 = Luigi, unknown if there are other &amp;quot;hidden&amp;quot; characters&lt;br /&gt;
|-&lt;br /&gt;
|0x23&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0001; padding&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|0xF&lt;br /&gt;
|Kart Serial Number;&lt;br /&gt;
&#039;&#039;&#039;X&#039;&#039;&#039;: Nintendo Switch Platform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Q&#039;&#039;&#039;: Hardware Identifier for the Mario Kart Live: Home Circuit kart.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J&#039;&#039;&#039;/&#039;&#039;&#039;W&#039;&#039;&#039;: Factory Location; Either &#039;&#039;&#039;W&#039;&#039;&#039;: US, or &#039;&#039;&#039;J&#039;&#039;&#039;: Japan&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;10&#039;&#039;&#039;/&#039;&#039;&#039;14&#039;&#039;&#039;/&#039;&#039;&#039;40&#039;&#039;&#039;/&#039;&#039;&#039;70:&#039;&#039;&#039; Factory Number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last 9 Numbers&#039;&#039;&#039;: Unit Number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0xF&lt;br /&gt;
|Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]]. It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x1&lt;br /&gt;
|Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
|Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x4?&lt;br /&gt;
|Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
|0x8?&lt;br /&gt;
|0x18?&lt;br /&gt;
|Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
The kart will send UDP packets to the Switch over a port it specifies in &amp;quot;connection_info&amp;quot; (but typically port 5116) indicating its current status. The packet type is indicated by the first byte. (The tables below ignore this first byte.)&lt;br /&gt;
&lt;br /&gt;
==== Type 0x01: Battery Status ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Cable status bitmask: 0x1 = Cable connected; 0x2 = Unknown; 0x4 = Unknown&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x2&lt;br /&gt;
|Zero padding&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|How many bars to show in the HUD for battery status (0x00-0x04)&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x1C&lt;br /&gt;
|Zero padding, to bring total packet length to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One would think this would be a good location for wireless metrics (e.g. RSSI), but this is presumably measured only on the Switch side of the link.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x02: IMU ====&lt;br /&gt;
&lt;br /&gt;
The kart contains a 6DoF IMU for measuring movement. This packet type communicates the motion status.&lt;br /&gt;
&lt;br /&gt;
All integers are little-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x2&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Total IMU samples, as an unsigned integer. This number includes the samples in this packet. It overflows.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Flags bitfield: IGA??NNN. I/G/A=High-precision units used, ?=Unknown, possibly clipping indicators. N=Number of IMU samples.&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Pad byte; zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x4&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Microsecond-precision timer, as an unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|0x10&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Orientation: s32 qi, qj, qk, qr; gives the coefficients of a quaternion. Units appear to be increments of 2^-30, but quaternions should always be normalized before use.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator A position&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Every 6ms step: pos += vel&amp;gt;&amp;gt;12; Units: (4096*0.006)² * 2^-30 m (I=1), 78.4348 * (4096*0.006)² * 2^-30 m (I=0)&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator B position&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator A velocity&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Every 6ms step: vel += acc&amp;gt;&amp;gt;12; (where &#039;acc&#039; is acceleration in 2^-30 m/s²). Units: (4096*0.006) * 2^-30 m/s (I=1), 78.4348 * (4096*0.006) * 2^-30 m/s (I=0)&lt;br /&gt;
|-&lt;br /&gt;
|0x3C&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator B velocity&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |0x48&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |0xC*(NNN+1)&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |1-8 raw IMU samples&lt;br /&gt;
|s16 accel_x, accel_y, accel_z; // Units: 9.81/4096 m/s² (A=1), 15.99*9.81/4096 m/s² (A=0) (9.81m/s² added to accel_z to compensate for gravity)&lt;br /&gt;
|-&lt;br /&gt;
|s16 ang_vel_x, ang_vel_y, ang_vel_z; // Units: 0.004375 °/s (G=1), 0.1 °/s (G=0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact rate at which these packets are sent appears to be somewhat variable. The raw IMU samples seem to be collected with a period of 6ms, and when not in drive mode, this packet always contains 8 IMU samples, for an overall period 48ms. However, when in drive mode, not all of these packets contain exactly 8 IMU samples, and the packets will arrive at an uneven rate. This is probably due to some logic in the kart that flushes the buffer early based on certain conditions.&lt;br /&gt;
&lt;br /&gt;
The IMU itself is mounted on the PCB &amp;quot;upside down&amp;quot; which gives a reference frame different from what one would expect: While +X does correspond to the driver&#039;s right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame.&lt;br /&gt;
&lt;br /&gt;
The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to 0i+0j+0k+1 once the IMU is enabled (i.e. when &amp;quot;connection_info&amp;quot; is set).&lt;br /&gt;
&lt;br /&gt;
The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time.&lt;br /&gt;
&lt;br /&gt;
Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x03: Motion feedback ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=RCD&amp;diff=10709</id>
		<title>RCD</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=RCD&amp;diff=10709"/>
		<updated>2021-02-26T15:23:32Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: Document RCD handshake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;RCD is a framework that manages &#039;&#039;&#039;r&#039;&#039;&#039;emote &#039;&#039;&#039;c&#039;&#039;&#039;ontrolled &#039;&#039;&#039;d&#039;&#039;&#039;evices - RC toys that connect to the Nintendo Switch via 802.11 (&amp;quot;WiFi&amp;quot;) link. The first (and currently only) released product to use this framework is [[Mario Kart Live: Home Circuit]].&lt;br /&gt;
&lt;br /&gt;
RCD devices must be paired to the host Switch system in some way (e.g. QR code) and contain the connection settings in non-volatile memory so that they can reconnect on next use without needing to repeat the pairing process.&lt;br /&gt;
&lt;br /&gt;
The RCD framework implements a very simple TCP-based RPC protocol that allows an RCD client to invoke methods on an RCD server. Note that multiple such connections may be established between the Switch and device.&lt;br /&gt;
&lt;br /&gt;
= RCD RPC =&lt;br /&gt;
&lt;br /&gt;
A client connects to a TCP server and sends as many commands as it likes, one at a time (and reading the response after each), before tearing down the TCP connection. It is not valid for a client to send a response to a server or for a server to send a request to a client.&lt;br /&gt;
&lt;br /&gt;
Commands have a 0x10-byte header, followed by a payload of any size up to some maximum (typically 0x1000). All numbers are represented in big-endian format.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Service being accessed&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Command being invoked on that service&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Payload length (PLEN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Status code; ignored (and set to 0) for requests, an [[Error codes|error code]] for responses&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x1 || Flags; currently only the 1s bit is significant: it indicates a response&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x3 || Padding; zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || PLEN || The parameters to the command, or the response&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In theory, multiple &amp;quot;services&amp;quot; could be multiplexed over a single TCP connection, but in practice only a single service is allowed per TCP port.&lt;br /&gt;
&lt;br /&gt;
= Handshake protocol =&lt;br /&gt;
&lt;br /&gt;
Service ID: 0x0001&amp;lt;br /&amp;gt;&lt;br /&gt;
Commands: 4&lt;br /&gt;
&lt;br /&gt;
When a device first establishes a wireless connection, it connects to the Switch on a well-known port to access the &amp;quot;handshake&amp;quot; service and make its presence known. A successful handshake causes application-specific RCD connections to be established. Commands must be sent in order (and no more than once), or error code 0x810e8 is generated by the host.&lt;br /&gt;
&lt;br /&gt;
== Command 0x1: Begin handshake ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x1 input+output payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Handshake protocol version; one byte followed by zero-padding. Must be 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Device &amp;quot;name&amp;quot; (e.g. &#039;Fuji&#039;), followed by zero-padding. The Switch uses the empty string.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Device identifier. Devices embed their MAC as the last 6 bytes; host seems to use a randomly-generated UUID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x20 || Nonce; cryptographic random bytes with no special purpose.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This command is sent first (by the device). The host responds in kind. Error code 0x800e8 is generated if the handshake version is not 1.&lt;br /&gt;
&lt;br /&gt;
== Command 0x2: Version negotiation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x2 input payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || Pairing identifier&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || Number of versions offered&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Varies || One 8-bit integer per version offered. There is no padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x2 output payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || Pairing identifier&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || Selected version&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0xF || Zero-padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are a few moving parts here.&lt;br /&gt;
&lt;br /&gt;
Firstly, this command is responsible for negotiating a version for the underlying protocols. The host looks at all versions offered by the device and selects the newest version that it recognizes. Error code 0x820e8 is sent if no (recognized) versions are offered.&lt;br /&gt;
&lt;br /&gt;
Secondly, the device sends its &amp;quot;pairing identifier,&amp;quot; if it recognizes the name/identifier of the host (from command 0x1). If the device does not recognize the host, it sends all-zeroes instead. If the host recognizes the pairing identifier for the device, it sends that same identifier back and expects command 0x4 next (and command 0x3, if sent, will result in error code 0x810e8). If the host doesn&#039;t recognize the identifier, it will either send error code 0x850e8 (if it isn&#039;t expecting to pair) or send a randomly-generated identifier and expect command 0x3 next.&lt;br /&gt;
&lt;br /&gt;
== Command 0x3: Get secret key ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x3 input payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || Unknown; always all zeroes?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x3 output payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x40 || Secret key&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a new pairing is being established (see command 0x2), this is used to request the secret key generated for the pairing. It&#039;s currently unknown what purpose this &amp;quot;secret key&amp;quot; has.&lt;br /&gt;
&lt;br /&gt;
When not expected (including when the RCD host isn&#039;t set up for pairing), it generates error code 0x810e8.&lt;br /&gt;
&lt;br /&gt;
== Command 0x4: Finalize ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x4 input payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || SHA256 of all payloads (not headers) up to this point after truncation to a multiple of 0x40 bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Command 0x4 output payload&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || SHA256 of all payloads (not headers) up to this point, including the input to this command.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is used to finalize the handshake. SHA256 hashes of the handshake up to this point are exchanged, as an integrity check. If the client sends the wrong hash, error code 0x830e8 is sent. If the device sends the correct hash, the host responds with its own hash, and carries on with using the device.&lt;br /&gt;
&lt;br /&gt;
If the device accepts the response, it leaves the channel open, and activates other network services for the host to use. If the device rejects the response, it closes the channel, resets its networking stack, and attempts the connection again from scratch. Closing the handshake channel at any point afterward will trigger this same behavior.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10702</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10702"/>
		<updated>2021-02-19T11:19:09Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Network protocols */ Never mind about &amp;quot;Fuji Update&amp;quot; - I don&amp;#039;t know what this RCD service is&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Component&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Part&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|SoC&lt;br /&gt;
|Realtek&lt;br /&gt;
|RTD1195 (PB)&lt;br /&gt;
|Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
|DDR3 RAM&lt;br /&gt;
|Winbond&lt;br /&gt;
|W631GG6MB-15&lt;br /&gt;
|128 MiB&lt;br /&gt;
|-&lt;br /&gt;
|NAND Flash&lt;br /&gt;
|Winbond&lt;br /&gt;
|W29N01HVSINA&lt;br /&gt;
|128 MiB&lt;br /&gt;
|-&lt;br /&gt;
|WNIC&lt;br /&gt;
|Realtek&lt;br /&gt;
|RTL8188E&lt;br /&gt;
|Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
|MCU&lt;br /&gt;
|STMicroelectronics&lt;br /&gt;
|STM32F&lt;br /&gt;
|Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
|IMU&lt;br /&gt;
|STMicroelectronics&lt;br /&gt;
|LSM6DSL&lt;br /&gt;
|Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
|Li-ion pouch cell&lt;br /&gt;
|Nintendo branded; OEM unknown&lt;br /&gt;
|HAC-038&lt;br /&gt;
|3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
|Camera&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown&lt;br /&gt;
|Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x10&lt;br /&gt;
|Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|0x20&lt;br /&gt;
|Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|0x2&lt;br /&gt;
|Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x32&lt;br /&gt;
|0xC&lt;br /&gt;
|Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+Summary of ports&lt;br /&gt;
!Protocol&lt;br /&gt;
!Endpoint&lt;br /&gt;
!Port&lt;br /&gt;
!Description&lt;br /&gt;
![[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Management&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; |TCP&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Switch&lt;br /&gt;
|5201&lt;br /&gt;
|[[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
|0x0001&lt;br /&gt;
|-&lt;br /&gt;
|5202&lt;br /&gt;
|RCD handshake service (non-pairing only)&lt;br /&gt;
|0x0001&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Kart&lt;br /&gt;
|5103&lt;br /&gt;
|&amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
|0x0100&lt;br /&gt;
|-&lt;br /&gt;
|5106&lt;br /&gt;
|&amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
|0x0102&lt;br /&gt;
|-&lt;br /&gt;
|5107&lt;br /&gt;
|Unknown (&amp;quot;Event&amp;quot;?) RCD service&lt;br /&gt;
|0x0103&lt;br /&gt;
|-&lt;br /&gt;
|UDP&lt;br /&gt;
|Kart&lt;br /&gt;
|5004&lt;br /&gt;
|Time synchronization&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Video&lt;br /&gt;
|-&lt;br /&gt;
|UDP&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Switch&lt;br /&gt;
|5016+kartid&lt;br /&gt;
|&amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|TCP&lt;br /&gt;
|5032+kartid&lt;br /&gt;
|&amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
|N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Control&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |UDP&lt;br /&gt;
|Kart&lt;br /&gt;
|5102&lt;br /&gt;
|Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|Switch&lt;br /&gt;
|5116+kartid&lt;br /&gt;
|Telemetry&lt;br /&gt;
|N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x20&lt;br /&gt;
|SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
|0x20&lt;br /&gt;
|0x20&lt;br /&gt;
|LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x1&lt;br /&gt;
|boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
|system_major_version&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x29&lt;br /&gt;
|Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x80&lt;br /&gt;
|Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
|0x80&lt;br /&gt;
|0x2&lt;br /&gt;
|Value length&lt;br /&gt;
|-&lt;br /&gt;
|0x82&lt;br /&gt;
|0xE&lt;br /&gt;
|Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
|0x90&lt;br /&gt;
|Varies&lt;br /&gt;
|Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x2&lt;br /&gt;
|Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x2&lt;br /&gt;
|&amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x6&lt;br /&gt;
|0x2&lt;br /&gt;
|&amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|0x8&lt;br /&gt;
|Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x80&lt;br /&gt;
|Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One of the known parameters is &amp;quot;product_code&amp;quot; which includes the kart&#039;s character as 1 byte, and includes a string with the value of the kart&#039;s serial number on the bottom of the kart (white-label barcode).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x80&lt;br /&gt;
|Fixed 0x010000; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x03; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x7&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x24; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0xC&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x01; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x11&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x14; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x20&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0100; padding&lt;br /&gt;
|-&lt;br /&gt;
|0x22&lt;br /&gt;
|0x1&lt;br /&gt;
|Character ID; 0x01 = Mario, 0x02 = Luigi, unknown if there are other &amp;quot;hidden&amp;quot; characters&lt;br /&gt;
|-&lt;br /&gt;
|0x23&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0001; padding&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|0xF&lt;br /&gt;
|Kart Serial Number;&lt;br /&gt;
&#039;&#039;&#039;X&#039;&#039;&#039;: Nintendo Switch Platform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Q&#039;&#039;&#039;: Hardware Identifier for the Mario Kart Live: Home Circuit kart.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J&#039;&#039;&#039;/&#039;&#039;&#039;W&#039;&#039;&#039;: Factory Location; Either &#039;&#039;&#039;W&#039;&#039;&#039;: US, or &#039;&#039;&#039;J&#039;&#039;&#039;: Japan&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;10&#039;&#039;&#039;/&#039;&#039;&#039;14&#039;&#039;&#039;/&#039;&#039;&#039;40&#039;&#039;&#039;/&#039;&#039;&#039;70:&#039;&#039;&#039; Factory Number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last 9 Numbers&#039;&#039;&#039;: Unit Number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0xF&lt;br /&gt;
|Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]]. It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x1&lt;br /&gt;
|Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
|Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x4?&lt;br /&gt;
|Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
|0x8?&lt;br /&gt;
|0x18?&lt;br /&gt;
|Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
The kart will send UDP packets to the Switch over a port it specifies in &amp;quot;connection_info&amp;quot; (but typically port 5116) indicating its current status. The packet type is indicated by the first byte. (The tables below ignore this first byte.)&lt;br /&gt;
&lt;br /&gt;
==== Type 0x01: Battery Status ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x3&lt;br /&gt;
|Zero padding&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|How many bars to show in the HUD for battery status (0x00-0x04)&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x1C&lt;br /&gt;
|Zero padding, to bring total packet length to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One would think this would be a good location for wireless metrics (e.g. RSSI), but this is presumably measured only on the Switch side of the link.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x02: IMU ====&lt;br /&gt;
&lt;br /&gt;
The kart contains a 6DoF IMU for measuring movement. This packet type communicates the motion status.&lt;br /&gt;
&lt;br /&gt;
All integers are little-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x2&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Total IMU samples, as an unsigned integer. This number includes the samples in this packet. It overflows.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Flags bitfield: IGA??NNN. I/G/A=High-precision units used, ?=Unknown, possibly clipping indicators. N=Number of IMU samples.&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Pad byte; zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x4&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Microsecond-precision timer, as an unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|0x10&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Orientation: s32 qi, qj, qk, qr; gives the coefficients of a quaternion. Units appear to be increments of 2^-30, but quaternions should always be normalized before use.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator A position&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Every 6ms step: pos += vel&amp;gt;&amp;gt;12; Units: (4096*0.006)² * 2^-30 m (I=1), 78.4348 * (4096*0.006)² * 2^-30 m (I=0)&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator B position&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator A velocity&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Every 6ms step: vel += acc&amp;gt;&amp;gt;12; (where &#039;acc&#039; is acceleration in 2^-30 m/s²). Units: (4096*0.006) * 2^-30 m/s (I=1), 78.4348 * (4096*0.006) * 2^-30 m/s (I=0)&lt;br /&gt;
|-&lt;br /&gt;
|0x3C&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator B velocity&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |0x48&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |0xC*(NNN+1)&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |1-8 raw IMU samples&lt;br /&gt;
|s16 accel_x, accel_y, accel_z; // Units: 9.81/4096 m/s² (A=1), 15.99*9.81/4096 m/s² (A=0) (9.81m/s² added to accel_z to compensate for gravity)&lt;br /&gt;
|-&lt;br /&gt;
|s16 ang_vel_x, ang_vel_y, ang_vel_z; // Units: 0.004375 °/s (G=1), 0.1 °/s (G=0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact rate at which these packets are sent appears to be somewhat variable. The raw IMU samples seem to be collected with a period of 6ms, and when not in drive mode, this packet always contains 8 IMU samples, for an overall period 48ms. However, when in drive mode, not all of these packets contain exactly 8 IMU samples, and the packets will arrive at an uneven rate. This is probably due to some logic in the kart that flushes the buffer early based on certain conditions.&lt;br /&gt;
&lt;br /&gt;
The IMU itself is mounted on the PCB &amp;quot;upside down&amp;quot; which gives a reference frame different from what one would expect: While +X does correspond to the driver&#039;s right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame.&lt;br /&gt;
&lt;br /&gt;
The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to 0i+0j+0k+1 once the IMU is enabled (i.e. when &amp;quot;connection_info&amp;quot; is set).&lt;br /&gt;
&lt;br /&gt;
The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time.&lt;br /&gt;
&lt;br /&gt;
Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x03: Motion feedback ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10701</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10701"/>
		<updated>2021-02-19T11:06:14Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Type 0x02: IMU */ Fix units&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Component&lt;br /&gt;
!Manufacturer&lt;br /&gt;
!Part&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|SoC&lt;br /&gt;
|Realtek&lt;br /&gt;
|RTD1195 (PB)&lt;br /&gt;
|Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
|DDR3 RAM&lt;br /&gt;
|Winbond&lt;br /&gt;
|W631GG6MB-15&lt;br /&gt;
|128 MiB&lt;br /&gt;
|-&lt;br /&gt;
|NAND Flash&lt;br /&gt;
|Winbond&lt;br /&gt;
|W29N01HVSINA&lt;br /&gt;
|128 MiB&lt;br /&gt;
|-&lt;br /&gt;
|WNIC&lt;br /&gt;
|Realtek&lt;br /&gt;
|RTL8188E&lt;br /&gt;
|Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
|MCU&lt;br /&gt;
|STMicroelectronics&lt;br /&gt;
|STM32F&lt;br /&gt;
|Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
|IMU&lt;br /&gt;
|STMicroelectronics&lt;br /&gt;
|LSM6DSL&lt;br /&gt;
|Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
|Li-ion pouch cell&lt;br /&gt;
|Nintendo branded; OEM unknown&lt;br /&gt;
|HAC-038&lt;br /&gt;
|3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
|Camera&lt;br /&gt;
|Unknown&lt;br /&gt;
|Unknown&lt;br /&gt;
|Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x10&lt;br /&gt;
|Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
|0x10&lt;br /&gt;
|0x20&lt;br /&gt;
|Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|0x2&lt;br /&gt;
|Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
|0x32&lt;br /&gt;
|0xC&lt;br /&gt;
|Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+Summary of ports&lt;br /&gt;
!Protocol&lt;br /&gt;
!Endpoint&lt;br /&gt;
!Port&lt;br /&gt;
!Description&lt;br /&gt;
![[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Management&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; |TCP&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Switch&lt;br /&gt;
|5201&lt;br /&gt;
|[[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
|0x0001&lt;br /&gt;
|-&lt;br /&gt;
|5202&lt;br /&gt;
|RCD handshake service (non-pairing only)&lt;br /&gt;
|0x0001&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Kart&lt;br /&gt;
|5103&lt;br /&gt;
|&amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
|0x0100&lt;br /&gt;
|-&lt;br /&gt;
|5106&lt;br /&gt;
|&amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
|0x0102&lt;br /&gt;
|-&lt;br /&gt;
|5107&lt;br /&gt;
|&amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
|0x0103&lt;br /&gt;
|-&lt;br /&gt;
|UDP&lt;br /&gt;
|Kart&lt;br /&gt;
|5004&lt;br /&gt;
|Time synchronization&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Video&lt;br /&gt;
|-&lt;br /&gt;
|UDP&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |Switch&lt;br /&gt;
|5016+kartid&lt;br /&gt;
|&amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|TCP&lt;br /&gt;
|5032+kartid&lt;br /&gt;
|&amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
|N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; |Control&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |UDP&lt;br /&gt;
|Kart&lt;br /&gt;
|5102&lt;br /&gt;
|Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
|N/A&lt;br /&gt;
|-&lt;br /&gt;
|Switch&lt;br /&gt;
|5116+kartid&lt;br /&gt;
|Telemetry&lt;br /&gt;
|N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x20&lt;br /&gt;
|SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
|0x20&lt;br /&gt;
|0x20&lt;br /&gt;
|LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x1&lt;br /&gt;
|boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
|system_major_version&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x29&lt;br /&gt;
|Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x80&lt;br /&gt;
|Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
|0x80&lt;br /&gt;
|0x2&lt;br /&gt;
|Value length&lt;br /&gt;
|-&lt;br /&gt;
|0x82&lt;br /&gt;
|0xE&lt;br /&gt;
|Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
|0x90&lt;br /&gt;
|Varies&lt;br /&gt;
|Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x2&lt;br /&gt;
|Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x2&lt;br /&gt;
|&amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x6&lt;br /&gt;
|0x2&lt;br /&gt;
|&amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|0x8&lt;br /&gt;
|Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x80&lt;br /&gt;
|Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One of the known parameters is &amp;quot;product_code&amp;quot; which includes the kart&#039;s character as 1 byte, and includes a string with the value of the kart&#039;s serial number on the bottom of the kart (white-label barcode).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x00&lt;br /&gt;
|0x80&lt;br /&gt;
|Fixed 0x010000; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x03; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x7&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x24; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0xC&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x01; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x11&lt;br /&gt;
|0x1&lt;br /&gt;
|Fixed 0x14; unknown purpose&lt;br /&gt;
|-&lt;br /&gt;
|0x20&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0100; padding&lt;br /&gt;
|-&lt;br /&gt;
|0x22&lt;br /&gt;
|0x1&lt;br /&gt;
|Character ID; 0x01 = Mario, 0x02 = Luigi, unknown if there are other &amp;quot;hidden&amp;quot; characters&lt;br /&gt;
|-&lt;br /&gt;
|0x23&lt;br /&gt;
|0x2&lt;br /&gt;
|Fixed 0x0001; padding&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|0xF&lt;br /&gt;
|Kart Serial Number;&lt;br /&gt;
&#039;&#039;&#039;X&#039;&#039;&#039;: Nintendo Switch Platform&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Q&#039;&#039;&#039;: Hardware Identifier for the Mario Kart Live: Home Circuit kart.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J&#039;&#039;&#039;/&#039;&#039;&#039;W&#039;&#039;&#039;: Factory Location; Either &#039;&#039;&#039;W&#039;&#039;&#039;: US, or &#039;&#039;&#039;J&#039;&#039;&#039;: Japan&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;10&#039;&#039;&#039;/&#039;&#039;&#039;14&#039;&#039;&#039;/&#039;&#039;&#039;40&#039;&#039;&#039;/&#039;&#039;&#039;70:&#039;&#039;&#039; Factory Number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Last 9 Numbers&#039;&#039;&#039;: Unit Number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0xF&lt;br /&gt;
|Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]]. It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x1&lt;br /&gt;
|Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
|0x1&lt;br /&gt;
|0x1&lt;br /&gt;
|Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
|Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x4?&lt;br /&gt;
|Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
|0x8?&lt;br /&gt;
|0x18?&lt;br /&gt;
|Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
The kart will send UDP packets to the Switch over a port it specifies in &amp;quot;connection_info&amp;quot; (but typically port 5116) indicating its current status. The packet type is indicated by the first byte. (The tables below ignore this first byte.)&lt;br /&gt;
&lt;br /&gt;
==== Type 0x01: Battery Status ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x3&lt;br /&gt;
|Zero padding&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
|How many bars to show in the HUD for battery status (0x00-0x04)&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x1C&lt;br /&gt;
|Zero padding, to bring total packet length to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One would think this would be a good location for wireless metrics (e.g. RSSI), but this is presumably measured only on the Switch side of the link.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x02: IMU ====&lt;br /&gt;
&lt;br /&gt;
The kart contains a 6DoF IMU for measuring movement. This packet type communicates the motion status.&lt;br /&gt;
&lt;br /&gt;
All integers are little-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Offset&lt;br /&gt;
!Size&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Description&lt;br /&gt;
|-&lt;br /&gt;
|0x0&lt;br /&gt;
|0x2&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Total IMU samples, as an unsigned integer. This number includes the samples in this packet. It overflows.&lt;br /&gt;
|-&lt;br /&gt;
|0x2&lt;br /&gt;
|0x1&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Flags bitfield: IGA??NNN. I/G/A=High-precision units used, ?=Unknown, possibly clipping indicators. N=Number of IMU samples.&lt;br /&gt;
|-&lt;br /&gt;
|0x3&lt;br /&gt;
|0x1&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Pad byte; zero.&lt;br /&gt;
|-&lt;br /&gt;
|0x4&lt;br /&gt;
|0x4&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Microsecond-precision timer, as an unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
|0x8&lt;br /&gt;
|0x10&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Orientation: s32 qi, qj, qk, qr; gives the coefficients of a quaternion. Units appear to be increments of 2^-30, but quaternions should always be normalized before use.&lt;br /&gt;
|-&lt;br /&gt;
|0x18&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator A position&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Every 6ms step: pos += vel&amp;gt;&amp;gt;12; Units: (4096*0.006)² * 2^-30 m (I=1), 78.4348 * (4096*0.006)² * 2^-30 m (I=0)&lt;br /&gt;
|-&lt;br /&gt;
|0x24&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator B position&lt;br /&gt;
|-&lt;br /&gt;
|0x30&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator A velocity&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Every 6ms step: vel += acc&amp;gt;&amp;gt;12; (where &#039;acc&#039; is acceleration in 2^-30 m/s²). Units: (4096*0.006) * 2^-30 m/s (I=1), 78.4348 * (4096*0.006) * 2^-30 m/s (I=0)&lt;br /&gt;
|-&lt;br /&gt;
|0x3C&lt;br /&gt;
|0xC&lt;br /&gt;
|Integrator B velocity&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |0x48&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |0xC*(NNN+1)&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; |1-8 raw IMU samples&lt;br /&gt;
|s16 accel_x, accel_y, accel_z; // Units: 9.81/4096 m/s² (A=1), 15.99*9.81/4096 m/s² (A=0) (9.81m/s² added to accel_z to compensate for gravity)&lt;br /&gt;
|-&lt;br /&gt;
|s16 ang_vel_x, ang_vel_y, ang_vel_z; // Units: 0.004375 °/s (G=1), 0.1 °/s (G=0)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact rate at which these packets are sent appears to be somewhat variable. The raw IMU samples seem to be collected with a period of 6ms, and when not in drive mode, this packet always contains 8 IMU samples, for an overall period 48ms. However, when in drive mode, not all of these packets contain exactly 8 IMU samples, and the packets will arrive at an uneven rate. This is probably due to some logic in the kart that flushes the buffer early based on certain conditions.&lt;br /&gt;
&lt;br /&gt;
The IMU itself is mounted on the PCB &amp;quot;upside down&amp;quot; which gives a reference frame different from what one would expect: While +X does correspond to the driver&#039;s right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame.&lt;br /&gt;
&lt;br /&gt;
The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to 0i+0j+0k+1 once the IMU is enabled (i.e. when &amp;quot;connection_info&amp;quot; is set).&lt;br /&gt;
&lt;br /&gt;
The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time.&lt;br /&gt;
&lt;br /&gt;
Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x03: Motion feedback ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10690</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10690"/>
		<updated>2021-02-13T04:31:03Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Type 0x02: IMU */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| IMU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| LSM6DSL&lt;br /&gt;
| Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]]. It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4?&lt;br /&gt;
| Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8?&lt;br /&gt;
| 0x18?&lt;br /&gt;
| Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
The kart will send UDP packets to the Switch over a port it specifies in &amp;quot;connection_info&amp;quot; (but typically port 5116) indicating its current status. The packet type is indicated by the first byte. (The tables below ignore this first byte.)&lt;br /&gt;
&lt;br /&gt;
==== Type 0x01: Battery Status ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x3&lt;br /&gt;
| Zero padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| How many bars to show in the HUD for battery status (0x00-0x04)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x1C&lt;br /&gt;
| Zero padding, to bring total packet length to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One would think this would be a good location for wireless metrics (e.g. RSSI), but this is presumably measured only on the Switch side of the link.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x02: IMU ====&lt;br /&gt;
&lt;br /&gt;
The kart contains a 6DoF IMU for measuring movement. This packet type communicates the motion status.&lt;br /&gt;
&lt;br /&gt;
All integers are little-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Total IMU samples, as an unsigned integer. This number includes the samples in this packet. It overflows.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Flags bitfield: PCCCCNNN. P=High-precision, C=Unknown, possibly clipping indicators. N=Number of IMU samples.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Pad byte; zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Microsecond-precision timer, as an unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x10&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Orientation: s32 qi, qj, qk, qr; gives the coefficients of a quaternion. Units appear to be increments of 2^-30, but quaternions should always be normalized before use.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator A position&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Units: 24.59 * 2^-19 m(???)&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator B position&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator A velocity&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Units: ~2^-19 m/s&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator B velocity&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| 0x48&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| 0xC*(NNN+1)&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| 1-8 raw IMU samples&lt;br /&gt;
| s16 accel_x, accel_y, accel_z; // in units of 0.000244 Gs. 1G is added to accel_z to compensate for gravity.&lt;br /&gt;
|-&lt;br /&gt;
| s16 ang_vel_x, ang_vel_y, ang_vel_z; // in units of 0.004375 degrees per second.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact rate at which these packets are sent appears to be somewhat variable. The raw IMU samples seem to be collected with a period of 6ms, and when not in drive mode, this packet always contains 8 IMU samples, for an overall period 48ms. However, when in drive mode, not all of these packets contain exactly 8 IMU samples, and the packets will arrive at an uneven rate. This is probably due to some logic in the kart that flushes the buffer early based on certain conditions.&lt;br /&gt;
&lt;br /&gt;
The IMU itself is mounted on the PCB &amp;quot;upside down&amp;quot; which gives a reference frame different from what one would expect: While +X does correspond to the driver&#039;s right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame.&lt;br /&gt;
&lt;br /&gt;
The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to 1+0i+0j+0k once the IMU is enabled (i.e. when &amp;quot;connection_info&amp;quot; is set).&lt;br /&gt;
&lt;br /&gt;
The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time.&lt;br /&gt;
&lt;br /&gt;
Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered.&lt;br /&gt;
&lt;br /&gt;
If the &#039;P&#039; bit is set, the integrator values are multiplied by 78.5(???) prior to being sent, for added precision. The kart will always set the &#039;P&#039; bit as long as all integrator values are small enough to permit it.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x03: Motion feedback ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10689</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10689"/>
		<updated>2021-02-12T22:57:35Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Network protocols */ Start documenting some telemetry protocols&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| IMU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| LSM6DSL&lt;br /&gt;
| Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]]. It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4?&lt;br /&gt;
| Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8?&lt;br /&gt;
| 0x18?&lt;br /&gt;
| Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
The kart will send UDP packets to the Switch over a port it specifies in &amp;quot;connection_info&amp;quot; (but typically port 5116) indicating its current status. The packet type is indicated by the first byte. (The tables below ignore this first byte.)&lt;br /&gt;
&lt;br /&gt;
==== Type 0x01: Battery Status ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x3&lt;br /&gt;
| Zero padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| How many bars to show in the HUD for battery status (0x00-0x04)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x1C&lt;br /&gt;
| Zero padding, to bring total packet length to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One would think this would be a good location for wireless metrics (e.g. RSSI), but this is presumably measured only on the Switch side of the link.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x02: IMU ====&lt;br /&gt;
&lt;br /&gt;
The kart contains a 6DoF IMU for measuring movement. This packet type communicates the motion status.&lt;br /&gt;
&lt;br /&gt;
All integers are little-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;| Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Total IMU samples, as an unsigned integer. This number includes the samples in this packet. It overflows.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Flags bitfield: PCCCCNNN. P=High-precision, C=Unknown, possibly clipping indicators. N=Number of IMU samples.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Pad byte; zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Microsecond-precision timer, as an unsigned integer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x10&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;| Orientation: s32 qi, qj, qk, qr; gives the coefficients of a quaternion. Units appear to be increments of 2^-30, but quaternions should always be normalized before use.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator A position&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| s32 x, y, z; gives an estimate of total displacement since this integrator was reset. Units: unknown&lt;br /&gt;
|-&lt;br /&gt;
| 0x24&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator B position&lt;br /&gt;
|-&lt;br /&gt;
| 0x30&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator A velocity&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| s32 x, y, z; gives an estimate of total change in velocity since this integrator was reset. Units: ~2^-19 m/s&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C&lt;br /&gt;
| 0xC&lt;br /&gt;
| Integrator B velocity&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| 0x48&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| 0xC*(NNN+1)&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| 1-8 raw IMU samples&lt;br /&gt;
| s16 accel_x, accel_y, accel_z; // in units of 0.000244 Gs. 1G is added to accel_z to compensate for gravity.&lt;br /&gt;
|-&lt;br /&gt;
| s16 ang_vel_x, ang_vel_y, ang_vel_z; // in units of 0.004375 degrees per second.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The exact rate at which these packets are sent appears to be somewhat variable. The raw IMU samples seem to be collected with a period of 6ms, and when not in drive mode, this packet always contains 8 IMU samples, for an overall period 48ms. However, when in drive mode, not all of these packets contain exactly 8 IMU samples, and the packets will arrive at an uneven rate. This is probably due to some logic in the kart that flushes the buffer early based on certain conditions.&lt;br /&gt;
&lt;br /&gt;
The IMU itself is mounted on the PCB &amp;quot;upside down&amp;quot; which gives a reference frame different from what one would expect: While +X does correspond to the driver&#039;s right-hand side, the +Y vector extends beyond the rear of the vehicle, and +Z extends out the bottom. All measurements are taken with respect to this reference frame.&lt;br /&gt;
&lt;br /&gt;
The orientation quaternion is reasonably stable, but should still only be trusted for relative measurements over short periods of time, as the quaternion can drift due to error (noise, clipping, quantization) in the IMU samples. The quaternion is initialized to 1+0i+0j+0k once the IMU is enabled (i.e. when &amp;quot;connection_info&amp;quot; is set).&lt;br /&gt;
&lt;br /&gt;
The integrators are useful in an environment where packet loss is expected to be reasonably high, and so not all raw IMU samples can be reliably collected. The integrators are periodically reset (every 0x2000 samples), as they will accumulate error over time.&lt;br /&gt;
&lt;br /&gt;
Both integrators are reset at the same time when the IMU is enabled, but integrator A is reset at sample 0x1000 so that the resets are staggered.&lt;br /&gt;
&lt;br /&gt;
If the &#039;P&#039; bit is set, the integrator values are multiplied by 78.5(???) prior to being sent, for added precision. The kart will always set the &#039;P&#039; bit as long as all integrator values are small enough to permit it.&lt;br /&gt;
&lt;br /&gt;
==== Type 0x03: Motion feedback ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10688</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10688"/>
		<updated>2021-02-12T21:32:26Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Teleoperation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| IMU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| LSM6DSL&lt;br /&gt;
| Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. This port is only open when the kart is in [[#Command 0x04: SetState|drive state]] It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4?&lt;br /&gt;
| Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8?&lt;br /&gt;
| 0x18?&lt;br /&gt;
| Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10687</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10687"/>
		<updated>2021-02-12T21:30:10Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Network protocols */ Teleoperation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| IMU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| LSM6DSL&lt;br /&gt;
| Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
=== Teleoperation ===&lt;br /&gt;
&lt;br /&gt;
The kart is operated over UDP port 5102. It expects packets of the form:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| Steering; a signed integer. -128 is full left, +127 is full right.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| Pad byte, apparently always zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x4?&lt;br /&gt;
| Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8?&lt;br /&gt;
| 0x18?&lt;br /&gt;
| Zero padding to bring the total packet size to 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Home Circuit&#039;&#039; sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.&lt;br /&gt;
&lt;br /&gt;
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; The throttle/steering values take effect immediately. &#039;&#039;Home Circuit&#039;&#039; applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTICE:&#039;&#039;&#039; &#039;&#039;Home Circuit&#039;&#039; contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10680</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10680"/>
		<updated>2021-02-12T03:05:49Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Hardware */ I think I identified the IMU&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| IMU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| LSM6DSL&lt;br /&gt;
| Unconfirmed. Mounted &amp;quot;upside-down&amp;quot; on the PCB: +X=right +Y=back +Z=down. Sensitivities: 4.375 m°/s, 0.244 mg.&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10678</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10678"/>
		<updated>2021-02-11T03:41:32Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Command 0x09: Shutdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x09: Shutdown ====&lt;br /&gt;
&lt;br /&gt;
Takes no input and gives no output.&lt;br /&gt;
&lt;br /&gt;
Disables the &amp;quot;network reset&amp;quot; behavior so that the kart will power off when the RCD channel(s) are closed.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10677</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10677"/>
		<updated>2021-02-11T03:22:21Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Command 0x11: StartFluorescentLightDetection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x11: StartFluorescentLightDetection ====&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10676</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10676"/>
		<updated>2021-02-11T00:04:49Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Kart */ A kart hardware section seems prudent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Manufacturer&lt;br /&gt;
! Part&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| SoC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTD1195 (PB)&lt;br /&gt;
| Contains hardware H.264 encoder&lt;br /&gt;
|-&lt;br /&gt;
| DDR3 RAM&lt;br /&gt;
| Winbond&lt;br /&gt;
| W631GG6MB-15&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| NAND Flash&lt;br /&gt;
| Winbond&lt;br /&gt;
| W29N01HVSINA&lt;br /&gt;
| 128 MiB&lt;br /&gt;
|-&lt;br /&gt;
| WNIC&lt;br /&gt;
| Realtek&lt;br /&gt;
| RTL8188E&lt;br /&gt;
| Connected to SoC via USB&lt;br /&gt;
|-&lt;br /&gt;
| MCU&lt;br /&gt;
| STMicroelectronics&lt;br /&gt;
| STM32F&lt;br /&gt;
| Responsible for real-time steering and throttle control loops, six-axis IMU acquisition, GPIO, battery status&lt;br /&gt;
|-&lt;br /&gt;
| Li-ion pouch cell&lt;br /&gt;
| Nintendo branded; OEM unknown&lt;br /&gt;
| HAC-038&lt;br /&gt;
| 3.7V nominal; 1750 mAh capacity&lt;br /&gt;
|-&lt;br /&gt;
| Camera&lt;br /&gt;
| Unknown&lt;br /&gt;
| Unknown&lt;br /&gt;
| Possibly connected via MIPI CSI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10675</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10675"/>
		<updated>2021-02-10T23:45:21Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Network protocols */ Document out some of the Fuji RCD services&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
=== Handshaking ===&lt;br /&gt;
&lt;br /&gt;
After the kart connects to the LP2P network and requests an IP address via DHCP, it connects to the RCD handshake service. The port it uses is determined by whether it is in pairing mode (i.e. it learned the network details from a QR code) or not. When pairing, it connects to port 5201, otherwise it uses port 5202. The RCD handshake is the same in either case.&lt;br /&gt;
&lt;br /&gt;
Upon a successful RCD handshake, the handshake channel is left open. The kart will then open ports 5103 and 5107 (or, when pairing, only port 5106) and expect a single connection on each: The listening socket is closed once connection(s) are established to prevent multiple connections, and if connection(s) aren&#039;t made within 5 seconds of a completed handshake, the kart will reset its network connection (it closes all TCP connections, releases its IP back to DHCP, disassociates the wireless link, and starts the connection process anew). It will also reset the network connection in this manner if any RCD connection is lost/closed.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Pairing&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
The pairing service implements a single command, and is only available immediately after a handshake and when pairing. A network reset will occur if the connection is idle for 1 second.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: SetGroupInfo ====&lt;br /&gt;
&lt;br /&gt;
Accepts a 0x40-byte payload:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x20&lt;br /&gt;
| SSID, zero-terminated. &#039;&#039;Home Circuit&#039;&#039; copies this straight from GroupInfo, so uninitialized bytes may follow.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20&lt;br /&gt;
| 0x20&lt;br /&gt;
| LP2P PSK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, responds with an empty payload. The kart commits these network settings to non-volatile memory immediately, replacing the old settings (if present). A network reset is initiated, and the kart exits pairing mode, using these newly-provided network settings after the reset. The Switch also exits pairing mode to accept the newly-paired kart.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Fuji Control&amp;quot; RCD service ===&lt;br /&gt;
&lt;br /&gt;
This service is used to set up and manage the kart. It is only available when not in pairing mode.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x01: GetSystemInfo ====&lt;br /&gt;
&lt;br /&gt;
Takes no payload as input, returns:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0x1&lt;br /&gt;
| boot_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_major_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x3&lt;br /&gt;
| 0x1&lt;br /&gt;
| system_minor_version&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x29&lt;br /&gt;
| Zero-terminated ASCII string which is a 160-bit value in hexadecimal. Appears to be some kind of SHA1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x02: SetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns no output (on success) or error code 0x1060e8 if the parameter isn&#039;t recognized. Input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x80&lt;br /&gt;
| 0x2&lt;br /&gt;
| Value length&lt;br /&gt;
|-&lt;br /&gt;
| 0x82&lt;br /&gt;
| 0xE&lt;br /&gt;
| Zero padding to align to 0x10-byte boundary&lt;br /&gt;
|-&lt;br /&gt;
| 0x90&lt;br /&gt;
| Varies&lt;br /&gt;
| Value to set&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;connection_info&amp;quot; is required to prepare the kart to drive. It can only be set once (trying to set it again gives error 0x1040e8). It expects (all values little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x2&lt;br /&gt;
| Fixed 0x0001; unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2&lt;br /&gt;
| 0x2&lt;br /&gt;
| Telemetry (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control (TCP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x6&lt;br /&gt;
| 0x2&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video (UDP) port on Switch&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 0x8&lt;br /&gt;
| Current network time, per nn::time::StandardNetworkSystemClock::GetCurrentTime. (A Unix timestamp with one-second precision.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x03: GetParam ====&lt;br /&gt;
&lt;br /&gt;
Returns the value of the parameter (on success) or error code 0x1060e8. Expected input:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00&lt;br /&gt;
| 0x80&lt;br /&gt;
| Parameter name, zero-padded.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
One known parameter is &amp;quot;product_code&amp;quot; which appears to include a string with the value of the white-label barcode on the bottom of the kart. Perhaps this is how &#039;&#039;Home Circuit&#039;&#039; distinguishes between Mario and Luigi.&lt;br /&gt;
&lt;br /&gt;
==== Command 0x04: SetState ====&lt;br /&gt;
&lt;br /&gt;
This sets the kart between drive mode and &amp;quot;parked&amp;quot; mode. &amp;quot;connection_info&amp;quot; must be set first; it will return error 0x1040e8 if not. Returns an empty payload on success. It expects:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 0x1&lt;br /&gt;
| Drive mode. 0x01 enables driving controls (and video), 0x00 puts the kart to &amp;quot;sleep.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1&lt;br /&gt;
| 0xF&lt;br /&gt;
| Zero padding.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Command 0x12: ReadApplicationData ====&lt;br /&gt;
&lt;br /&gt;
Expects 0x20-byte zero-padded application ID (&#039;&#039;Home Circuit&#039;&#039; uses &amp;quot;YVCOQ00000000XFB&amp;quot;) and retrieves data stored in the kart unique to the application.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10670</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10670"/>
		<updated>2021-02-09T21:33:45Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Network protocols */ Add a summary of the ports&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Summary of ports&lt;br /&gt;
|-&lt;br /&gt;
! Protocol&lt;br /&gt;
! Endpoint&lt;br /&gt;
! Port&lt;br /&gt;
! Description&lt;br /&gt;
! [[RCD]] service ID&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Management&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;5&amp;quot;| TCP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5201&lt;br /&gt;
| [[RCD#Handshake protocol|RCD handshake]] service (pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
| 5202&lt;br /&gt;
| RCD handshake service (non-pairing only)&lt;br /&gt;
| 0x0001&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;| Kart&lt;br /&gt;
| 5103&lt;br /&gt;
| &amp;quot;Fuji Control&amp;quot; RCD service&lt;br /&gt;
| 0x0100&lt;br /&gt;
|-&lt;br /&gt;
| 5106&lt;br /&gt;
| &amp;quot;Fuji Pairing&amp;quot; RCD service (pairing only)&lt;br /&gt;
| 0x0102&lt;br /&gt;
|-&lt;br /&gt;
| 5107&lt;br /&gt;
| &amp;quot;Fuji Update&amp;quot; RCD service&lt;br /&gt;
| 0x0103&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5004&lt;br /&gt;
| Time synchronization&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Video&lt;br /&gt;
|-&lt;br /&gt;
| UDP&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| Switch&lt;br /&gt;
| 5016+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; video streaming&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| TCP&lt;br /&gt;
| 5032+kartid&lt;br /&gt;
| &amp;quot;LSP&amp;quot; control channel&lt;br /&gt;
| N/A (non-RCD)&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;5&amp;quot;| Control&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;| UDP&lt;br /&gt;
| Kart&lt;br /&gt;
| 5102&lt;br /&gt;
| Teleoperation (throttle, steering, tail light control)&lt;br /&gt;
| N/A&lt;br /&gt;
|-&lt;br /&gt;
| Switch&lt;br /&gt;
| 5116+kartid&lt;br /&gt;
| Telemetry&lt;br /&gt;
| N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: The ports determined by the kart ID are actually assigned by the Switch and configured via the &amp;quot;Fuji Control&amp;quot; service. The kart itself will actually use any port it is told to use; shown above are how &#039;&#039;Home Circuit&#039;&#039; calculates the port numbers.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=RCD&amp;diff=10668</id>
		<title>RCD</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=RCD&amp;diff=10668"/>
		<updated>2021-02-06T23:36:26Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: Created page with &amp;quot;RCD is a framework that manages &amp;#039;&amp;#039;&amp;#039;r&amp;#039;&amp;#039;&amp;#039;emote &amp;#039;&amp;#039;&amp;#039;c&amp;#039;&amp;#039;&amp;#039;ontrolled &amp;#039;&amp;#039;&amp;#039;d&amp;#039;&amp;#039;&amp;#039;evices - RC toys that connect to the Nintendo Switch via 802.11 (&amp;quot;WiFi&amp;quot;) link. The first (and currently on...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;RCD is a framework that manages &#039;&#039;&#039;r&#039;&#039;&#039;emote &#039;&#039;&#039;c&#039;&#039;&#039;ontrolled &#039;&#039;&#039;d&#039;&#039;&#039;evices - RC toys that connect to the Nintendo Switch via 802.11 (&amp;quot;WiFi&amp;quot;) link. The first (and currently only) released product to use this framework is [[Mario Kart Live: Home Circuit]].&lt;br /&gt;
&lt;br /&gt;
RCD devices must be paired to the host Switch system in some way (e.g. QR code) and contain the connection settings in non-volatile memory so that they can reconnect on next use without needing to repeat the pairing process.&lt;br /&gt;
&lt;br /&gt;
The RCD framework implements a very simple TCP-based RPC protocol that allows an RCD client to invoke methods on an RCD server. Note that multiple such connections may be established between the Switch and device.&lt;br /&gt;
&lt;br /&gt;
= RCD RPC =&lt;br /&gt;
&lt;br /&gt;
A client connects to a TCP server and sends as many commands as it likes, one at a time (and reading the response after each), before tearing down the TCP connection. It is not valid for a client to send a response to a server or for a server to send a request to a client.&lt;br /&gt;
&lt;br /&gt;
Commands have a 0x10-byte header, followed by a payload of any size up to some maximum (typically 0x1000). All numbers are represented in big-endian format.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Service being accessed&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Command being invoked on that service&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x4 || Payload length (PLEN)&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x4 || Status code; ignored (and set to 0) for requests, an [[Error codes|error code]] for responses&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x1 || Flags; currently only the 1s bit is significant: it indicates a response&lt;br /&gt;
|-&lt;br /&gt;
| 0xD || 0x3 || Padding; zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || PLEN || The parameters to the command, or the response&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In theory, multiple &amp;quot;services&amp;quot; could be multiplexed over a single TCP connection, but in practice only a single service is allowed per TCP port.&lt;br /&gt;
&lt;br /&gt;
== Handshake protocol ==&lt;br /&gt;
&lt;br /&gt;
Service ID: 0x0001&lt;br /&gt;
Commands: 4&lt;br /&gt;
&lt;br /&gt;
When a device first establishes a wireless connection, it connects to the Switch on a well-known port to access the &amp;quot;handshake&amp;quot; service and make its presence known. A successful handshake causes application-specific RCD connections to be established. Commands must be sent in order (and no more than once).&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10667</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10667"/>
		<updated>2021-02-06T23:21:20Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: Create page link to RCD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via an access point that the game sets up using [[LDN_services|lp2p:app]], making it the first title on retail to use lp2p. The underlying device management uses [[RCD]]. The RCD implementation is in the main-codebin itself, without symbols - however there are strings for this.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10666</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10666"/>
		<updated>2021-02-06T23:19:24Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Kart */ Codename is most likely &amp;quot;Fuji&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via [[LDN_services|lp2p:app]]. The service implementation is in the main-codebin itself, without symbols - however there are strings for this. This is the first title on retail which uses lp2p.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is likely codenamed &amp;quot;Fuji&amp;quot; as this is both what the game calls it internally, and how it identifies itself during RCD handshake. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10661</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10661"/>
		<updated>2021-02-05T18:56:37Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: PlatformIdFuji -&amp;gt; PlatformIdRcd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes an input u32, an u64 pid_reserved, a PID, returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes an input u64 pid_reserved, a PID, returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#RemoveAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]], a type-0x22 output buffer containing an array of [[#ScanResult]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 frequency, a s16 channel, an u32 flags, a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 flags, a type-0x22 output buffer, returns a [[#MacAddress_2|MacAddress]], an u16, a s16, an u32 out_size, a s32.&lt;br /&gt;
&lt;br /&gt;
The out_size is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]], no output.&lt;br /&gt;
&lt;br /&gt;
=== RemoveAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== Join ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input, returns an output 0x80-bytes [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== Leave ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID, a total of 0x10-bytes of input, and returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Wrapped master key. When zero, set to randomly-generated data. This is decrypted with a &amp;quot;static AES key&amp;quot; and used to derive the 4 encryption keys for the session.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation to derive keys B and D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdRcd.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used to derive encryption keys A and C. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
Key A derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two vendor-specific Nintendo information elements with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each IE has a 2-byte ID following the OUI. These Nintendo IEs are not used when standard WPA2-PSK is being used.&lt;br /&gt;
&lt;br /&gt;
The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: Traffic Indication Map (TIM)&amp;quot;: &amp;quot;DTIM count&amp;quot; for lp2p is 1, with ldn it&#039;s 0.&lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo IEs in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 0 ====&lt;br /&gt;
&lt;br /&gt;
The first Nintendo IE (ID 0x0600) contains the following fixed parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Fixed 0x20; perhaps a version or other magic number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || [[#GroupInfo|SecurityType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || [[#GroupInfo|StaticAesKeyIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Fixed zero; padding byte.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian (i.e. byte-reversed) version of [[#GroupInfo|LocalCommunicationId]]. This is the only context where LocalCommunicationId is reversed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Wrapped master key. Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 0x4 || If encryption is enabled, a randomly-generated nonce, else nothing. Appending 8 zero bytes to this yields the AES-GCM IV.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || If encryption is enabled, the AES-GCM MAC tag, else nothing. All bytes prior to this (fixed 0x20 through nonce) are the additional authenticated data. All bytes after this are encrypted with key B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After this, TLV tagged parameters occur. Each TLV tag is formatted as:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Tag type&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Length&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Data for the tag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Additional network parameters: 0xAB 0xCD. A=[[#GroupInfo]]+0x82, B=[[#GroupInfo|MemberCountMax]], C=[[#GroupInfo|NetworkMode]], D=[[#GroupInfo|PerformanceRequirement]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8 || Flags: Bitwise-or of (1&amp;lt;&amp;lt;f) for each entry in [[#GroupInfo]]+0x40&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 1 ====&lt;br /&gt;
&lt;br /&gt;
The second Nintendo IE (ID 0x0601) contains only TLVs. If encryption is enabled, a 0x4-byte nonce and 0x10-byte AES-GCM tag are written first, as above, and the TLVs are encrypted. Key C is used.&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Varies || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Talk:LDN_services&amp;diff=10660</id>
		<title>Talk:LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Talk:LDN_services&amp;diff=10660"/>
		<updated>2021-02-05T18:55:44Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* PlatformIdFuji -&amp;gt; PlatformIdRcd? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PlatformIdFuji -&amp;gt; PlatformIdRcd? ==&lt;br /&gt;
&lt;br /&gt;
I noticed that [[User:Hexkyz|Hexkyz]] made [https://switchbrew.org/w/index.php?title=LDN_services&amp;amp;diff=10087&amp;amp;oldid=10083 this edit] which dubs SupportedPlatform=1 as &amp;quot;PlatformIdFuji.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Does this come from a string in a system binary somewhere, or is it merely what we&#039;re calling it? If the latter, I think &amp;quot;PlatformIdRcd&amp;quot; fits better. The rationale being that Fuji appears to be the codename of the mklive kart/firmware, while &amp;quot;rcd&amp;quot; seems to be the part of the Switch SDK - albeit not (yet) part of sdknso - which handles communication with &#039;&#039;&#039;r&#039;&#039;&#039;emote &#039;&#039;&#039;c&#039;&#039;&#039;ontrolled &#039;&#039;&#039;d&#039;&#039;&#039;evices which are paired via LP2P link. And I would bet that there&#039;s an rcd device-side component as well. If this is a general-purpose framework (which &amp;quot;Fuji&amp;quot; is merely the first released product to leverage) then it would make sense for that to be what gets special treatment by the LDN sysmodule.&lt;br /&gt;
&lt;br /&gt;
Thoughts? [[User:CFSworks|CFSworks]] ([[User talk:CFSworks|talk]]) 20:28, 4 February 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: That&#039;s a very good point. The string &amp;quot;PlatformIdFuji&amp;quot; is official, it was found in a leftover dev title (can&#039;t remember which one but I believe it was a version of DevMenuCommand) around the time service &amp;quot;ndd&amp;quot; was added (and later removed) to &amp;quot;ldn&amp;quot; by mistake. However, this was way before mklive was released. I only came to learn about the &amp;quot;rcd&amp;quot; namespace from mklive strings and my best guess is that &amp;quot;rcd&amp;quot; is indeed an umbrella namespace for the framework itself. &amp;quot;Fuji&amp;quot; was most likely a pre-release codename and might have been deprecated since, but no new strings/symbols have surfaced again so it&#039;s difficult to tell for sure.&lt;br /&gt;
&lt;br /&gt;
: [[User:Hexkyz|Hexkyz]] ([[User talk:Hexkyz|talk]]) 15:48, 5 February 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: For what it&#039;s worth, the kart is still called &amp;quot;Fuji.&amp;quot; The &amp;quot;rcd&amp;quot; toolkit that appears in mklive implements a whole RPC protocol; the typename strings suggest it&#039;s fairly templated, and some of the templates implementing remote services are called &amp;quot;FujiControlClient,&amp;quot; &amp;quot;FujiUpdateClient,&amp;quot; &amp;quot;FujiPairingClient,&amp;quot; and so on. There&#039;s also a &amp;quot;handshake&amp;quot; protocol which lacks any references to &amp;quot;Fuji,&amp;quot; which suggests the Fuji*Client are specific to the kart, while the &amp;quot;handshake&amp;quot; is more generic. And to top it off, the kart calls itself &amp;quot;Fuji&amp;quot; (in an ASCII string, no less!) while handshaking.&lt;br /&gt;
&lt;br /&gt;
:: From what you&#039;ve said, it feels to me like Nintendo were originally intending the kart to be a one-off gimmick (hence the rcd tech wasn&#039;t considered separate from the &amp;quot;Fuji&amp;quot; project yet), but then decided they liked the idea of making RC toys that interoperate with the Switch, so they decided to spin off &amp;quot;rcd&amp;quot; as its own thing. I&#039;m going to go ahead and make that edit; feel free to revert if you disagree.&lt;br /&gt;
&lt;br /&gt;
:: [[User:CFSworks|CFSworks]] ([[User talk:CFSworks|talk]]) 20:55, 5 February 2021 (CET)&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Talk:LDN_services&amp;diff=10658</id>
		<title>Talk:LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Talk:LDN_services&amp;diff=10658"/>
		<updated>2021-02-04T19:28:46Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* PlatformIdFuji -&amp;gt; PlatformIdRcd? */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PlatformIdFuji -&amp;gt; PlatformIdRcd? ==&lt;br /&gt;
&lt;br /&gt;
I noticed that [[User:Hexkyz|Hexkyz]] made [https://switchbrew.org/w/index.php?title=LDN_services&amp;amp;diff=10087&amp;amp;oldid=10083 this edit] which dubs SupportedPlatform=1 as &amp;quot;PlatformIdFuji.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Does this come from a string in a system binary somewhere, or is it merely what we&#039;re calling it? If the latter, I think &amp;quot;PlatformIdRcd&amp;quot; fits better. The rationale being that Fuji appears to be the codename of the mklive kart/firmware, while &amp;quot;rcd&amp;quot; seems to be the part of the Switch SDK - albeit not (yet) part of sdknso - which handles communication with &#039;&#039;&#039;r&#039;&#039;&#039;emote &#039;&#039;&#039;c&#039;&#039;&#039;ontrolled &#039;&#039;&#039;d&#039;&#039;&#039;evices which are paired via LP2P link. And I would bet that there&#039;s an rcd device-side component as well. If this is a general-purpose framework (which &amp;quot;Fuji&amp;quot; is merely the first released product to leverage) then it would make sense for that to be what gets special treatment by the LDN sysmodule.&lt;br /&gt;
&lt;br /&gt;
Thoughts? [[User:CFSworks|CFSworks]] ([[User talk:CFSworks|talk]]) 20:28, 4 February 2021 (UTC)&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=10650</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=10650"/>
		<updated>2021-02-02T23:35:26Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Modules */ I think module 232 is Rcd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
These have been redesigned from the 3DS so that they fit within a Aarch64 MOV instruction immediate most of the time (without requiring the additional MOVK).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Result Errors =&lt;br /&gt;
General errors used by system modules and applications.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Fs&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Htcs&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Ncm&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Dd&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Dmnt&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Lr&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Cmif&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Hipc&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Pm&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Ns&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Bsdsockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Htc&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Tsc&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Ncm (content)&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Sm&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Ro (userland)&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Gc&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Sdmmc&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Ovln&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Spl&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Socket&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Htclow&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Ddsf&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Htcfs&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Async&lt;br /&gt;
|-&lt;br /&gt;
| 100 || Ethc&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2c&lt;br /&gt;
|-&lt;br /&gt;
| 102 || Gpio&lt;br /&gt;
|-&lt;br /&gt;
| 103 || Uart&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || Wlan&lt;br /&gt;
|-&lt;br /&gt;
| 108 || Xcd&lt;br /&gt;
|-&lt;br /&gt;
| 110 || Nifm&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 112 || Sasbus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || Vi&lt;br /&gt;
|-&lt;br /&gt;
| 115 || Nfp&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || Fgm&lt;br /&gt;
|-&lt;br /&gt;
| 118 || Oe&lt;br /&gt;
|-&lt;br /&gt;
| 120 || Pcie&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || Bcat&lt;br /&gt;
|-&lt;br /&gt;
| 123 || Ssl&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || Nfc&lt;br /&gt;
|-&lt;br /&gt;
| 128 || Am&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Prepo&lt;br /&gt;
|-&lt;br /&gt;
| 130 || Ahid&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Qlaunch&lt;br /&gt;
|-&lt;br /&gt;
| 133 || Pcv&lt;br /&gt;
|-&lt;br /&gt;
| 134 || Omm&lt;br /&gt;
|-&lt;br /&gt;
| 135 || Bpc&lt;br /&gt;
|-&lt;br /&gt;
| 136 || Psm&lt;br /&gt;
|-&lt;br /&gt;
| 137 || Nim&lt;br /&gt;
|-&lt;br /&gt;
| 138 || Psc&lt;br /&gt;
|-&lt;br /&gt;
| 139 || Tc&lt;br /&gt;
|-&lt;br /&gt;
| 140 || Usb&lt;br /&gt;
|-&lt;br /&gt;
| 141 || Nsd&lt;br /&gt;
|-&lt;br /&gt;
| 142 || Pctl&lt;br /&gt;
|-&lt;br /&gt;
| 143 || Btm&lt;br /&gt;
|-&lt;br /&gt;
| 144 || La&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || Ngc&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Erpt&lt;br /&gt;
|-&lt;br /&gt;
| 148 || Apm&lt;br /&gt;
|-&lt;br /&gt;
| 149 || Cec&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Eupld&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || Npns&lt;br /&gt;
|-&lt;br /&gt;
| 155 || Npns XMPP stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || Arp&lt;br /&gt;
|-&lt;br /&gt;
| 158 || Updater&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Swkbd&lt;br /&gt;
|-&lt;br /&gt;
| 161 || Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland (assert)&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || Ec (shop)&lt;br /&gt;
|-&lt;br /&gt;
| 165 || Spsm&lt;br /&gt;
|-&lt;br /&gt;
| 167 || Bgtc&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland (crash)&lt;br /&gt;
|-&lt;br /&gt;
| 169 || Sasbus periodic receive mode&lt;br /&gt;
|-&lt;br /&gt;
| 175 || Jit&lt;br /&gt;
|-&lt;br /&gt;
| 177 || Hdcp&lt;br /&gt;
|-&lt;br /&gt;
| 178 || Pdm&lt;br /&gt;
|-&lt;br /&gt;
| 179 || Olsc&lt;br /&gt;
|-&lt;br /&gt;
| 180 || Srepo&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 187 || Sasbus&lt;br /&gt;
|-&lt;br /&gt;
| 189 || Pwm&lt;br /&gt;
|-&lt;br /&gt;
| 191 || Rtc&lt;br /&gt;
|-&lt;br /&gt;
| 192 || Regulator&lt;br /&gt;
|-&lt;br /&gt;
| 193 || Led&lt;br /&gt;
|-&lt;br /&gt;
| 197 || Clkrst&lt;br /&gt;
|-&lt;br /&gt;
| 198 || Powctl&lt;br /&gt;
|-&lt;br /&gt;
| 202 || Hid&lt;br /&gt;
|-&lt;br /&gt;
| 203 || Ldn&lt;br /&gt;
|-&lt;br /&gt;
| 204 || Cs&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || Atk&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 || Lcs&lt;br /&gt;
|-&lt;br /&gt;
| 212 || Grc&lt;br /&gt;
|-&lt;br /&gt;
| 214 || Album&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration idc server&lt;br /&gt;
|-&lt;br /&gt;
| 218 || Hidbus&lt;br /&gt;
|-&lt;br /&gt;
| 223 || Websocket&lt;br /&gt;
|-&lt;br /&gt;
| 227 || Capmtp&lt;br /&gt;
|-&lt;br /&gt;
| 228 || Pgl&lt;br /&gt;
|-&lt;br /&gt;
| 229 || Notification&lt;br /&gt;
|-&lt;br /&gt;
| 230 || Ins&lt;br /&gt;
|-&lt;br /&gt;
| 231 || Lp2p&lt;br /&gt;
|-&lt;br /&gt;
| 232 || Rcd?&lt;br /&gt;
|-&lt;br /&gt;
| 244 || Dp2hdmi&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Error codes ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E01 || 1 || 7 || Session count exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || Not Implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0x7601 || 1 || 59 || Thread terminated/termination requested&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Resource exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Invalid pointer/Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Operation canceled&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt/exception&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Invalid state&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x40A01 || 1 || 517 || Invalid process ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40C01 || 1 || 518 || Invalid thread ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40E01 || 1 || 519 || Invalid thread ID (used in svcGetDebugThreadParam).&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0x202 || 2 || 1 || Path does not exist.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402 || 2 || 2 || Path already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Resource already in use (file already opened, savedata filesystem already mounted).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4602 || 2 || 35 || Not enough free space for BIS Calibration partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4802 || 2 || 36 || Not enough free space for BIS Safe partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A02 || 2 || 37 || Not enough free space for BIS User partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C02 || 2 || 38 || Not enough free space for BIS System partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E02 || 2 || 39 || Not enough free space on SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6402 || 2 || 50 || NCA is older than version 3, or NCA SDK version is older than 0.11.0.0&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B402 || 2 || 2522 || Attempted process an AsicHandler command in initial mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13D802 || 2 || 2540 || Attempted to read from the secure gamecard partition in normal mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Attempted to read from the normal gamecard partition in secure mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DC02 || 2 || 2542 || Attempted a read that spanned both the normal and secure gamecard partitions&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E002 || 2 || 2544 || Gamecard initial data hash doesn&#039;t match the initial data hash in the card header&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E202 || 2 || 2545 || Gamecard initial data reserved area is not all zeros&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E402 || 2 || 2546 || Gamecard certificate kek index doesn&#039;t match card header kek index&lt;br /&gt;
|-&lt;br /&gt;
| 0x13EE02 || 2 || 2551 || Unable to read card header on gamecard init&lt;br /&gt;
|-&lt;br /&gt;
| 0x140A02 || 2 || 2565 || Encountered SDMMC error in write operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x145002 || 2 || 2600 || Attempted to switch lotus state machine to secure mode from a mode other than normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x145202 || 2 || 2601 || Attempted to switch lotus state machine to normal mode from a mode other than initial&lt;br /&gt;
|-&lt;br /&gt;
| 0x145402 || 2 || 2602 || Attempted to switch lotus state machine to write mode from a mode other than normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x149402 || 2 || 2634 || Error processing lotus command SetUserAsicFirmware&lt;br /&gt;
|-&lt;br /&gt;
| 0x149A02 || 2 || 2637 || Error processing lotus command GetAsicCert&lt;br /&gt;
|-&lt;br /&gt;
| 0x14A002 || 2 || 2640 || Error processing lotus command SetEmmcEmbeddedSocCertificate&lt;br /&gt;
|-&lt;br /&gt;
| 0x14AA02 || 2 || 2645 || Error processing lotus command GetAsicEncryptedMessage&lt;br /&gt;
|-&lt;br /&gt;
| 0x14AC02 || 2 || 2646 || Error processing lotus command SetLibraryEncryptedMessage&lt;br /&gt;
|-&lt;br /&gt;
| 0x14B602 || 2 || 2651 || Error processing lotus command GetAsicAuthenticationData&lt;br /&gt;
|-&lt;br /&gt;
| 0x14B802 || 2 || 2652 || Error processing lotus command SetAsicAuthenticationDataHash&lt;br /&gt;
|-&lt;br /&gt;
| 0x14BA02 || 2 || 2653 || Error processing lotus command SetLibraryAuthenticationData&lt;br /&gt;
|-&lt;br /&gt;
| 0x14BC02 || 2 || 2654 || Error processing lotus command GetLibraryAuthenticationDataHash&lt;br /&gt;
|-&lt;br /&gt;
| 0x14C202 || 2 || 2657 || Error processing lotus command ExchangeRandomValuesInSecureMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x14D802 || 2 || 2668 || Error calling nn::gc::detail::GcCrypto::GenerateRandomBytes&lt;br /&gt;
|-&lt;br /&gt;
| 0x14DE02 || 2 || 2671 || Error processing lotus command ReadAsicRegister&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E002 || 2 || 2672 || Error processing lotus command GetGameCardIdSet&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E402 || 2 || 2674 || Error processing lotus command GetCardHeader&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E802 || 2 || 2676 || Error processing lotus command GetCardKeyArea&lt;br /&gt;
|-&lt;br /&gt;
| 0x14EA02 || 2 || 2677 || Error processing lotus command ChangeDebugMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x14EC02 || 2 || 2678 || Error processing lotus command GetRmaInformation&lt;br /&gt;
|-&lt;br /&gt;
| 0x150802 || 2 || 2692 || Tried sending lotus card command Refresh when not in secure mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x150A02 || 2 || 2693 || Tried sending lotus card command when not in correct mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x155602 || 2 || 2731 || Error processing lotus card command ReadId1&lt;br /&gt;
|-&lt;br /&gt;
| 0x155802 || 2 || 2732 || Error processing lotus card command ReadId2&lt;br /&gt;
|-&lt;br /&gt;
| 0x155A02 || 2 || 2733 || Error processing lotus card command ReadId3&lt;br /&gt;
|-&lt;br /&gt;
| 0x155E02 || 2 || 2735 || Error processing lotus card command ReadPage&lt;br /&gt;
|-&lt;br /&gt;
| 0x156202 || 2 || 2737 || Error processing lotus card command WritePage&lt;br /&gt;
|-&lt;br /&gt;
| 0x156402 || 2 || 2738 || Error processing lotus card command Refresh&lt;br /&gt;
|-&lt;br /&gt;
| 0x156C02 || 2 || 2742 || Error processing lotus card command ReadCrc&lt;br /&gt;
|-&lt;br /&gt;
| 0x156E02 || 2 || 2743 || Error processing lotus card command Erase or UnlockForceErase&lt;br /&gt;
|-&lt;br /&gt;
| 0x157002 || 2 || 2744 || Error processing lotus card command ReadDevParam&lt;br /&gt;
|-&lt;br /&gt;
| 0x157202 || 2 || 2745 || Error processing lotus card command WriteDevParam&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B002 || 2 || 2904 || Id2Normal did not match the value in the buffer returned by ChangeDebugMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B202 || 2 || 2905 || Id1Normal did not match Id1Writer when switching gamecard to write mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B402 || 2 || 2906 || Id2Normal did not match Id2Writer when switching gamecard to write mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x172002 || 2 || 2960 || Invalid gamecard handle when opening normal gamecard partition&lt;br /&gt;
|-&lt;br /&gt;
| 0x172202 || 2 || 2961 || Invalid gamecard handle when opening secure gamecard partition&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 2 || 3001 || Unimplemented behavior&lt;br /&gt;
|-&lt;br /&gt;
| 0x177602 || 2 || 3003 || File/Directory already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x190202 || 2 || 3201 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190602 || 2 || 3203 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190802 || 2 || 3204 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190A02 || 2 || 3205 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190C02 || 2 || 3206 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x191002 || 2 || 3208 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x195802 || 2 || 3244 || Allocation failure related to SD cards&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A3E02 || 2 || 3359 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4002 || 2 || 3360 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x21BC02 || 2 || 4318 || Invalid save data filesystem magic (valid magic is SAVE in ASCII)&lt;br /&gt;
|-&lt;br /&gt;
| 0x234202 || 2 || 4513 || Error reading ACID section in NPDM&lt;br /&gt;
|-&lt;br /&gt;
| 0x234402 || 2 || 4514 || Invalid NPDM ACID section size&lt;br /&gt;
|-&lt;br /&gt;
| 0x234602 || 2 || 4515 || Last byte of the ACID modulus is zero&lt;br /&gt;
|-&lt;br /&gt;
| 0x234802 || 2 || 4516 || Invalid ACID fixed key signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x234A02 || 2 || 4517 || Invalid NCA magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x234C02 || 2 || 4518 || Invalid NCA header fixed key signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x234E02 || 2 || 4519 || Invalid NCA header ACID signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x235002 || 2 || 4520 || Invalid NCA header section hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235602 || 2 || 4523 || Invalid encryption type&lt;br /&gt;
|-&lt;br /&gt;
| 0x235802 || 2 || 4524 || Redirection BKTR table size is negative&lt;br /&gt;
|-&lt;br /&gt;
| 0x235A02 || 2 || 4525 || Encryption BKTR table size is negative&lt;br /&gt;
|-&lt;br /&gt;
| 0x235C02 || 2 || 4526 || Redirection BKTR table end offset is past the Encryption BKTR table start offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x236002 || 2 || 4528 || NCA header value is out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0x236202 || 2 || 4529 || NCA FS header value is out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0x236802 || 2 || 4532 || PartitionFS hash block size is not a power of 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x236A02 || 2 || 4533 || PartitionFS hash &amp;quot;always_2&amp;quot; field is not 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x236C02 || 2 || 4534 || PartitionFS hash table is too small for main data&lt;br /&gt;
|-&lt;br /&gt;
| 0x236E02 || 2 || 4535 || Invalid PartitionFS block hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x244402 || 2 || 4642 || Invalid Partition file hashed region bounds&lt;br /&gt;
|-&lt;br /&gt;
| 0x244602 || 2 || 4643 || Invalid Partition FS hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x244802 || 2 || 4644 || Invalid PFS0 magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x244A02 || 2 || 4645 || Invalid HFS0 magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x244C02 || 2 || 4646 || Invalid name offset for Partition FS file entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x244E02 || 2 || 4647 || Calculated Partition FS header size changed between 2 consecutive reads&lt;br /&gt;
|-&lt;br /&gt;
| 0x249802 || 2 || 4684 || Invalid FAT file number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249C02 || 2 || 4686 || Invalid FAT format for BIS User partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249E02 || 2 || 4687 || Invalid FAT format for BIS System partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24A002 || 2 || 4688 || Invalid FAT format for BIS Safe partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24A202 || 2 || 4689 || Invalid FAT format for BIS Calibration partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x280202 || 2 || 5121 || Invalid FAT size&lt;br /&gt;
|-&lt;br /&gt;
| 0x280402 || 2 || 5122 || Invalid FAT BPB (BIOS Parameter Block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x280602 || 2 || 5123 || Invalid FAT parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x280802 || 2 || 5124 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280A02 || 2 || 5125 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280C02 || 2 || 5126 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280E02 || 2 || 5127 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x296A02 || 2 || 5301 || Mountpoint not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE802 || 2 || 6004 || Invalid character.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 2 || 6005 || Invalid directory path.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEC02 || 2 || 6006 || Unable to retrieve directory from path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x313A02 || 2 || 6301 || A specified filesystem has no MultiCommitTarget when doing a multi-filesystem commit&lt;br /&gt;
|-&lt;br /&gt;
| 0x313C02 || 2 || 6302 || Attempted to resize a nn::fs::SubStorage or BufferedStorage that is marked as non-resizable&lt;br /&gt;
|-&lt;br /&gt;
| 0x313E02 || 2 || 6303 || Attempted to resize a nn::fs::SubStorage or BufferedStorage when the SubStorage ends before the base storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x314002 || 2 || 6304 || Attempted to call nn::fs::MemoryStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x314202 || 2 || 6305 || Invalid Operation ID in nn::fs::MemoryStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314402 || 2 || 6306 || Invalid Operation ID in nn::fs::FileStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314602 || 2 || 6307 || Invalid Operation ID in nn::fs::FileHandleStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314802 || 2 || 6308 || Invalid Operation ID in nn::fssystem::SwitchStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314A02 || 2 || 6309 || Invalid Operation ID in nn::fs::detail::StorageServiceObjectAdapter::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314C02 || 2 || 6310 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x314E02 || 2 || 6311 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315002 || 2 || 6312 || Invalid Operation ID in nn::fssystem::AesCtrCounterExtendedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x315202 || 2 || 6313 || Attempted to call nn::fssystem::AesCtrStorageExternal::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x315402 || 2 || 6314 || Attempted to call nn::fssystem::AesCtrStorageExternal::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315602 || 2 || 6315 || Attempted to call nn::fssystem::AesCtrStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315802 || 2 || 6316 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315A02 || 2 || 6317 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x315C02 || 2 || 6318 || Attempted to call nn::fssystem::save::IntegrityVerificationStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315E02 || 2 || 6319 || Attempted to invalidate the cache of a RomFs IVFC storage in nn::fssystem::save::IntegrityVerificationStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316002 || 2 || 6320 || Invalid Operation ID in nn::fssystem::save::IntegrityVerificationStorage::OperateRange &lt;br /&gt;
|-&lt;br /&gt;
| 0x316202 || 2 || 6321 || Attempted to call nn::fssystem::save::BlockCacheBufferedStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x316402 || 2 || 6322 || Attempted to invalidate the cache of something other than a savedata IVFC storage in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316602 || 2 || 6323 || Invalid Operation ID in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316802 || 2 || 6324 || Attempted to call nn::fssystem::IndirectStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x316A02 || 2 || 6325 || Attempted to call nn::fssystem::IndirectStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x316C02 || 2 || 6326 || Invalid Operation ID in nn::fssystem::IndirectStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316E02 || 2 || 6327 || Attempted to call nn::fssystem::SparseStorage::ZeroStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x317002 || 2 || 6328 || Attempted to call nn::fssystem::SparseStorage::ZeroStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317202 || 2 || 6329 || Attempted to call nn::fssystem::HierarchicalSha256Storage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317402 || 2 || 6330 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x317602 || 2 || 6331 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317802 || 2 || 6332 || Attempted to call nn::fssystem::IntegrityRomFsStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317A02 || 2 || 6333 || Attempted to call nn::fssystem::save::DuplexStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317C02 || 2 || 6334 || Invalid Operation ID in nn::fssystem::save::DuplexStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x317E02 || 2 || 6335 || Attempted to call nn::fssystem::save::HierarchicalDuplexStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318002 || 2 || 6336 || Attempted to call nn::fssystem::save::RemapStorage::GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318202 || 2 || 6337 || Attempted to call nn::fssystem::save::RemapStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318402 || 2 || 6338 || Invalid Operation ID in nn::fssystem::save::RemapStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318602 || 2 || 6339 || Attempted to call nn::fssystem::save::IntegritySaveDataStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318802 || 2 || 6340 || Invalid Operation ID in nn::fssystem::save::IntegritySaveDataStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318A02 || 2 || 6341 || Attempted to call nn::fssystem::save::JournalIntegritySaveDataStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318C02 || 2 || 6342 || Invalid Operation ID in nn::fssystem::save::JournalIntegritySaveDataStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318E02 || 2 || 6343 || Attempted to call nn::fssystem::save::JournalStorage::GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319002 || 2 || 6344 || Attempted to call nn::fssystem::save::JournalStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319202 || 2 || 6345 || Invalid Operation ID in nn::fssystem::save::JournalStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x319402 || 2 || 6346 || Attempted to call nn::fssystem::save::UnionStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319602 || 2 || 6347 || Attempted to call nn::fssystem::dbm::AllocationTableStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319802 || 2 || 6348 || Attempted to call nn::fssrv::fscreator::WriteOnlyGameCardStorage::Read&lt;br /&gt;
|-&lt;br /&gt;
| 0x319A02 || 2 || 6349 || Attempted to call nn::fssrv::fscreator::WriteOnlyGameCardStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319C02 || 2 || 6350 || Attempted to call nn::fssrv::fscreator::ReadOnlyGameCardStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x319E02 || 2 || 6351 || Attempted to call nn::fssrv::fscreator::ReadOnlyGameCardStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A002 || 2 || 6352 || Invalid Operation ID in nn::fssrv::fscreator::ReadOnlyGameCardStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A202 || 2 || 6353 || Attempted to call SdStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A402 || 2 || 6354 || Invalid Operation ID in SdStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A602 || 2 || 6355 || Invalid Operation ID in nn::fat::FatFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A802 || 2 || 6356 || Invalid Operation ID in nn::fssystem::StorageFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AA02 || 2 || 6357 || Attempted to call nn::fssystem::ConcatenationFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AC02 || 2 || 6358 || Attempted to call nn::fssystem::ConcatenationFile::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AE02 || 2 || 6359 || Invalid Query ID in nn::fssystem::ConcatenationFileSystem::DoQueryEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B002 || 2 || 6360 || Invalid Operation ID in nn::fssystem::ConcatenationFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B202 || 2 || 6361 || Attempted to call nn::fssystem::ZeroBitmapFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B402 || 2 || 6362 || Invalid Operation ID in nn::fs::detail::FileServiceObjectAdapter::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B602 || 2 || 6363 || Invalid Operation ID in nn::fssystem::AesXtsFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B802 || 2 || 6364 || Attempted to modify a nn::fs::RomFsFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BA02 || 2 || 6365 || Attempted to call nn::fs::RomFsFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BC02 || 2 || 6366 || Attempted to query the space in a nn::fs::RomFsFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BE02 || 2 || 6367 || Attempted to modify a nn::fssystem::RomFsFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C002 || 2 || 6368 || Invalid Operation ID in nn::fssystem::RomFsFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C202 || 2 || 6369 || Attempted to modify a nn::fs::ReadOnlyFileSystemTemplate&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C402 || 2 || 6370 || Attempted to call nn::fs::ReadOnlyFileSystemTemplate::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C602 || 2 || 6371 || Attempted to query the space in a nn::fs::ReadOnlyFileSystemTemplate&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C802 || 2 || 6372 || Attempted to modify a nn::fs::ReadOnlyFileSystemFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CA02 || 2 || 6373 || Invalid Operation ID in nn::fs::ReadOnlyFileSystemFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CC02 || 2 || 6374 || Attempted to modify a nn::fssystem::PartitionFileSystemCore&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CE02 || 2 || 6375 || Attempted to call nn::fssystem::PartitionFileSystemCore::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D002 || 2 || 6376 || Attempted to call nn::fssystem::PartitionFileSystemCore::PartitionFile::DoSetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D202 || 2 || 6377 || Invalid Operation ID in nn::fssystem::PartitionFileSystemCore::PartitionFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D402 || 2 || 6378 || Invalid Operation ID in nn::fssystem::TmFileSystemFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D602 || 2 || 6379 || Attempted to call unsupported functions in nn::fssrv::fscreator::SaveDataInternalStorageFileSystem, nn::fssrv::detail::SaveDataInternalStorageAccessor::PaddingFile or nn::fssystem::save::detail::SaveDataExtraDataInternalStorageFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31DC02 || 2 || 6382 || Attempted to call nn::fssystem::ApplicationTemporaryFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31DE02 || 2 || 6383 || Attempted to call nn::fssystem::SaveDataFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E002 || 2 || 6384 || Attempted to call nn::fssystem::DirectorySaveDataFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E202 || 2 || 6385 || Attempted to call nn::fssystem::ZeroBitmapHashStorageFile::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E402 || 2 || 6386 || Attempted to call nn::fssystem::ZeroBitmapHashStorageFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x326E02 || 2 || 6455 || File not closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x327002 || 2 || 6456 || Directory not closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x327202 || 2 || 6457 || Writable file not closed when committing&lt;br /&gt;
|-&lt;br /&gt;
| 0x327402 || 2 || 6458 || FS allocators already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x327602 || 2 || 6459 || FS allocators already used&lt;br /&gt;
|-&lt;br /&gt;
| 0x327A02 || 2 || 6461 || FS allocator alignment violation&lt;br /&gt;
|-&lt;br /&gt;
| 0x339402 || 2 || 6602 || File not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x339602 || 2 || 6603 || Directory not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346C02 || 2 || 6710 || Multi-commit limit reached&lt;br /&gt;
|-&lt;br /&gt;
| 0x35F202 || 2 || 6905 || Mount name not found in table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DBC02 || 2 || 7902 || RomFs table: Entry not found in dictionary&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DBE02 || 2 || 7903 || RomFs table: File not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC002 || 2 || 7904 || RomFs table: Directory not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC402 || 2 || 7906 || RomFs table: Entry already exists when trying to add a new entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC602 || 2 || 7907 || RomFs table: Insufficient space to add new entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC802 || 2 || 7908 || RomFs table: Unable to add new directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DCA02 || 2 || 7909 || RomFs table: Unable to add new file&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DCC02 || 2 || 7910 || RomFs directory has no more child directories/files when iterating&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DD402 || 2 || 7914 || RomFs table: Path is file, not directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x803 || 3 || 4 || OS busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xE03 || 3 || 7 || Invalid parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x1003 || 3 || 8 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1203 || 3 || 9 || Out of resources&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1408 || 8 || 10 || Program location for debug entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid NSO.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC09 || 9 || 6 || Invalid Path.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1409 || 9 || 10 || Invalid version in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Insufficient address space.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6809 || 9 || 52 || Insufficient NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C09 || 9 || 54 || Invalid signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x6E09 || 9 || 55 || Insufficient NRO registrations.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7009 || 9 || 56 || Insufficient NRR registrations.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7209 || 9 || 57 || NRO Already loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xA809 || 9 || 84 || NRR Not Loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1940A || 10 || 202 || Invalid CMIF header size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A60A || 10 || 211 || Invalid CMIF input header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Invalid CMIF output header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BA0A || 10 || 221 || Invalid method dispatch ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D60A || 10 || 235 || Invalid in object count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D80A || 10 || 236 || Invalid out object count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0A || 10 || 301 || Out of domain entries.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC0B || 11 || 102 || Out of server session memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3240B || 11 || 402 || Data/buffer length(s) too large for IPC buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3260B || 11 || 403 || Unknown request type&lt;br /&gt;
|-&lt;br /&gt;
| 0x3480B || 11 || 420 || Number(s) of buffers/handles/PIDs passed differ from what method expects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A810 || 16 || 340 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64210 || 16 || 801 || [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] system_delivery_protocol_version is less than the system-setting.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64410 || 16 || 802 || [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] system_delivery_protocol_version is larger than the system-setting.&lt;br /&gt;
|-&lt;br /&gt;
| 0x74610 || 16 || 931 || Invalid [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] HMAC / invalid Meta Id.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6F810 || 16 || 892 || Unknown state ref-count is zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x215 || 21 || 1 || Out of processes&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0x815 || 21 || 4 || Service already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xA15 || 21 || 5 || Out of services&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE15 || 21 || 7 || Service not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x1215 || 21 || 9 || Service Access Control too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A || 26 || 1 || SMC is not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || SMC argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x61A || 26 || 3 || SMC is currently in progress/secmon is busy&lt;br /&gt;
|-&lt;br /&gt;
| 0x81A || 26 || 4 || Secmon not currently performing async operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xA1A || 26 || 5 || Invalid SMC async callback key&lt;br /&gt;
|-&lt;br /&gt;
| 0xC1A || 26 || 6 || SMC is blacklisted during current boot&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Invalid (buffer) size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown SMC error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Decryption failure&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || No AES keyslots available&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES keyslot&lt;br /&gt;
|-&lt;br /&gt;
| 0xD41A || 26 || 106 || BootReason already set&lt;br /&gt;
|-&lt;br /&gt;
| 0xD61A || 26 || 107 || BootReason not set&lt;br /&gt;
|-&lt;br /&gt;
| 0xD81A || 26 || 108 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19269 || 105 || 201 || Null settings name&lt;br /&gt;
|-&lt;br /&gt;
| 0x19469 || 105 || 202 || Null settings key&lt;br /&gt;
|-&lt;br /&gt;
| 0x19669 || 105 || 203 || Null settings value&lt;br /&gt;
|-&lt;br /&gt;
| 0x19A69 || 105 || 205 || Null settings value buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A069 || 105 || 208 || Null setting value size buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A269 || 105 || 209 || Null debug mode flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BA69 || 105 || 221 || Setting group name has zero length&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BC69 || 105 || 222 || Empty settings item key&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E269 || 105 || 241 || Setting group name is too long (64 character limit?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E469 || 105 || 242 || Setting name is too long (64 character limit?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20A69 || 105 || 261 || Setting group name ends with &#039;.&#039; or contains invalid characters (allowed: [a-z0-9_\-.])&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C69 || 105 || 262 || Setting name ends with &#039;.&#039; or contains invalid characters (allowed: [a-z0-9_\-.])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4DA69 || 105 || 621 || Null language code buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E269 || 105 || 625 || Language out of valid range&lt;br /&gt;
|-&lt;br /&gt;
| 0x4EE69 || 105 || 631 || Null network settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F069 || 105 || 632 || Null network settings output count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x50269 || 105 || 641 || Null backlight settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51669 || 105 || 651 || Null Bluetooth device setting buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51869 || 105 || 652 || Null Bluetooth device setting output count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51A69 || 105 || 653 || Null Bluetooth enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51C69 || 105 || 654 || Null Bluetooth AFH enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51E69 || 105 || 655 || Null Bluetooth boost enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52069 || 105 || 656 || Null BLE pairing settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52269 || 105 || 657 || Null BLE pairing settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52A69 || 105 || 661 || Null external steady clock source ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52C69 || 105 || 662 || Null user system clock context buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52E69 || 105 || 663 || Null network system clock context buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53069 || 105 || 664 || Null user system clock automatic correction enabled flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53269 || 105 || 665 || Null shutdown RTC value buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53469 || 105 || 666 || Null external steady clock internal offset buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53E69 || 105 || 671 || Null account settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55269 || 105 || 681 || Null audio volume buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55669 || 105 || 683 || Null ForceMuteOnHeadphoneRemoved buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55869 || 105 || 684 || Null headphone volume warning count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55E69 || 105 || 687 || Invalid audio output mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x56069 || 105 || 688 || Null headphone volume update flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x56669 || 105 || 691 || Null console information upload flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57A69 || 105 || 701 || Null automatic application download flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57C69 || 105 || 702 || Null notification settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57E69 || 105 || 703 || Null account notification settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x58069 || 105 || 704 || Null account notification settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x58E69 || 105 || 711 || Null vibration master volume buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59069 || 105 || 712 || Null NX controller settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59269 || 105 || 713 || Null NX controller settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59469 || 105 || 714 || Null USB full key enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A269 || 105 || 721 || Null TV settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A469 || 105 || 722 || Null EDID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5B669 || 105 || 731 || Null data deletion settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CA69 || 105 || 741 || Null initial system applet program ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CC69 || 105 || 742 || Null overlay disp program ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CE69 || 105 || 743 || Null IsInRepairProcess buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D069 || 105 || 744 || Null RequiresRunRepairTimeReviser buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5DE69 || 105 || 751 || Null device timezone location name buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F269 || 105 || 761 || Null primary album storage buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x60669 || 105 || 771 || Null USB 3.0 enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x60869 || 105 || 772 || Null USB Type-C power source circuit version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x61A69 || 105 || 781 || Null battery lot buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x62E69 || 105 || 791 || Null serial number buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64269 || 105 || 801 || Null lock screen flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64669 || 105 || 803 || Null color set ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64869 || 105 || 804 || Null quest flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64A69 || 105 || 805 || Null wireless certification file size buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64C69 || 105 || 806 || Null wireless certification file buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64E69 || 105 || 807 || Null initial launch settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65069 || 105 || 808 || Null device nickname buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65269 || 105 || 809 || Null battery percentage flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65469 || 105 || 810 || Null applet launch flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E869 || 105 || 1012 || Null wireless LAN enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FA69 || 105 || 1021 || Null product model buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E69 || 105 || 1031 || Null NFC enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x82269 || 105 || 1041 || Null ECI device certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x82469 || 105 || 1042 || Null E-Ticket device certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x83669 || 105 || 1051 || Null sleep settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x84A69 || 105 || 1061 || Null EULA version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x84C69 || 105 || 1062 || Null EULA version entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x85E69 || 105 || 1071 || Null LDN channel buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x87269 || 105 || 1081 || Null SSL key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x87469 || 105 || 1082 || Null SSL certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x88669 || 105 || 1091 || Null telemetry flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x89A69 || 105 || 1101 || Null Gamecard key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x89C69 || 105 || 1102 || Null Gamecard certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8AE69 || 105 || 1111 || Null PTM battery lot buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B069 || 105 || 1112 || Null PTM fuel gauge parameter buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C269 || 105 || 1121 || Null ECI device key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C469 || 105 || 1122 || Null E-Ticket device key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D669 || 105 || 1131 || Null speaker parameter buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EA69 || 105 || 1141 || Null firmware version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EC69 || 105 || 1142 || Null firmware version digest buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EE69 || 105 || 1143 || Null rebootless system update version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8FE69 || 105 || 1151 || Null Mii author ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x91269 || 105 || 1161 || Null fatal flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x92669 || 105 || 1171 || Null auto update enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x93A69 || 105 || 1181 || Null external RTC reset flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x94E69 || 105 || 1191 || Null push notification activity mode buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x96269 || 105 || 1201 || Null service discovery control setting buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x97669 || 105 || 1211 || Null error report share permission buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x98A69 || 105 || 1221 || Null LCD vendor ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x99E69 || 105 || 1231 || Null console SixAxis sensor acceleration bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A069 || 105 || 1232 || Null console SixAxis sensor angular velocity bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A269 || 105 || 1233 || Null console SixAxis sensor acceleration gain buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A469 || 105 || 1234 || Null console SixAxis sensor angular velocity gain buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A669 || 105 || 1235 || Null console SixAxis sensor angular velocity time bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A869 || 105 || 1236 || Null console SixAxis sensor angular acceleration buffer &lt;br /&gt;
|-&lt;br /&gt;
| 0x9B269 || 105 || 1241 || Null keyboard layout buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9BA69 || 105 || 1245 || Invalid keyboard layout&lt;br /&gt;
|-&lt;br /&gt;
| 0x9C669 || 105 || 1251 || Null web inspector flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9C869 || 105 || 1252 || Null allowed SSL hosts buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9CA69 || 105 || 1253 || Null allowed SSL hosts entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9CC69 || 105 || 1254 || Null host FS mount point buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9EE69 || 105 || 1271 || Null Amiibo key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F069 || 105 || 1272 || Null Amiibo ECQV certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F269 || 105 || 1273 || Null Amiibo ECDSA certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F469 || 105 || 1274 || Null Amiibo ECQV BLS key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F669 || 105 || 1275 || Null Amiibo ECQV BLS certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F869 || 105 || 1276 || Null Amiibo ECQV BLS root certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xC72 || 114 || 6 || Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || 116 || 0 || Time service not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x274 || 116 || 1 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set / Clock Source Id mismatch&lt;br /&gt;
|-&lt;br /&gt;
| 0x19074 || 116 || 200 || Invalid time comparison&lt;br /&gt;
|-&lt;br /&gt;
| 0x19274 || 116 || 201 || Signed overflow/underflow&lt;br /&gt;
|-&lt;br /&gt;
| 0x64274 || 116 || 801 || Memory allocation failure&lt;br /&gt;
|-&lt;br /&gt;
| 0x70A74 || 116 || 901 || Null pointer&lt;br /&gt;
|-&lt;br /&gt;
| 0x70C74 || 116 || 902 || Value out of valid range&lt;br /&gt;
|-&lt;br /&gt;
| 0x70E74 || 116 || 903 || TimeZoneRule conversion failed&lt;br /&gt;
|-&lt;br /&gt;
| 0x7BA74 || 116 || 989 || TimeZone location name not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x7BC74 || 116 || 990 || Unimplemented functionality&lt;br /&gt;
|-&lt;br /&gt;
| 0xC79 || 121 || 6 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x27A || 122 || 1 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x47A || 122 || 2 || Object not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x67A || 122 || 3 || Object locked/in used&lt;br /&gt;
|-&lt;br /&gt;
| 0x87A || 122 || 4 || Target already mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0xA7A || 122 || 5 || Target not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0xC7A || 122 || 6 || Object already opened&lt;br /&gt;
|-&lt;br /&gt;
| 0xE7A || 122 || 7 || Object not opened&lt;br /&gt;
|-&lt;br /&gt;
| 0x107A || 122 || 8 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA07A || 122 || 80 || Passphrase not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA27A || 122 || 81 || Data verification failed&lt;br /&gt;
|-&lt;br /&gt;
| 0xB47A || 122 || 90 || Invalid API call&lt;br /&gt;
|-&lt;br /&gt;
| 0xC47A || 122 || 98 || Invalid operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x167B || 123 || 11 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8192 (SEC_ERROR_IO), -8191 (SEC_ERROR_LIBRARY_FAILURE), -8190 (SEC_ERROR_BAD_DATA), -8189 (SEC_ERROR_OUTPUT_LEN), -8188 (SEC_ERROR_INPUT_LEN), -8187 (SEC_ERROR_INVALID_ARGS), -8186 (SEC_ERROR_INVALID_ALGORITHM), -8184 (SEC_ERROR_INVALID_TIME), -8152 (SEC_ERROR_INVALID_KEY).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] errors: -5991 (PR_IO_ERROR), -5962 (PR_BUFFER_OVERFLOW_ERROR), -5950 (PR_FILE_NOT_FOUND_ERROR), -5949 (PR_NOT_DIRECTORY_ERROR), -5946 (PR_FILESYSTEM_MOUNTED_ERROR), -5938 (PR_END_OF_FILE_ERROR).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12223 (SSL_ERROR_GENERATE_RANDOM_FAILURE), -12222 (SSL_ERROR_SIGN_HASHES_FAILURE), -12221 (SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE), -12219 (SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE), -12218 (SSL_ERROR_ENCRYPTION_FAILURE), -12217 (SSL_ERROR_DECRYPTION_FAILURE), -12216 (SSL_ERROR_SOCKET_WRITE_FAILURE), -12212 (SSL_ERROR_SYM_KEY_CONTEXT_FAILURE), -12209 (SSL_ERROR_IV_PARAM_FAILURE), -12207 (SSL_ERROR_SESSION_KEY_GEN_FAILURE), -12203 (SSL_ERROR_NO_COMPRESSION_OVERLAP), -12202 (SSL_ERROR_HANDSHAKE_NOT_COMPLETED), -12201 (SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE), -12172 (SSL_ERROR_NEXT_PROTOCOL_DATA_INVALID).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A7B || 123 || 13 || Unrecognized error.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC7B || 123 || 102 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8173 (SEC_ERROR_NO_MEMORY).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] errors: -6000 (PR_OUT_OF_MEMORY_ERROR), -5974 (PR_INSUFFICIENT_RESOURCES_ERROR, -5971 (PR_PROC_DESC_TABLE_FULL_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0xE87B || 123 || 116 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5999 (PR_BAD_DESCRIPTOR_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1027B || 123 || 129 || DER CRL decoding failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1987B || 123 || 204 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5998 (PR_WOULD_BLOCK_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19A7B || 123 || 205 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5990 (PR_IO_TIMEOUT_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19C7B || 123 || 206 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5935 (PR_OPERATION_ABORTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A07B || 123 || 208 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5978 (PR_NOT_CONNECTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A27B || 123 || 209 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5961 (PR_CONNECT_RESET_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A47B || 123 || 210 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5928 (PR_CONNECT_ABORTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A67B || 123 || 211 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5929 (PR_SOCKET_SHUTDOWN_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A87B || 123 || 212 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5930 (PR_NETWORK_DOWN_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1AE7B || 123 || 215 || ClientPki/InternalPki was already previously imported/registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B47B || 123 || 218 || Maximum number of ServerPki objects were already imported.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A7B || 123 || 301 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12276 (SSL_ERROR_BAD_CERT_DOMAIN).&lt;br /&gt;
|-&lt;br /&gt;
| 0x25C7B || 123 || 302 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12285 (SSL_ERROR_NO_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x25E7B || 123 || 303 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8181 (SEC_ERROR_EXPIRED_CERTIFICATE), -8162 (SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2607B || 123 || 304 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8180 (SEC_ERROR_REVOKED_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2627B || 123 || 305 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8183 (SEC_ERROR_BAD_DER).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2647B || 123 || 306 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8102 (SEC_ERROR_INADEQUATE_KEY_USAGE), -8101 (SEC_ERROR_INADEQUATE_CERT_TYPE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2667B || 123 || 307 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8185 (SEC_ERROR_INVALID_AVA), -8182 (SEC_ERROR_BAD_SIGNATURE), -8158 (SEC_ERROR_EXTENSION_VALUE_INVALID), -8156 (SEC_ERROR_CA_CERT_INVALID), -8151 (SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION), -8080 (SEC_ERROR_CERT_NOT_IN_NAME_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2687B || 123 || 308 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8179 (SEC_ERROR_UNKNOWN_ISSUER), -8172 (SEC_ERROR_UNTRUSTED_ISSUER), -8014 (SEC_ERROR_APPLICATION_CALLBACK_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A7B || 123 || 309 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8171 (SEC_ERROR_UNTRUSTED_CERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C7B || 123 || 310 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12233 (SSL_ERROR_RX_UNKNOWN_RECORD_TYPE), -12232 (SSL_ERROR_RX_UNKNOWN_HANDSHAKE), -12231 (SSL_ERROR_RX_UNKNOWN_ALERT). This is also returned by ImportClientPki when import fails.&lt;br /&gt;
|-&lt;br /&gt;
| 0x26E7B || 123 || 311 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12261 (SSL_ERROR_RX_MALFORMED_HELLO_REQUEST), -12260 (SSL_ERROR_RX_MALFORMED_CLIENT_HELLO), -12259 (SSL_ERROR_RX_MALFORMED_SERVER_HELLO), -12258 (SSL_ERROR_RX_MALFORMED_CERTIFICATE), -12257 (SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH), -12256 (SSL_ERROR_RX_MALFORMED_CERT_REQUEST), -12255 (SSL_ERROR_RX_MALFORMED_HELLO_DONE), -12254 (SSL_ERROR_RX_MALFORMED_CERT_VERIFY), -12253 (SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH), -12252 (SSL_ERROR_RX_MALFORMED_FINISHED), -12251 (SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER), -12250 (SSL_ERROR_RX_MALFORMED_ALERT), -12249 (SSL_ERROR_RX_MALFORMED_HANDSHAKE), -12248 (SSL_ERROR_RX_MALFORMED_APPLICATION_DATA), -12166 (SSL_ERROR_RX_MALFORMED_HELLO_VERIFY_REQUEST).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2707B || 123 || 312 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8144 (SEC_ERROR_UNSUPPORTED_KEYALG).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12274 (SSL_ERROR_SSL2_DISABLED), -12247 (SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST), -12246 (SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO), -12245 (SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO), -12244 (SSL_ERROR_RX_UNEXPECTED_CERTIFICATE), -12243 (SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH), -12242 (SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST), -12241 (SSL_ERROR_RX_UNEXPECTED_HELLO_DONE), -12240 (SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY), -12239 (SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH), -12238 (SSL_ERROR_RX_UNEXPECTED_FINISHED).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2727B || 123 || 313 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12237 (SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER), -12236 (SSL_ERROR_RX_UNEXPECTED_ALERT), -12235 (SSL_ERROR_RX_UNEXPECTED_HANDSHAKE), -12234 (SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2747B || 123 || 314 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2767B || 123 || 315 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12165 (SSL_ERROR_RX_UNEXPECTED_HELLO_VERIFY_REQUEST).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2787B || 123 || 316 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12163 (SSL_ERROR_RX_UNEXPECTED_CERT_STATUS).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27A7B || 123 || 317 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12160 (SSL_ERROR_INCORRECT_SIGNATURE_ALGORITHM).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27C7B || 123 || 318 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12173 (SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY), -12156 (SSL_ERROR_WEAK_SERVER_CERT_KEY).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27E7B || 123 || 319 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12273 (SSL_ERROR_BAD_MAC_READ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2827B || 123 || 321 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12215 (SSL_ERROR_MD5_DIGEST_FAILURE), -12214 (SSL_ERROR_SHA_DIGEST_FAILURE), -12161 (SSL_ERROR_DIGEST_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2847B || 123 || 322 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12213 (SSL_ERROR_MAC_COMPUTATION_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2887B || 123 || 324 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8157 (SEC_ERROR_EXTENSION_NOT_FOUND).&lt;br /&gt;
|-&lt;br /&gt;
| 0x28A7B || 123 || 325 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8049 (SEC_ERROR_UNRECOGNIZED_OID).&lt;br /&gt;
|-&lt;br /&gt;
| 0x28C7B || 123 || 326 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8032 (SEC_ERROR_POLICY_VALIDATION_FAILED).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2947B || 123 || 330 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12177 (SSL_ERROR_DECOMPRESSION_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBA7B || 123 || 1501 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12230 (SSL_ERROR_CLOSE_NOTIFY_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBC7B || 123 || 1502 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12229 (SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBE7B || 123 || 1503 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12272 (SSL_ERROR_BAD_MAC_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC07B || 123 || 1504 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12197 (SSL_ERROR_DECRYPTION_FAILED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC27B || 123 || 1505 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12196 (SSL_ERROR_RECORD_OVERFLOW_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC47B || 123 || 1506 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12228 (SSL_ERROR_DECOMPRESSION_FAILURE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC67B || 123 || 1507 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12227 (SSL_ERROR_HANDSHAKE_FAILURE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCA7B || 123 || 1509 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12271 (SSL_ERROR_BAD_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCC7B || 123 || 1510 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12225 (SSL_ERROR_UNSUPPORTED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCE7B || 123 || 1511 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12270 (SSL_ERROR_REVOKED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD07B || 123 || 1512 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12269 (SSL_ERROR_EXPIRED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD27B || 123 || 1513 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12224 (SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD47B || 123 || 1514 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12226 (SSL_ERROR_ILLEGAL_PARAMETER_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD67B || 123 || 1515 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12195 (SSL_ERROR_UNKNOWN_CA_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD87B || 123 || 1516 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12194 (SSL_ERROR_ACCESS_DENIED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDA7B || 123 || 1517 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12193 (SSL_ERROR_DECODE_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDC7B || 123 || 1518 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12192 (SSL_ERROR_DECRYPT_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDE7B || 123 || 1519 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12191 (SSL_ERROR_EXPORT_RESTRICTION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE07B || 123 || 1520 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12190 (SSL_ERROR_PROTOCOL_VERSION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE27B || 123 || 1521 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12189 (SSL_ERROR_INSUFFICIENT_SECURITY_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE47B || 123 || 1522 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12188 (SSL_ERROR_INTERNAL_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE67B || 123 || 1523 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12157 (SSL_ERROR_INAPPROPRIATE_FALLBACK_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE87B || 123 || 1524 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12187 (SSL_ERROR_USER_CANCELED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEA7B || 123 || 1525 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12186 (SSL_ERROR_NO_RENEGOTIATION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEC7B || 123 || 1526 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12184 (SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEE7B || 123 || 1527 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12183 (SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF07B || 123 || 1528 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12182 (SSL_ERROR_UNRECOGNIZED_NAME_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF27B || 123 || 1529 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12181 (SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF47B || 123 || 1530 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12180 (SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27127B || 123 || 5001 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12155 (SSL_ERROR_RX_SHORT_DTLS_READ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x271E7B || 123 || 5007 || Out-of-bounds error during error conversion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x767C || 124 || 59 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 3000 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/27166/ System Update Required]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 3001 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28969/ Game Update Required]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4007 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28046/ Account Permanent Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4508 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28046/ Account Permanent Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4517 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/43652/ Account Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4609 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/46482/ Service Discontinued]&lt;br /&gt;
|-&lt;br /&gt;
| 0x27E || 126 || 1 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x87E || 126 || 4 || Entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE7E || 126 || 67 || Invalid database signature value (should be &amp;quot;NFDB&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD27E || 126 || 69 || Invalid database entry count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1987E || 126 || 204 || Development/debug-only behavior&lt;br /&gt;
|-&lt;br /&gt;
| 0x480 || 128 || 2 || IStorage not available.&lt;br /&gt;
|-&lt;br /&gt;
| 0x680 || 128 || 3 || No messages&lt;br /&gt;
|-&lt;br /&gt;
| 0x4680 || 128 || 35 || Error while launching applet.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A80 || 128 || 37 || Title-ID not found. Caused by code 0x410 when applet launch fails&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E880 || 128 || 500 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC80 || 128 || 502 || IStorage has already been opened by another accessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE80 || 128 || 503 || IStorage Read/Write out-of-bounds&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F480 || 128 || 506 || Invalid parameters&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FE80 || 128 || 511 || IStorage opened as wrong type (data opened as transfermem, transfermem opened as data)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40080 || 128 || 512 || Unbalanced fatal section leave (returned when executing LeaveFatalSection without a preceding EnterFatalSection call)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40C80 || 128 || 518 || Null object&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B080 || 128 || 600 || Failed to allocate memory for IStorage&lt;br /&gt;
|-&lt;br /&gt;
| 0x59080 || 128 || 712 || Thread stack pool exhausted (out of memory)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79C80 || 128 || 974 || DebugMode not enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 980 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set / DebugMode not enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x7CC80 || 128 || 998 || Not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC81 || 129 || 102 || Transmission not agreed&lt;br /&gt;
|-&lt;br /&gt;
| 0xD281 || 129 || 105 || Network unavailable&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DA81 || 129 || 1005 || HTTP error: Couldnt resolve proxy&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DC81 || 129 || 1006 || HTTP error: Couldnt resolve host&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DE81 || 129 || 1007 || HTTP error: Couldnt connect&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE81 || 129 || 1023 || HTTP error: Write error&lt;br /&gt;
|-&lt;br /&gt;
| 0x80481 || 129 || 1026 || HTTP error: Read error&lt;br /&gt;
|-&lt;br /&gt;
| 0x80681 || 129 || 1027 || HTTP error: Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x80881 || 129 || 1028 || HTTP error: Operation timedout&lt;br /&gt;
|-&lt;br /&gt;
| 0x81681 || 129 || 1035 || HTTP error: SSL connect error&lt;br /&gt;
|-&lt;br /&gt;
| 0x83681 || 129 || 1051 || HTTP error: Peer failed verification&lt;br /&gt;
|-&lt;br /&gt;
| 0x83881 || 129 || 1052 || HTTP error: Got nothing&lt;br /&gt;
|-&lt;br /&gt;
| 0x83E81 || 129 || 1055 || HTTP error: Send error&lt;br /&gt;
|-&lt;br /&gt;
| 0x84081 || 129 || 1056 || HTTP error: Recv error&lt;br /&gt;
|-&lt;br /&gt;
| 0x84481 || 129 || 1058 || HTTP error: SSL cert problem&lt;br /&gt;
|-&lt;br /&gt;
| 0x84681 || 129 || 1059 || HTTP error: SSL cipher&lt;br /&gt;
|-&lt;br /&gt;
| 0x84881 || 129 || 1060 || HTTP error: SSL CA cert&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C081 || 129 || 2400 || Server error: Status 400&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C281 || 129 || 2401 || Server error: Status 401&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C681 || 129 || 2403 || Server error: Status 403&lt;br /&gt;
|-&lt;br /&gt;
| 0x138881 || 129 || 2500 || Server error: Status 500&lt;br /&gt;
|-&lt;br /&gt;
| 0x138E81 || 129 || 2503 || Server error: Status 503&lt;br /&gt;
|-&lt;br /&gt;
| 0x139081 || 129 || 2504 || Server error: Status 504&lt;br /&gt;
|-&lt;br /&gt;
| 0xA83 || 131 || 5 || Unrecognized applet ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x485 || 133 || 2 || Invalid DVFS table ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x685 || 133 || 3 || DVFS table ID for debug only, see [[PCV_services#Module|DVFS Table]] notes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x885 || 133 || 4 || Invalid parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x1489 || 137 || 10 || Already initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C89 || 137 || 30 || Task not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5089 || 137  || 40 || Memory allocation failed / bad input.&lt;br /&gt;
|-&lt;br /&gt;
| 0x29489 || 137 || 330 || [[NCM_services#ContentMetaType|ContentMetaType]] doesn&#039;t match SystemUpdate.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271289 || 137 || 5001 || One of the following socket errors occurred: ENETDOWN, ECONNRESET, EHOSTDOWN, EHOSTUNREACH, or EPIPE. Also occurs when the received size doesn&#039;t match the expected size (recvfrom() ret with [[NIM_services#Contents_Delivery|meta_size]] data receiving).&lt;br /&gt;
|-&lt;br /&gt;
| 0x272489 || 137 || 5010 || Socket was [[Sockets_services|shutdown()]] due to the async operation being cancelled.&lt;br /&gt;
|-&lt;br /&gt;
| 0x273889 || 137 || 5020 || Too many internal output entries with [[NIM_services|nim]] cmd42, system is [[NIM_services#Contents_Delivery|Internet-connected]], or an unrecognized socket error occured.&lt;br /&gt;
|-&lt;br /&gt;
| 0x27D889 || 137 || 5100 || Connection timeout.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A4489 || 137 || 5410 || Invalid [[NIM_services#Contents_Delivery|ID]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A5889 || 137 || 5420 || Invalid [[NIM_services#Contents_Delivery|magicnum]]. Can also be caused by the connection being closed by the peer, since non-negative return values from recv() are ignored in this case.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A6C89 || 137 || 5430 || Invalid [[NIM_services#Contents_Delivery|data_size]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A8089 || 137 || 5440 || The input [[NCM_services#ContentMetaKey|ContentMetaKey]] doesn&#039;t match the ContentMetaKey in state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A9489 || 137 || 5450 || Invalid [[NIM_services#Contents_Delivery|meta_size]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B289 || 137 || 7001 || HTTP invalid response code (&amp;gt;=600).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B489 || 137 || 7002 || HTTP invalid client response code (4xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B689 || 137 || 7003 || HTTP invalid server response code (5xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B889 || 137 || 7004 || HTTP invalid redirect response code (3xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x390889-0x391889 || 137 || 7300-7308 || HTTP response code 300-308.&lt;br /&gt;
|-&lt;br /&gt;
| 0x39D089-0x39F289 || 137 || 7400-7417 || HTTP response code 400-417.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A9889-0x3AAA89 || 137 || 7500-7509 || HTTP response code 500-509.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E8289-0x3F4089 || 137 || 8001-8096 || libcurl error 1-96. Some of the libcurl errors in the error-table map to the above unknown-libcurl-error however.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68A || 138 || 3 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BE8E || 142 || 223 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x290 || 144 || 1 || Exited Abnormally ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Abormal)&lt;br /&gt;
|-&lt;br /&gt;
| 0x690 || 144 || 3 || Canceled ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Canceled)&lt;br /&gt;
|-&lt;br /&gt;
| 0x890 || 144 || 4 || Rejected&lt;br /&gt;
|-&lt;br /&gt;
| 0xA90 || 144 || 5 || Exited Unexpectedly ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Unexpected)&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Operation couldn&#039;t complete successfully&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x899 || 153 || 4 || Buffer size too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x1099 || 153 || 8 || Too many buffers are still unreleased&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0x40299 || 153 || 513 || Invalid/Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0099 || 153 || 1536 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x49E || 158 || 2 || BootImagePackage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x69E || 158 || 3 || Invalid BootImagePackage&lt;br /&gt;
|-&lt;br /&gt;
| 0x89E || 158 || 4 || Work buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0xA9E || 158 || 5 || Work buffer not aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0xC9E || 158 || 6 || BootImages need repair&lt;br /&gt;
|-&lt;br /&gt;
| 0x29F || 159 || 1 || Cancel was selected&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA3 || 163 ||  5 || System is booting up repair process without VOL+ held down.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA3 || 163 || 6 || System is booting up repair process that requires RepairTimeReviser but does not have special cartridge inserted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x70A4 || 164 || 56 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4AF || 175 || 2 || Bad version returned from calling the &amp;quot;nnjitpluginGetVersion&amp;quot; symbol.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCAAF || 175 || 101 || Input NRO/NRR are too large for the storage buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B0AF || 175 || 600 || Symbol funcptr used by this cmd is not initialized (Control/GenerateCode).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B2AF || 175 || 601 || DllPlugin Not initialized, or plugin NRO has already been loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B4AF || 175 || 602 || An error was returned from calling the symbol funcptr with the Control cmd.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8B2 || 178 || 100 || Invalid user ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xCAB2 || 178 || 101 || User does not exist&lt;br /&gt;
|-&lt;br /&gt;
| 0x12CB2 || 178 || 150 || Service unavailable&lt;br /&gt;
|-&lt;br /&gt;
| 0x190B2 || 178 || 200 || File storage failure&lt;br /&gt;
|-&lt;br /&gt;
| 0xAB4 || 180 || 5 || Invalid event ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4EB5 || 181 || 4007 || Device authentication error: System update required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F50B5 || 181 || 4008 || Device authentication error: [https://en-americas-support.nintendo.com/app/answers/detail/a_id/42061/ Permanant Ban]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F52B5 || 181 || 4009 || Device authentication error: Internal server error&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F54B5 || 181 || 4007 || Device authentication error: Under maintenance&lt;br /&gt;
|-&lt;br /&gt;
|  || 181 || 4017 || Device authentication error: [https://en-americas-support.nintendo.com/app/answers/detail/a_id/43653/ Ban]&lt;br /&gt;
|-&lt;br /&gt;
| 0x58ACA || 202 || 709 || Npad ID is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2032CA || 202 || 4121 || [[Settings_services#ButtonConfigSettings|ButtonConfigSettings]] IsFull flag is clear.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28CB || 203 || 20 || The [6.0.0+] Authentication challenge failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40CB || 203 || 32 || Bad State / bad state ptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82CB || 203 || 65 || Failed to connect to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x84CB || 203 || 66 || Timeout occured during Authentication / while attempting to find a valid ActionFrame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86CB || 203 || 67 || Maximum participants reached, Station not allowed to connect, ...&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0CB || 203 || 96 || Bad input, or not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC2CB || 203 || 97 || Matching LocalCommunicationId not found in the user-process [[NACP_Format|control.nacp]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xE2CB || 203 || 113 || The specified LocalCommunicationVersion is less than the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4CB || 203 || 114 || The specified LocalCommunicationVersion is larger than the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF0CD || 205 || 120 || IR image data not available/ready.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A8CD || 205 || 212 || IR camera handle pointer is null.&lt;br /&gt;
|-&lt;br /&gt;
| 0x198CD || 205 || 204 || IR camera invalid handle value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE || 206 || 2 || Invalid argument.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6CE || 206 || 3 || Out of memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10CE || 206 || 8 || Out of range. Buffer needs to be aligned.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18CE || 206 || 12 || Invalid FileId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1ACE || 206 || 13 || Invalid storage ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1CCE || 206 || 14 || Invalid content type.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2ACE || 206 || 21 || Failed to mount Image Directory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2CCE || 206 || 23 || File too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30CE || 206 || 24 || Invalid file size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CCE || 206 || 30 || Buffer insufficient.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAF2CE || 206 || 1401 || Too many files already saved.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4DA || 218 || 2 || StatusManager entry IsValid flag not set, or controller-update currently in-progress.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6DA || 218 || 3 || Controller-update failed via the LibraryApplet.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8DA || 218 || 4 || Invalid BusHandle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xADA || 218 || 5 || StatusManager entry flag +0x0 not set, or device not connected.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEDA || 218 || 7 || PollingReceivedData not available.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10DA || 218 || 8 || StatusManager entry DeviceEnabled flag not set, or flag +0x0 not set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12DA || 218 || 9 || ExternalDeviceId mismatch.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14DA || 218 || 10 || BusHandle already initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x104E7 || 231 || 130 || Nullptr passed to the LocalCommunicationId [[NACP_Format|control.nacp]] validation func.&lt;br /&gt;
|-&lt;br /&gt;
| 0x140E7 || 231 || 160 || GroupInfo field out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x142E7 || 231 || 161 || SupportedPlatform not appropriate for this operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x146E7 || 231 || 163 || Invalid ServiceName.&lt;br /&gt;
|-&lt;br /&gt;
| 0x148E7 || 231 || 164 || Must provide PresharedBinaryKey.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0E7 || 231 || 224 || Requested Priority value not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C2E7 || 231 || 225 || Matching LocalCommunicationId not found in the user-process [[NACP_Format|control.nacp]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x200E7 || 231 || 256 || Invalid flag.&lt;br /&gt;
|-&lt;br /&gt;
| 0x204E7 || 231 || 258 || Invalid SupportedPlatform.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208E7 || 231 || 260 || Invalid StaticAesKeyIndex.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20AE7 || 231 || 261 || MemberCountMax cannot be greater than 8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x210E7 || 231 || 264 || GroupInfo+8F must be 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== FS Error codes ===&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || nn::svc::ResultInvalidCurrentMemory: Error: Passed buffer is not usable for fs library. See a manual of fs library for more information.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || nn::fs::ResultMountNameAlreadyExists: Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || nn::fs::ResultPartitionNotFound: Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || nn::fs::ResultTargetNotFound: Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || nn::fs::ResultSdCardAccessFailed: Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || nn::fs::ResultGameCardAccessFailed: Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || nn::fs::ResultNotImplemented: Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || nn::fs::ResultOutOfRange: Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x190002 - 0x1B5602 || 3200 - 3499 || nn::fs::ResultAllocationMemoryFailed: Error: Failed to allocate memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || nn::fs::ResultMmcAccessFailed: Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || nn::fs::ResultRomCorrupted: Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || nn::fs::ResultSaveDataCorrupted: Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || nn::fs::ResultNcaCorrupted: Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || nn::fs::ResultIntegrityVerificationStorageCorrupted: Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || nn::fs::ResultPartitionFileSystemCorrupted: Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || nn::fs::ResultBuiltInStorageCorrupted: Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || nn::fs::ResultFatFileSystemCorrupted: Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || nn::fs::ResultHostFileSystemCorrupted: Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || nn::fs::ResultDataCorrupted: Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || nn::fs::ResultUnexpected: Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 - 0x32C602 || 6000-6499 || nn::fs::ResultPreconditionViolation: Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || nn::fs::ResultInvalidArgument: Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || nn::fs::ResultInvalidPath: Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 6003 || nn::fs::ResultTooLongPath: Error: Too long path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE802 || 6004 || nn::fs::ResultInvalidCharacter: Error: Invalid path character was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 6005 || nn::fs::ResultInvalidPathFormat: Error: Invalid path format was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || nn::fs::ResultInvalidOffset: Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || nn::fs::ResultInvalidSize: Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || nn::fs::ResultNullptrArgument: Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6202 || 6065 || nn::fs::ResultInvalidMountName: Error: Invalid mount name was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6402 || 6066 || nn::fs::ResultExtensionSizeTooLarge: Error: Extension size exceeds max value set in nmeta file.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6602 || 6067 || nn::fs::ResultExtensionSizeInvalid: Error: Extension size is not a multiple of nn::fs::SaveDataExtensionUnitSize.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || nn::fs::ResultFileExtensionWithoutOpenModeAllowAppend: Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || nn::fs::ResultInvalidOperationForOpenMode: Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || nn::fs::ResultUnsupportedOperation: Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x326202 || 6400-6449 || nn::fs::ResultPermissionDenied: Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x327202 || 6457 || nn::fs::ResultWriteModeFileNotClosed: Error: Close files opened in write mode before committing.&lt;br /&gt;
|-&lt;br /&gt;
| 0x328202 || 6465 || nn::fs::ResultUserNotExist: Error: Specified user doesn&#039;t exist.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || nn::fs::ResultMappingTableFull: Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || nn::fs::ResultOpenCountLimit: Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x353602 || 6811 || nn::fs::ResultMapFull: Error: Save data extension count reached the limitation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x35F202 || 6905 || nn::fs::ResultNotMounted: Error: Specified mount name is not found.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no effect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| Userland ARM data abort. Also caused by abnormal process termination via [[SVC|svcExitProcess]]. Note: directly jumping to nnMain()-retaddr from non-main-thread has the same result.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
This section is for Support Errors displayed by the error-applet, separate from the normal Result Errors.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 520 || Nverpt&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
== Error codes ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;br /&gt;
&lt;br /&gt;
= Homebrew Errors =&lt;br /&gt;
Custom errors used by homebrew libraries and applications.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx NVIDIA errors&lt;br /&gt;
|-&lt;br /&gt;
| 349 || libnx Binder errors&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10626</id>
		<title>Mario Kart Live: Home Circuit</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Mario_Kart_Live:_Home_Circuit&amp;diff=10626"/>
		<updated>2021-01-29T20:15:40Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Pairing process &amp;amp; Network protocols */ New sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the Mario Kart Live: Home Circuit game.&lt;br /&gt;
&lt;br /&gt;
Communication with the kart is done directly over local-WLAN via [[LDN_services|lp2p:app]]. The service implementation is in the main-codebin itself, without symbols - however there are strings for this. This is the first title on retail which uses lp2p.&lt;br /&gt;
&lt;br /&gt;
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:&lt;br /&gt;
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.&lt;br /&gt;
* There is no initialization func for __stack_chk_guard, it&#039;s just a hard-coded constant: 0xDEADBEEFDEADBEEF. Since it&#039;s constant, this renders the stack cookie useless.&lt;br /&gt;
&lt;br /&gt;
RomFs contains only two files:&lt;br /&gt;
* &amp;quot;data.zip&amp;quot;&lt;br /&gt;
* &amp;quot;update.pua&amp;quot;: This is the firmware update data for the Kart. This is a tar archive. The extracted archive contains &amp;quot;update.pui&amp;quot; and &amp;quot;pui.hash&amp;quot;. The latter is a binary 0x100-byte file. The former is another tar archive, the content of that archive is the following:&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: Contains config which includes fields for efuse_key, efuse_fw, secure_boot, etc. Also references the data under generic/. Seems to be configuration for firmware installation, not uboot.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;bluecore.audio.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;dtb_sha&amp;quot;: 0x20-byte binary SHA256 hash for the .dtb file.&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;tee_sha&amp;quot;: 0x20-byte binary SHA256 hash for the tee file.&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;: 0x20-byte binary SHA256 hash for the &amp;quot;nand.uImage.aes&amp;quot; file.&lt;br /&gt;
** &amp;quot;generic/&amp;quot;: This contains:&lt;br /&gt;
*** &amp;quot;android.nand.dtb&amp;quot;: Plaintext &amp;quot;kernelDT&amp;quot;.&lt;br /&gt;
*** &amp;quot;bluecore.audio.aes&amp;quot;: Encrypted &amp;quot;audioKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;nand.uImage.aes&amp;quot;: Encrypted &amp;quot;linuxKernel&amp;quot;.&lt;br /&gt;
*** &amp;quot;root.nand.cpio.gz_pad.img.aes&amp;quot;: Encrypted &amp;quot;InitrdRootFS&amp;quot;.&lt;br /&gt;
*** &amp;quot;tee.bin.aes&amp;quot;: Encrypted &amp;quot;tee&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the only firmware archive files accessed by the game are &amp;quot;update.pui&amp;quot;, &amp;quot;pui.hash&amp;quot;, and &amp;quot;config.txt&amp;quot;. The content of &amp;quot;config.txt&amp;quot; is only used with sscanf() to extract the version fields. &amp;quot;update.pui&amp;quot;/&amp;quot;pui.hash&amp;quot; are probably sent over the network connection to the kart - it&#039;s unknown whether the game does anything with the content of &amp;quot;pui.hash&amp;quot; other than this.&lt;br /&gt;
&lt;br /&gt;
= Kart =&lt;br /&gt;
The kart is internally referred to by the game as &amp;quot;RCD&amp;quot; and &amp;quot;Fuji&amp;quot;. Various strings in the kart OSS refer to it as &amp;quot;DHC&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
OSS is [https://www.nintendo.co.jp/support/oss/index.html available] for the kart itself.&lt;br /&gt;
&lt;br /&gt;
This uses Linux. The 1.1.0_3 archive contains the following: &lt;br /&gt;
  busybox-1.22.1.tar.bz2&lt;br /&gt;
  eudev-1.5.3.tar.gz&lt;br /&gt;
  kmod-17.tar.xz&lt;br /&gt;
  libnl-3.2.24.tar.gz&lt;br /&gt;
  linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz&lt;br /&gt;
  lrzsz-0.12.20.tar.gz&lt;br /&gt;
  PsdDriver_5a8d821.zip&lt;br /&gt;
  rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz&lt;br /&gt;
  uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz&lt;br /&gt;
  util-linux-2.24.2.tar.xz&lt;br /&gt;
&lt;br /&gt;
PsdDriver is Nintendo&#039;s custom kernel module, the GPL license header used in the source starts with the following:&lt;br /&gt;
  * Sensors and Motors driver&lt;br /&gt;
  * Copyright (C) 2020 Nintendo Co, Ltd&lt;br /&gt;
&lt;br /&gt;
The only changes in the OSS for 1.0.0_1 -&amp;gt; 1.1.0_3 are the following (note that there are more versions between these):&lt;br /&gt;
* The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.&lt;br /&gt;
* In the PsdDriver source, the line-ending at the start of various source files was updated.&lt;br /&gt;
** In sources/psd_util.c, &amp;lt;code&amp;gt;initialize_table();&amp;lt;/code&amp;gt; is now called by a dedicated &amp;lt;code&amp;gt;psd_util_init_crc8&amp;lt;/code&amp;gt; function instead of &amp;lt;code&amp;gt;psd_util_get_crc8&amp;lt;/code&amp;gt;, which is now called by &amp;lt;code&amp;gt;device_init&amp;lt;/code&amp;gt; in sources/psd.c.&lt;br /&gt;
&lt;br /&gt;
The above git-commit-hashes (?) from the filenames doesn&#039;t seem to match commits in the upstream repos.&lt;br /&gt;
&lt;br /&gt;
On October 28, 2020, the existing OSS archives were updated without adding a new version. With 1.1.0_3, the uboot archive (which has the same filename) had the &amp;quot;/examples&amp;quot; directory removed.&lt;br /&gt;
&lt;br /&gt;
== Pairing process ==&lt;br /&gt;
The kart communicates with the Switch via standard 802.11 frames on channel 1/6/11, with standard CCMP encryption, but the authentication and key exchange protocol is Nintendo-proprietary. See [[LDN services]] for more information.&lt;br /&gt;
&lt;br /&gt;
On first startup, &#039;&#039;Home Circuit&#039;&#039; generates a random SSID (beginning with &#039;G&#039;) and 0x20-byte PSK (for use in the aforementioned key exchange; it is not standard WPA). These are saved and reused on every subsequent startup, so that any kart(s) with this information stored can reconnect without needing to be paired again.&lt;br /&gt;
&lt;br /&gt;
When pairing, &#039;&#039;Home Circuit&#039;&#039; creates a temporary network (random SSID beginning with &#039;P&#039;, randomized PSK, neither stored) and shows the details for this &amp;quot;pairing network&amp;quot; in a QR code for the kart to scan. Once the kart connects, it fetches the main &amp;quot;game&amp;quot; network SSID+PSK and stores them, and both it and &#039;&#039;Home Circuit&#039;&#039; exit pairing mode. The pairing network is only active while the QR code is displayed, otherwise the main &amp;quot;game&amp;quot; network runs.&lt;br /&gt;
&lt;br /&gt;
The QR code is a &amp;quot;version 4&amp;quot; (33x33) code with level-M error correction. It uses byte encoding, and stores 0x3E bytes:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Pairing seed. LP2P PSK is SHA256(seed)&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x20 || Pairing SSID. Remaining space is filled with zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x2 || Pairing channel. Encoded little-endian. Usually 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x32 || 0xC || Padding bytes; zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Network protocols ==&lt;br /&gt;
Once the kart connects to the &amp;quot;game&amp;quot; network hosted by &#039;&#039;Home Circuit&#039;&#039;, it requests an IP address via DHCP, then connects to the Switch via standard TCP/IP to announce its presence. A series of TCP and UDP connections are established to exchange information, stream video, transmit control signals, monitor kart telemetry, etc.&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
This section documents the changes for game-updates.&lt;br /&gt;
&lt;br /&gt;
== v1.0.1 ==&lt;br /&gt;
This only updated the Kart firmware.&lt;br /&gt;
&lt;br /&gt;
ExeFs:&lt;br /&gt;
* Nothing changed besides the usual NPDM update.&lt;br /&gt;
&lt;br /&gt;
RomFs:&lt;br /&gt;
* Only update.pua was updated, the following was changed in the extracted update.pui (pui.hash in update.pua was also updated):&lt;br /&gt;
** &amp;quot;config.txt&amp;quot;: system_minor_version was changed from &amp;quot;3&amp;quot; to &amp;quot;4&amp;quot;.&lt;br /&gt;
** &amp;quot;audiofw_sha&amp;quot;&lt;br /&gt;
** &amp;quot;rootfs_sha&amp;quot;&lt;br /&gt;
** &amp;quot;uImage_sha&amp;quot;&lt;br /&gt;
** &amp;quot;generic/bluecore.audio.aes&amp;quot;: Starts differing at offset 0x1D0.&lt;br /&gt;
** &amp;quot;generic/nand.uImage.aes&amp;quot;: Starts differing at offset 0x0.&lt;br /&gt;
** &amp;quot;generic/root.nand.cpio.gz_pad.img.aes&amp;quot;: Starts differing at offset 0x0.&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10625</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10625"/>
		<updated>2021-01-29T19:29:55Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* lp2p */ Clarify that key A is used for CCMP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes an input u32, an u64 pid_reserved, a PID, returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes an input u64 pid_reserved, a PID, returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#RemoveAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]], a type-0x22 output buffer containing an array of [[#ScanResult]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 frequency, a s16 channel, an u32 flags, a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 flags, a type-0x22 output buffer, returns a [[#MacAddress_2|MacAddress]], an u16, a s16, an u32 out_size, a s32.&lt;br /&gt;
&lt;br /&gt;
The out_size is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]], no output.&lt;br /&gt;
&lt;br /&gt;
=== RemoveAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== Join ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input, returns an output 0x80-bytes [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== Leave ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID, a total of 0x10-bytes of input, and returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Wrapped master key. When zero, set to randomly-generated data. This is decrypted with a &amp;quot;static AES key&amp;quot; and used to derive the 4 encryption keys for the session.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation to derive keys B and D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdFuji.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used to derive encryption keys A and C. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
Key A derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two vendor-specific Nintendo information elements with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each IE has a 2-byte ID following the OUI. These Nintendo IEs are not used when standard WPA2-PSK is being used.&lt;br /&gt;
&lt;br /&gt;
The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: Traffic Indication Map (TIM)&amp;quot;: &amp;quot;DTIM count&amp;quot; for lp2p is 1, with ldn it&#039;s 0.&lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo IEs in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 0 ====&lt;br /&gt;
&lt;br /&gt;
The first Nintendo IE (ID 0x0600) contains the following fixed parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Fixed 0x20; perhaps a version or other magic number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || [[#GroupInfo|SecurityType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || [[#GroupInfo|StaticAesKeyIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Fixed zero; padding byte.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian (i.e. byte-reversed) version of [[#GroupInfo|LocalCommunicationId]]. This is the only context where LocalCommunicationId is reversed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Wrapped master key. Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 0x4 || If encryption is enabled, a randomly-generated nonce, else nothing. Appending 8 zero bytes to this yields the AES-GCM IV.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || If encryption is enabled, the AES-GCM MAC tag, else nothing. All bytes prior to this (fixed 0x20 through nonce) are the additional authenticated data. All bytes after this are encrypted with key B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After this, TLV tagged parameters occur. Each TLV tag is formatted as:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Tag type&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Length&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Data for the tag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Additional network parameters: 0xAB 0xCD. A=[[#GroupInfo]]+0x82, B=[[#GroupInfo|MemberCountMax]], C=[[#GroupInfo|NetworkMode]], D=[[#GroupInfo|PerformanceRequirement]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8 || Flags: Bitwise-or of (1&amp;lt;&amp;lt;f) for each entry in [[#GroupInfo]]+0x40&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 1 ====&lt;br /&gt;
&lt;br /&gt;
The second Nintendo IE (ID 0x0601) contains only TLVs. If encryption is enabled, a 0x4-byte nonce and 0x10-byte AES-GCM tag are written first, as above, and the TLVs are encrypted. Key C is used.&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Varies || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10624</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10624"/>
		<updated>2021-01-29T19:27:23Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* GroupInfo */ GroupInfo+0x0 is some kind of wrapped &amp;quot;master&amp;quot; key - maybe a word other than &amp;quot;master&amp;quot; is good for this?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes an input u32, an u64 pid_reserved, a PID, returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes an input u64 pid_reserved, a PID, returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#RemoveAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]], a type-0x22 output buffer containing an array of [[#ScanResult]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 frequency, a s16 channel, an u32 flags, a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 flags, a type-0x22 output buffer, returns a [[#MacAddress_2|MacAddress]], an u16, a s16, an u32 out_size, a s32.&lt;br /&gt;
&lt;br /&gt;
The out_size is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]], no output.&lt;br /&gt;
&lt;br /&gt;
=== RemoveAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== Join ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input, returns an output 0x80-bytes [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== Leave ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID, a total of 0x10-bytes of input, and returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Wrapped master key. When zero, set to randomly-generated data. This is decrypted with a &amp;quot;static AES key&amp;quot; and used to derive the 4 encryption keys for the session.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation to derive keys B and D.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdFuji.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used to derive encryption keys A and C. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
The key derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two vendor-specific Nintendo information elements with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each IE has a 2-byte ID following the OUI. These Nintendo IEs are not used when standard WPA2-PSK is being used.&lt;br /&gt;
&lt;br /&gt;
The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: Traffic Indication Map (TIM)&amp;quot;: &amp;quot;DTIM count&amp;quot; for lp2p is 1, with ldn it&#039;s 0.&lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo IEs in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 0 ====&lt;br /&gt;
&lt;br /&gt;
The first Nintendo IE (ID 0x0600) contains the following fixed parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Fixed 0x20; perhaps a version or other magic number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || [[#GroupInfo|SecurityType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || [[#GroupInfo|StaticAesKeyIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Fixed zero; padding byte.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian (i.e. byte-reversed) version of [[#GroupInfo|LocalCommunicationId]]. This is the only context where LocalCommunicationId is reversed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Wrapped master key. Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 0x4 || If encryption is enabled, a randomly-generated nonce, else nothing. Appending 8 zero bytes to this yields the AES-GCM IV.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || If encryption is enabled, the AES-GCM MAC tag, else nothing. All bytes prior to this (fixed 0x20 through nonce) are the additional authenticated data. All bytes after this are encrypted with key B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After this, TLV tagged parameters occur. Each TLV tag is formatted as:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Tag type&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Length&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Data for the tag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Additional network parameters: 0xAB 0xCD. A=[[#GroupInfo]]+0x82, B=[[#GroupInfo|MemberCountMax]], C=[[#GroupInfo|NetworkMode]], D=[[#GroupInfo|PerformanceRequirement]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8 || Flags: Bitwise-or of (1&amp;lt;&amp;lt;f) for each entry in [[#GroupInfo]]+0x40&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 1 ====&lt;br /&gt;
&lt;br /&gt;
The second Nintendo IE (ID 0x0601) contains only TLVs. If encryption is enabled, a 0x4-byte nonce and 0x10-byte AES-GCM tag are written first, as above, and the TLVs are encrypted. Key C is used.&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Varies || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10623</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10623"/>
		<updated>2021-01-29T19:22:28Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Beacon */ Fully document the Nintendo IEs. Note: the Action frame is the same, except its encrypted section has app-provided data rather than TLVs -- if anyone wants to edit that in. :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes an input u32, an u64 pid_reserved, a PID, returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes an input u64 pid_reserved, a PID, returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#RemoveAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]], a type-0x22 output buffer containing an array of [[#ScanResult]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 frequency, a s16 channel, an u32 flags, a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 flags, a type-0x22 output buffer, returns a [[#MacAddress_2|MacAddress]], an u16, a s16, an u32 out_size, a s32.&lt;br /&gt;
&lt;br /&gt;
The out_size is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]], no output.&lt;br /&gt;
&lt;br /&gt;
=== RemoveAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== Join ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input, returns an output 0x80-bytes [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== Leave ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID, a total of 0x10-bytes of input, and returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || When zero, this is set to randomly-generated data. Used during key derivation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdFuji.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used during key derivation. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
The key derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two vendor-specific Nintendo information elements with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each IE has a 2-byte ID following the OUI. These Nintendo IEs are not used when standard WPA2-PSK is being used.&lt;br /&gt;
&lt;br /&gt;
The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: Traffic Indication Map (TIM)&amp;quot;: &amp;quot;DTIM count&amp;quot; for lp2p is 1, with ldn it&#039;s 0.&lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo IEs in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 0 ====&lt;br /&gt;
&lt;br /&gt;
The first Nintendo IE (ID 0x0600) contains the following fixed parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Fixed 0x20; perhaps a version or other magic number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || [[#GroupInfo|SecurityType]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || [[#GroupInfo|StaticAesKeyIndex]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || Fixed zero; padding byte.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian (i.e. byte-reversed) version of [[#GroupInfo|LocalCommunicationId]]. This is the only context where LocalCommunicationId is reversed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Wrapped master key. Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || 0x4 || If encryption is enabled, a randomly-generated nonce, else nothing. Appending 8 zero bytes to this yields the AES-GCM IV.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || If encryption is enabled, the AES-GCM MAC tag, else nothing. All bytes prior to this (fixed 0x20 through nonce) are the additional authenticated data. All bytes after this are encrypted with key B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After this, TLV tagged parameters occur. Each TLV tag is formatted as:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Tag type&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Length&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Data for the tag&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x2 || Additional network parameters: 0xAB 0xCD. A=[[#GroupInfo]]+0x82, B=[[#GroupInfo|MemberCountMax]], C=[[#GroupInfo|NetworkMode]], D=[[#GroupInfo|PerformanceRequirement]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x8 || Flags: Bitwise-or of (1&amp;lt;&amp;lt;f) for each entry in [[#GroupInfo]]+0x40&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Nintendo IE 1 ====&lt;br /&gt;
&lt;br /&gt;
The second Nintendo IE (ID 0x0601) contains only TLVs. If encryption is enabled, a 0x4-byte nonce and 0x10-byte AES-GCM tag are written first, as above, and the TLVs are encrypted. Key C is used.&lt;br /&gt;
&lt;br /&gt;
Known TLV tags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || Varies || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10622</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10622"/>
		<updated>2021-01-29T19:01:49Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Beacon */ 802.11-ify some of the language (&amp;quot;tag&amp;quot; -&amp;gt; &amp;quot;information element&amp;quot;)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes an input u32, an u64 pid_reserved, a PID, returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes an input u64 pid_reserved, a PID, returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#RemoveAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]], a type-0x22 output buffer containing an array of [[#ScanResult]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 frequency, a s16 channel, an u32 flags, a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 flags, a type-0x22 output buffer, returns a [[#MacAddress_2|MacAddress]], an u16, a s16, an u32 out_size, a s32.&lt;br /&gt;
&lt;br /&gt;
The out_size is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]], no output.&lt;br /&gt;
&lt;br /&gt;
=== RemoveAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== Join ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input, returns an output 0x80-bytes [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== Leave ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID, a total of 0x10-bytes of input, and returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || When zero, this is set to randomly-generated data. Used during key derivation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdFuji.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used during key derivation. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
The key derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two vendor-specific Nintendo information elements with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each IE has a 2-byte ID following the OUI. These Nintendo IEs are not used when standard WPA2-PSK is being used.&lt;br /&gt;
&lt;br /&gt;
The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: Traffic Indication Map (TIM)&amp;quot;: &amp;quot;DTIM count&amp;quot; for lp2p is 1, with ldn it&#039;s 0.&lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo IEs in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
The first Nintendo IE (ID 0x0600) contains the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 01 00 or 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || || Start of encrypted (and crypto-related) data if enabled. 0x22-bytes when encrypted, 0xE-bytes when plaintext.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second Nintendo IE (ID 0x0601) contains the following data (data is encrypted if enabled, there&#039;s also an additional 0x14-bytes when encrypted):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Plaintext: usually 21?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Plaintext: AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Plaintext: AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10621</id>
		<title>LDN services</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=LDN_services&amp;diff=10621"/>
		<updated>2021-01-29T18:59:49Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Beacon */ Restructure the &amp;quot;Nintendo tag&amp;quot; tables to make the ID explicit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LDN handles all local network communication.&lt;br /&gt;
&lt;br /&gt;
= ldn:m =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IMonitorServiceCreator object immediately after using this cmd.&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetStateForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfoForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4AddressForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReasonForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameterForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfigForMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#InitializeMonitor]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#FinalizeMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetStateForMonitor ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoForMonitor ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4AddressForMonitor ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReasonForMonitor ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameterForMonitor ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfigForMonitor ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
This is not exposed by sdknso.&lt;br /&gt;
&lt;br /&gt;
=== InitializeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeMonitor ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This just returns 0.&lt;br /&gt;
&lt;br /&gt;
= ldn:s =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateSystemLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateSystemLocalCommunicationService ==&lt;br /&gt;
Returns an [[#ISystemLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the ISystemServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== ISystemLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::ISystemLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#InitializeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#FinalizeSystem]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [4.0.0+] [[#SetOperationMode]]&lt;br /&gt;
|-&lt;br /&gt;
| 403 || [7.0.0+] [[#InitializeSystem2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetState ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the u32, with 0 being returned on error / when service isn&#039;t initialized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Initialized&lt;br /&gt;
|-&lt;br /&gt;
| 2 || AccessPointOpened&lt;br /&gt;
|-&lt;br /&gt;
| 3 || AccessPointCreated&lt;br /&gt;
|-&lt;br /&gt;
| 4 || StationOpened&lt;br /&gt;
|-&lt;br /&gt;
| 5 || StationConnected&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Error&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfo ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
=== GetIpv4Address ===&lt;br /&gt;
No input, returns an output [[#Ipv4Address]] and a [[#SubnetMask]].&lt;br /&gt;
&lt;br /&gt;
=== GetDisconnectReason ===&lt;br /&gt;
No input, returns an output s16.&lt;br /&gt;
&lt;br /&gt;
sdknso implements this by &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt;ing the s16 as a s32, with -1 being returned on error.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| -1 || See above.&lt;br /&gt;
|-&lt;br /&gt;
| 0 || None&lt;br /&gt;
|-&lt;br /&gt;
| 1 || User&lt;br /&gt;
|-&lt;br /&gt;
| 2 || SystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 3 || DestroyedByAdmin&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DestroyedBySystemRequest&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Admin&lt;br /&gt;
|-&lt;br /&gt;
| 6 || SignalLost&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== GetSecurityParameter ===&lt;br /&gt;
No input, returns an output [[#SecurityParameter]].&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkConfig ===&lt;br /&gt;
No input, returns an output [[#NetworkConfig]].&lt;br /&gt;
&lt;br /&gt;
=== AttachStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle.&lt;br /&gt;
&lt;br /&gt;
sdknso uses EventClearMode=1 with this. sdknso will Abort if this cmd fails.&lt;br /&gt;
&lt;br /&gt;
This is signaled when the data returned by [[#GetNetworkInfo]]/[[#GetNetworkInfoLatestUpdate]] is updated.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInfoLatestUpdate ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a [[#NetworkInfo]] and a type-0xA output buffer containing an array of [[#NodeLatestUpdate]].&lt;br /&gt;
&lt;br /&gt;
The array count must be 8.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32 (user-apps generally use value 0 for this).&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#ScanPrivate]], except this also has the same channel-override functionality as [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3-5.&lt;br /&gt;
&lt;br /&gt;
The array count must be at least 1. This is clamped to a maximum of 0x18.&lt;br /&gt;
&lt;br /&gt;
=== ScanPrivate ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NetworkInfo]], a s16 channel, a [[#ScanFilter]], returns an output s16 total_out.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the output s16 to a s32, the value passed for the input s16 is from an user-specified s32.&lt;br /&gt;
&lt;br /&gt;
See [[#Scan]].&lt;br /&gt;
&lt;br /&gt;
=== SetWirelessControllerRestriction ===&lt;br /&gt;
Takes an input [[#WirelessControllerRestriction]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== OpenAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== CloseAccessPoint ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetwork ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], an [[#UserConfig]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
This is the same as [[#CreateNetworkPrivate]], except the [[#AddressEntry]] params are 0, and the [[#SecurityParameter]] is generated from &amp;quot;nn::util::TinyMt::GenerateRandomBytes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Unlike CreateNetworkPrivate, this overwrites the channel field in the [[#NetworkConfig]]. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is true, the output from [[Settings_services|GetLdnChannel]] will overwrite that field if the s32 setting value is &amp;gt;=0, otherwise the original value is used. Otherwise when the IsDevelopment field is false (retail), the channel is overwritten with value 0.&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2, this cmd eventually sets the State to value 3.&lt;br /&gt;
&lt;br /&gt;
=== CreateNetworkPrivate ===&lt;br /&gt;
Takes an input [[#SecurityConfig]], a [[#SecurityParameter]], an [[#UserConfig]], a [[#NetworkConfig]], a type-0x9 input buffer containing an array of [[#AddressEntry]], no output.&lt;br /&gt;
&lt;br /&gt;
The buffer/count for [[#AddressEntry]] can be 0, in which case the network will be non-Private like [[#CreateNetwork]]. The count must be &amp;lt;=8.&lt;br /&gt;
&lt;br /&gt;
See [[#CreateNetwork]].&lt;br /&gt;
&lt;br /&gt;
=== DestroyNetwork ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3, this cmd eventually sets the State to value 2.&lt;br /&gt;
&lt;br /&gt;
=== Reject ===&lt;br /&gt;
Takes an input [[#Ipv4Address]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 3.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The input buffer contains arbitrary user data.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x180. An empty buffer (addr=NULL/size=0) can be used to reset the AdvertiseData size in state to zero.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== SetStationAcceptPolicy ===&lt;br /&gt;
Takes an input [[#AcceptPolicy]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptFilterEntry ===&lt;br /&gt;
Takes an input [[#MacAddress|MacAddress]], no output.&lt;br /&gt;
&lt;br /&gt;
There are two sdknso funcs implementing this: one which takes a [[#MacAddress|MacAddress]] directly, the other loads the [[#MacAddress|MacAddress]] from the input [[#NodeInfo|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== ClearAcceptFilter ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 2-3.&lt;br /&gt;
&lt;br /&gt;
=== OpenStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== CloseStation ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4-5, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
=== Connect ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#NetworkInfo]], a [[#SecurityConfig]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 4, this cmd eventually sets the State to value 5.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ConnectPrivate]] (besides the below), except the data internally passed for [[#SecurityParameter]]/[[#NetworkConfig]] are loaded from the input [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the used value is: original_field == 0 ? {u16 [[#NetworkInfo]]+0x60} : original_field.&lt;br /&gt;
&lt;br /&gt;
u32 LocalCommunicationVersion&amp;gt;&amp;gt;15 must be 0.&lt;br /&gt;
&lt;br /&gt;
=== ConnectPrivate ===&lt;br /&gt;
Takes a [[#SecurityConfig]], [[#SecurityParameter]], an [[#UserConfig]], a s32 LocalCommunicationVersion, a [[#ConnectOption]], a [[#NetworkConfig]], no output.&lt;br /&gt;
&lt;br /&gt;
See [[#Connect]].&lt;br /&gt;
&lt;br /&gt;
This overwrites the u16 field at [[#SecurityConfig]]+0. When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), value 1 is used, otherwise the original value is used.&lt;br /&gt;
&lt;br /&gt;
=== Disconnect ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 5, this cmd eventually sets the State to value 4.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#InitializeSystem2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
=== FinalizeSystem ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
If State is set for it, this will run the equivalent of [[#CloseAccessPoint]]/[[#CloseStation]] when needed.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be non-zero, this cmd eventually sets the State to value 0.&lt;br /&gt;
&lt;br /&gt;
=== SetOperationMode ===&lt;br /&gt;
Takes an input [[#OperationMode]], no output.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 1.&lt;br /&gt;
&lt;br /&gt;
The input value is written into state.&lt;br /&gt;
&lt;br /&gt;
=== InitializeSystem2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#InitializeSystem]].&lt;br /&gt;
&lt;br /&gt;
Internally this calls a func with params: (..., PID, &amp;amp;{u16 value 0x38}). On success, this then calls another func (which sets two state fields to the input) with params: (state, 0) (these state fields are used during [[#Authentication]] to check which service is being used).&lt;br /&gt;
&lt;br /&gt;
The first func uses various [[Network_Interface_services|nifm]] funcs. The input value is used to determine the value for [[Network_Interface_services#CreateRequest|nn::nifm::RequestParameters]]: essentially, value 0x4 is used for ldn:u, and value 0x8 is used for ldn:s. The input value is also copied into state.&lt;br /&gt;
&lt;br /&gt;
[[#GetState|State]] must be 0, this cmd eventually sets the State to value 1.&lt;br /&gt;
&lt;br /&gt;
= ldn:u =&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateUserLocalCommunicationService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateUserLocalCommunicationService==&lt;br /&gt;
Returns an [[#IUserLocalCommunicationService]].&lt;br /&gt;
&lt;br /&gt;
The user-process closes the IUserServiceCreator object immediately after using this cmd. Official sw ignores errors from this cmd.&lt;br /&gt;
&lt;br /&gt;
== IUserLocalCommunicationService ==&lt;br /&gt;
This is &amp;quot;nn::ldn::detail::IUserLocalCommunicationService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#ISystemLocalCommunicationService]], except for the System-only cmd(s), and [[#Initialize]]/[[#Initialize2]] differ.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#GetState]]&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [[#GetNetworkInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[#GetIpv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [[#GetDisconnectReason]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [[#GetSecurityParameter]]&lt;br /&gt;
|-&lt;br /&gt;
| 5 || [[#GetNetworkConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 100 || [[#AttachStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 101 || [[#GetNetworkInfoLatestUpdate]]&lt;br /&gt;
|-&lt;br /&gt;
| 102 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 103 || [[#ScanPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]]&lt;br /&gt;
|-&lt;br /&gt;
| 200 || [[#OpenAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 201 || [[#CloseAccessPoint]]&lt;br /&gt;
|-&lt;br /&gt;
| 202 || [[#CreateNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 203 || [[#CreateNetworkPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 204 || [[#DestroyNetwork]]&lt;br /&gt;
|-&lt;br /&gt;
| 205 || [[#Reject]]&lt;br /&gt;
|-&lt;br /&gt;
| 206 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 207 || [[#SetStationAcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 208 || [[#AddAcceptFilterEntry]]&lt;br /&gt;
|-&lt;br /&gt;
| 209 || [[#ClearAcceptFilter]]&lt;br /&gt;
|-&lt;br /&gt;
| 300 || [[#OpenStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 301 || [[#CloseStation]]&lt;br /&gt;
|-&lt;br /&gt;
| 302 || [[#Connect]]&lt;br /&gt;
|-&lt;br /&gt;
| 303 || [[#ConnectPrivate]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#Disconnect]]&lt;br /&gt;
|-&lt;br /&gt;
| 400 || [[#Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 401 || [[#Finalize]]&lt;br /&gt;
|-&lt;br /&gt;
| 402 || [7.0.0+] [[#Initialize2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Takes an input PID and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
This is used immediately after object creation.&lt;br /&gt;
&lt;br /&gt;
With [7.0.0+] [[#Initialize2]] is used instead.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem]] except different params are used for the funcs called internally.&lt;br /&gt;
&lt;br /&gt;
=== Finalize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This is used during service exit, prior to closing the object. Official sw will Abort if this fails.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#FinalizeSystem]].&lt;br /&gt;
&lt;br /&gt;
=== Initialize2 ===&lt;br /&gt;
Takes an input PID, an u32, and an u64 pid_placeholder.&lt;br /&gt;
&lt;br /&gt;
Official sw uses hard-coded value 0x1 for the u32.&lt;br /&gt;
&lt;br /&gt;
The input u32 is ignored, the impl for this cmd is identical to [[#Initialize]].&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#InitializeSystem2]] except different params are used for the funcs called internally: the u16 value is 0x5A, and the value for the second func is 1.&lt;br /&gt;
&lt;br /&gt;
= ndd =&lt;br /&gt;
This is &amp;quot;nn::ndd::IService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [5.0.0] and removed with [6.0.0].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || EnableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 1 || DisableAutoCommunication&lt;br /&gt;
|-&lt;br /&gt;
| 2 || IsAutoCommunicationEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 3 || EnablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DisablePowerSave&lt;br /&gt;
|-&lt;br /&gt;
| 5 || IsPowerSaveEnabled&lt;br /&gt;
|-&lt;br /&gt;
| 6 || IsNetworkActive&lt;br /&gt;
|-&lt;br /&gt;
| 7 || AcquireSendDataUpdateEvent&lt;br /&gt;
|-&lt;br /&gt;
| 8 || AddSendData&lt;br /&gt;
|-&lt;br /&gt;
| 9 || ClearSendData&lt;br /&gt;
|-&lt;br /&gt;
| 10 || GetSendData&lt;br /&gt;
|-&lt;br /&gt;
| 11 || AcquireReceiveDataEvent&lt;br /&gt;
|-&lt;br /&gt;
| 12 || GetCurrentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 13 || GetOldestReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 14 || GetNextReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 15 || GetAvailableReceiveDataCount&lt;br /&gt;
|-&lt;br /&gt;
| 16 || GetRecentReceiveDataCounter&lt;br /&gt;
|-&lt;br /&gt;
| 17 || GetReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 18 || AddReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 19 || ClearReceiveData&lt;br /&gt;
|-&lt;br /&gt;
| 20 || ClearDataIdFilter&lt;br /&gt;
|-&lt;br /&gt;
| 21 || AcquireDeviceScanEvent&lt;br /&gt;
|-&lt;br /&gt;
| 22 || StartDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 23 || CancelDeviceScan&lt;br /&gt;
|-&lt;br /&gt;
| 24 || GetDeviceScanResult&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= lp2p:app, lp2p:sys =&lt;br /&gt;
These are &amp;quot;nn::lp2p::detail::INetworkServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These were added with [9.0.0+].&lt;br /&gt;
&lt;br /&gt;
lp2p:app is used by [[Mario Kart Live: Home Circuit]]. lp2p:sys is used by [[Album_Applet|LibraryAppletPhotoViewer]] with [11.0.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateNetworkService]]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || [[#CreateNetworkServiceMonitor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkService ==&lt;br /&gt;
Takes an input u32, an u64 pid_reserved, a PID, returns an output [[#INetworkService]].&lt;br /&gt;
&lt;br /&gt;
The input u32 must be value 0x1.&lt;br /&gt;
&lt;br /&gt;
== CreateNetworkServiceMonitor ==&lt;br /&gt;
Takes an input u64 pid_reserved, a PID, returns an output [[#INetworkServiceMonitor]].&lt;br /&gt;
&lt;br /&gt;
== INetworkService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| [9.0.0-9.0.1] 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 512 || [[#Scan]]&lt;br /&gt;
|-&lt;br /&gt;
| 768 || [[#CreateGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 776 || [[#DestroyGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 784 || [[#SetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 1536 || [[#SendToOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1544 || [[#RecvFromOtherGroup]]&lt;br /&gt;
|-&lt;br /&gt;
| 1552 || [[#AddAcceptableGroupId]]&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || [9.1.0+] [[#RemoveAcceptableGroupId]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== Scan ===&lt;br /&gt;
Takes a type-0x19 input buffer containing a [[#GroupInfo]], a type-0x22 output buffer containing an array of [[#ScanResult]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
=== CreateGroup ===&lt;br /&gt;
Takes a type-0x31 input buffer containing a [[#GroupInfo]], no output.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] uses the following string with this: &amp;quot;Failed to create a group: %08X&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be 0. This eventually sets the [[#GetRole|role]] to value 1.&lt;br /&gt;
&lt;br /&gt;
=== DestroyGroup ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
This destroys the previously [[#CreateGroup|created]] group. If no group was previously created ([[#GetRole|role]] is not 1), this just returns 0.&lt;br /&gt;
&lt;br /&gt;
=== SetAdvertiseData ===&lt;br /&gt;
Takes a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x80. The [[#GetRole|role]] must be &amp;lt;=1.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;scan advertise data&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== SendToOtherGroup ===&lt;br /&gt;
Takes an input [[#MacAddress_2|MacAddress]], a [[#GroupId]], a s16 frequency, a s16 channel, an u32 flags, a type-0x21 input buffer, no output.&lt;br /&gt;
&lt;br /&gt;
The buffer size must be &amp;lt;=0x400.&lt;br /&gt;
&lt;br /&gt;
The MacAddress must be non-zero. The s16s must be &amp;gt;=1.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until the data can be sent, set = return error when the data can&#039;t be sent.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the buffer data as &amp;quot;Action frame&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero. The error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
[11.0.0+] [[#GroupInfo]]+0x8A must be value 2, otherwise an error is returned.&lt;br /&gt;
&lt;br /&gt;
This sends an Action frame to the specified [[#GroupId]], with the specified destination [[#MacAddress_2|MacAddress]] (can be a broadcast address).&lt;br /&gt;
&lt;br /&gt;
The frequency param is the same as the [[#GroupInfo]]+0x84 field.&lt;br /&gt;
&lt;br /&gt;
=== RecvFromOtherGroup ===&lt;br /&gt;
Takes an input u32 flags, a type-0x22 output buffer, returns a [[#MacAddress_2|MacAddress]], an u16, a s16, an u32 out_size, a s32.&lt;br /&gt;
&lt;br /&gt;
The out_size is the original size used for copying to the output buffer, before it&#039;s clamped to the output-buffer size.&lt;br /&gt;
&lt;br /&gt;
Only bit0 is used from flags: clear = block until data is available, set = return error when data is not available.&lt;br /&gt;
&lt;br /&gt;
When data is not available, the error from [[#GetNetworkInterfaceLastError]] will be returned if it&#039;s set.&lt;br /&gt;
&lt;br /&gt;
The [[#GetRole|role]] must be non-zero.&lt;br /&gt;
&lt;br /&gt;
This receives an Action frame.&lt;br /&gt;
&lt;br /&gt;
=== AddAcceptableGroupId ===&lt;br /&gt;
Takes an input [[#GroupId]], no output.&lt;br /&gt;
&lt;br /&gt;
=== RemoveAcceptableGroupId ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
== INetworkServiceMonitor ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::INetworkServiceMonitor&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This interface has no commands, until [9.1.0+] which added actual commands.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_2|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 256 || [[#AttachNetworkInterfaceStateChangeEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 264 || [[#GetNetworkInterfaceLastError]]&lt;br /&gt;
|-&lt;br /&gt;
| 272 || [[#GetRole]]&lt;br /&gt;
|-&lt;br /&gt;
| 280 || [[#GetAdvertiseData]]&lt;br /&gt;
|-&lt;br /&gt;
| 281 || [[#GetAdvertiseData2]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 296 || [[#Join]]&lt;br /&gt;
|-&lt;br /&gt;
| 304 || [[#GetGroupOwner]]&lt;br /&gt;
|-&lt;br /&gt;
| 312 || [[#GetIpConfig]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|-&lt;br /&gt;
| 328 || [[#AttachJoinEvent]]&lt;br /&gt;
|-&lt;br /&gt;
| 336 || [[#GetMembers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
Unused by official sw.&lt;br /&gt;
&lt;br /&gt;
=== AttachNetworkInterfaceStateChangeEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetNetworkInterfaceLastError ===&lt;br /&gt;
No input/output.&lt;br /&gt;
&lt;br /&gt;
=== GetRole ===&lt;br /&gt;
No input, returns an output u8.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 2, then copies data from state into the output buffer. The first output u16 is the size used for the memcpy, the second u16 is the original size from state.&lt;br /&gt;
&lt;br /&gt;
=== GetAdvertiseData2 ===&lt;br /&gt;
Takes a type-0x22 output buffer, returns 2 output u16s.&lt;br /&gt;
&lt;br /&gt;
This is identical to [[#GetAdvertiseData]] except this doesn&#039;t run the role validation.&lt;br /&gt;
&lt;br /&gt;
=== GetGroupInfo ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
=== Join ===&lt;br /&gt;
Takes a type-0x32 output buffer containing a [[#GroupInfo]] and a type-0x31 input buffer containing a [[#GroupInfo]].&lt;br /&gt;
&lt;br /&gt;
This runs the same code as [[#CreateGroup]] to generate the [[#GroupInfo]] for the input struct (which with [[#CreateGroup]] would be available with [[#GetGroupInfo]]). The input struct is the same as [[#CreateGroup]].&lt;br /&gt;
&lt;br /&gt;
=== GetGroupOwner ===&lt;br /&gt;
No input, returns an output 0x80-bytes [[#NodeInfo_2|NodeInfo]].&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the data from state to output.&lt;br /&gt;
&lt;br /&gt;
=== GetIpConfig ===&lt;br /&gt;
Takes a type-0x1A output buffer containing a 0x100-byte struct.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is non-zero, then copies the struct from state into the output buffer.&lt;br /&gt;
&lt;br /&gt;
+0x20 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; IP address, +0x40 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; subnet-mask, +0x60 is the &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; gateway(?). The address for the last one is set to localhost.&lt;br /&gt;
&lt;br /&gt;
=== Leave ===&lt;br /&gt;
No input, returns an output u32.&lt;br /&gt;
&lt;br /&gt;
=== AttachJoinEvent ===&lt;br /&gt;
No input, returns an output Event handle with EventClearMode=0.&lt;br /&gt;
&lt;br /&gt;
=== GetMembers ===&lt;br /&gt;
Takes a type-0x22 output buffer containing an array of [[#NodeInfo_2|NodeInfo]], returns an output s32 total_out.&lt;br /&gt;
&lt;br /&gt;
Validates that the [[#GetRole|role]] is value 1. Then any entries from state which are available are copied into the output array buffer, if there&#039;s space available. A maximum of 8 entries can be returned.&lt;br /&gt;
&lt;br /&gt;
A string in [[Mario Kart Live: Home Circuit|mklive]] refers to the array data as &amp;quot;connected members&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= lp2p:m =&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorServiceCreator&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This was added with [9.1.0+].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#CreateMonitorService]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CreateMonitorService ==&lt;br /&gt;
Takes a PID, a total of 0x10-bytes of input, and returns an [[#IMonitorService]].&lt;br /&gt;
&lt;br /&gt;
== IMonitorService ==&lt;br /&gt;
This is &amp;quot;nn::lp2p::detail::IMonitorService&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Cmd || Name&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[#Initialize_3|Initialize]]&lt;br /&gt;
|-&lt;br /&gt;
| 288 || [[#GetGroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 320 || [[#Leave]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Initialize ===&lt;br /&gt;
Returns 0.&lt;br /&gt;
&lt;br /&gt;
= Ipv4Address =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ipv4Address&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
This is generally &amp;quot;169.254.XXX.{...}&amp;quot;, where XXX is random per created network.&lt;br /&gt;
&lt;br /&gt;
= SubnetMask =&lt;br /&gt;
This is &amp;quot;nn::ldn::SubnetMask&amp;quot;. This is a 0x4-byte struct with 4-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is essentially the same as &amp;lt;code&amp;gt;struct in_addr&amp;lt;/code&amp;gt;, except this is little-endian.&lt;br /&gt;
&lt;br /&gt;
= Ssid =&lt;br /&gt;
This is &amp;quot;nn::ldn::Ssid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When converting a Ssid to a string, the loaded chars from the string must be in the range of 0x20-0x7F, otherwise the byte written to the string will be 0.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkInfo&amp;quot;. This is a 0x480-byte struct. The data at +0x50 is another struct.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved (besides the fields before +0x10) are cleared during the memset and are not written to again afterwards, with cmds which return NetworkInfo.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Arbitrary user data which can be used for filtering with [[#ScanFilter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || Last 0x10-bytes of [[#SecurityParameter]]. NetworkId which is used to generate/overwrite the [[#Ssid]]. With [[#Scan]]/[[#ScanPrivate]], this is only done after filtering when +0x4B is value 0x2. The converted Ssid is a 0x20-byte lowercase hex string version of the input NetworkId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x26 || 0x22 || [[#Ssid]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x2 || s16 NetworkChannel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A || 0x1 || s8 LinkLevel&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B || 0x1 || Set to hard-coded value 0x2 with output structs, except with [[#Scan]]/[[#ScanPrivate]] which can also set value 0x1 in certain cases. 0x1 = normal network without an [[#ActionFrame]], 0x2 = LDN network with a valid [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x50 || 0x10 || First 0x10-bytes of [[#SecurityParameter]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x60 || 0x2 || Same as [[#SecurityConfig]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x62 || 0x1 || [[#AcceptPolicy]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x63 || 0x1 || Only set with [[#Scan]]/[[#ScanPrivate]], when +0x4B is value 0x2. See [[#ActionFrame]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x64 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x66 || 0x1 || Maximum participants, for the [[#NodeInfo|NodeInfo]] array.&lt;br /&gt;
|-&lt;br /&gt;
| 0x67 || 0x1 || ParticipantNum, number of set entries in the [[#NodeInfo|NodeInfo]] array. If +0x4B is not 0x2, ParticipantNum should be handled as if it&#039;s 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x200(0x40*8) || Array of [[#NodeInfo|NodeInfo]] with 8 entries, starting with the AccessPoint node.&lt;br /&gt;
|-&lt;br /&gt;
| 0x268 || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A || 0x2 || AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C || 0x180 || AdvertiseData&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC || 0x8C || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x478 || 0x8 || [6.0.0+] Random AuthenticationId. Set to the output from [[ETicket_services|es]] cmd1501 during network creation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ScanFilter =&lt;br /&gt;
This is &amp;quot;nn::ldn::ScanFilter&amp;quot;. This is a 0x60-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input ScanFilter to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || When enabled, this will be overwritten if it&#039;s -1. The data written for this is the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter field must match [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Padding&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || During filtering if enabled, u8 [[#NetworkInfo]]+0x4B must match 0x2, and this ScanFilter data must match [[#NetworkInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x4 || When enabled, must be &amp;lt;=0x3, and during filtering must match u8 [[#NetworkInfo]]+0x4B.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress|MacAddress]]. Only copied with [[#ScanPrivate]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A || 0x22 || [[#Ssid]]. During filtering if enabled, this must match [[#NetworkInfo]]+0x26 (the [[#Ssid]] there must be valid for this as well). The strings are compared, without verifying the length field in [[#Ssid]] matches.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C || 0x10 || Cleared to zero for the tmp struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5C || 0x4 || Flags. Masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Bit&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || When set, enables using ScanFilter+0.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || When set, enables using ScanFilter+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || When set, enables using ScanFilter+0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || When set, enables using the ScanFilter [[#MacAddress|MacAddress]].&lt;br /&gt;
|-&lt;br /&gt;
| 4 || When set, enables using the ScanFilter [[#Ssid]].&lt;br /&gt;
|-&lt;br /&gt;
| 5 || When set, enables using ScanFilter+0xA.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NetworkConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::NetworkConfig&amp;quot;. This is a 0x20-byte struct with 8-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input NetworkConfig to a tmp struct on stack, which is then used with the cmd ([[#CreateNetwork]], [[#CreateNetworkPrivate]], [[#ConnectPrivate]]).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x8 || LocalCommunicationId. Same as [[#NetworkInfo]]+0x0. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]/[[#Connect]]/[[#ConnectPrivate]]: When -1, this is overwritten with the first [[NACP_Format|LocalCommunicationId]] for the user-process loaded via [[Glue_services|arp:r]], if loading fails value 0 is written instead. Otherwise when not -1, if control.nacp loading is successful with [[Glue_services|arp:r]], this field must match one of the LocalCommunicationIds from there otherwise an error is thrown.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x2 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Same as [[#NetworkInfo]]+0xA.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x4 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || s16 Channel, can be zero. Same as [[#NetworkInfo]]+0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || s8. Same as [[#NetworkInfo]]+0x66. [[#CreateNetwork]]/[[#CreateNetworkPrivate]]: Must be 0x1-0x8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x1 || Cleared to zero during the copy.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || 0x2 || Same as [[#NetworkInfo]]+0x96 (LocalCommunicationVersion from the first [[#NodeInfo|NodeInfo]]). Must not be negative. [[#Connect]]/[[#ConnectPrivate]]: This must match the value for the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0xA || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= NodeLatestUpdate =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeLatestUpdate&amp;quot;. This is a 0x8-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || The field in state is reset to zero by [[#GetNetworkInfoLatestUpdate]] after loading it. Official apps checks whether this is non-zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x7 || Not initialized with [[#GetNetworkInfoLatestUpdate]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= WirelessControllerRestriction =&lt;br /&gt;
This is &amp;quot;nn::ldn::WirelessControllerRestriction&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This is used to determine the value passed to [[BTM_services|btm]] SetWlanMode.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &lt;br /&gt;
|-&lt;br /&gt;
| 1 || This is the default.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= SecurityConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityConfig&amp;quot;. This is a 0x44-byte struct with 2-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Type, a default of value 1 can be used here. Overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]]. The value used internally by these cmds must be 1-3.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Data size. Must be 0x10-0x40.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x40 || Data, used with key derivation.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Type:&lt;br /&gt;
* 1-2: Broadcast Action frame data is encrypted and is verified with SHA256.&lt;br /&gt;
* 3: Broadcast Action frame data is plaintext and is verified with SHA256.&lt;br /&gt;
&lt;br /&gt;
* 1: Data frames are encrypted.&lt;br /&gt;
* 2-3: Data frames for normal data-transfer are plaintext - the network is Open.&lt;br /&gt;
&lt;br /&gt;
= SecurityParameter =&lt;br /&gt;
This is &amp;quot;nn::ldn::SecurityParameter&amp;quot;. This is a 0x20-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || Data, used with the same key derivation as [[#SecurityConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x10 || NetworkId, see [[#NetworkInfo]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= UserConfig =&lt;br /&gt;
This is &amp;quot;nn::ldn::UserConfig&amp;quot;. This is a 0x30-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
sdknso copies the input UserConfig to a tmp struct on stack, which is then used with the cmd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || NUL-terminated string for the user nickname.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x10 || Cleared to zero during the copy.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AddressEntry =&lt;br /&gt;
This is &amp;quot;nn::ldn::AddressEntry&amp;quot;. This is a 0xC-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x2 || Padding&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= AcceptPolicy =&lt;br /&gt;
This is &amp;quot;nn::ldn::AcceptPolicy&amp;quot;. This is an u8.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Allow all.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Deny all.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Blacklist, addresses in the [[#AddAcceptFilterEntry|list]] are not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Whitelist, only addresses in the [[#AddAcceptFilterEntry|list]] are allowed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::ldn::MacAddress&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::ldn::NodeInfo&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The fields listed as Reserved are cleared during the memset and are not written to again afterwards, with cmds which return [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || s8 ID / index&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || Reserved&lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0x2 || s16 LocalCommunicationVersion&lt;br /&gt;
|-&lt;br /&gt;
| 0x30 || 0x10 || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= ConnectOption =&lt;br /&gt;
This is &amp;quot;nn::ldn::ConnectOption&amp;quot;. This is an u32 bitmask.&lt;br /&gt;
&lt;br /&gt;
There&#039;s two versions of the sdknso funcs for [[#Connect]]/[[#ConnectPrivate]]: the version where the ConnectOption isn&#039;t user-specified uses a default value of 0x1 for it, with the same ShowError code without the bit0 check.&lt;br /&gt;
&lt;br /&gt;
When bit0 here is set after using the above cmds, the sdknso funcs will use [[Error_Applet|ShowError]] with the returned Result if: (rc &amp;amp; 0x3FE1FF) == 0xE0CB.&lt;br /&gt;
&lt;br /&gt;
This must be &amp;lt;=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]].&lt;br /&gt;
&lt;br /&gt;
= OperationMode =&lt;br /&gt;
This is &amp;quot;nn::ldn::OperationMode&amp;quot;. This is an u32 enum.&lt;br /&gt;
&lt;br /&gt;
This controls bit1 in the value passed to [[WLAN_services|wlan:lcl]] cmd0/cmd1: bit1 = OperationMode==1.&lt;br /&gt;
&lt;br /&gt;
Value 1 seems to affect power (?) related fields in the beacon tags?&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Value&lt;br /&gt;
!  Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || This is the default.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= MacAddress =&lt;br /&gt;
This is &amp;quot;nn::lp2p::MacAddress&amp;quot;. Same as [[#MacAddress|MacAddress]].&lt;br /&gt;
&lt;br /&gt;
= GroupId =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupId&amp;quot;. This is a 6-byte struct with 1-byte alignment.&lt;br /&gt;
&lt;br /&gt;
This is a WiFi BSSID.&lt;br /&gt;
&lt;br /&gt;
= NodeInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::NodeInfo&amp;quot;. This is a 0x80-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || || &amp;lt;code&amp;gt;struct sockaddr&amp;lt;/code&amp;gt; for the IP address.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x6 || [[#MacAddress_2|MacAddress]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= GroupInfo =&lt;br /&gt;
This is &amp;quot;nn::lp2p::GroupInfo&amp;quot;. This is a 0x200-byte struct.&lt;br /&gt;
&lt;br /&gt;
[[Mario Kart Live: Home Circuit|mklive]] sets the SSID to a string generated from random data.&lt;br /&gt;
&lt;br /&gt;
[[#Scan_2|Scan]] only uses the following fields for the cmd input struct: SupportedPlatform/Priority, Frequency/Channel, and PresharedKeyBinarySize/PresharedKey.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || When zero, this is set to randomly-generated data. Used during key derivation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x8 || LocalCommunicationId. When zero, the value from control.nacp is loaded. This is later validated by [[#Join]]/[[#CreateGroup]] the same way as the [[#NetworkConfig]] field. Used during key derivation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x6 || [[#GroupId]] (&amp;quot;GROUP ID  (BSSID)&amp;quot;). When zero, the default is used. The default should be used here: an error is thrown if the data here doesn&#039;t match the output from [[WLAN_services|wlan:lcl]] cmd2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E || 0x21 || ServiceName (&amp;quot;GROUP NAME (SSID)&amp;quot;). NUL-terminated string. See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F || 0x1 || s8 Flags count. Must be &amp;lt;=0x3F.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || 0x40 || Array of s8 with the above count. Each entry value must be &amp;lt;=0x3F. Each entry is an array index used to load a set of flags from a global array with the specified index. global_flags are also masked with flags loaded from here. User-processes use entryval=1 as the default, with [11.0.0+] entryval=0 can be used for standard WPA2-PSK (see +0x8A).&lt;br /&gt;
|-&lt;br /&gt;
| 0x80 || 0x1 || SupportedPlatform. Must match value 1. 0 is PlatformIdNX, 1 is PlatformIdFuji.&lt;br /&gt;
|-&lt;br /&gt;
| 0x81 || 0x1 || MemberCountMax. s8, Must be &amp;lt;=0x8. During group creation this is passed to [[WLAN_services|wlan:lcl]] cmd40, when this is value 0 a default of value 1 is passed. During group-creation when the below +0x88 field is not value 0x2, the passed [[BTM_services#SetWlanMode|WlanMode]] is &amp;lt;code&amp;gt;x81_field_val &amp;gt; 3&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x84 || 0x2 || Frequency. Wifi frequency: 24 = 2.4GHz, 50 = 5GHz.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86 || 0x2 || s16 Channel (&amp;quot;CHANNEL&amp;quot;). Wifi channel number. 0 = use default, otherwise this must be one of the following depending on the frequency field:&lt;br /&gt;
* 24: 1, 6, 11.&lt;br /&gt;
* 50: 36, 40, 44, 48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x1 || NetworkMode. Used during group-creation to determine the [[BTM_services#SetWlanMode|WlanMode]] to use. When this is value 0x2, mode=3 is used, otherwise it&#039;s determined via the +0x81 field.&lt;br /&gt;
|-&lt;br /&gt;
| 0x89 || 0x1 || PerformanceRequirement.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8A || 0x1 || Security type, used during key derivation. 0 = use defaults, 1 = plaintext, 2 = encrypted. [11.0.0+] 3: Standard WPA2-PSK.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B || 0x1 || StaticAesKeyIndex. s8, used as the array-index for selecting the KeySource used with [[SPL_services#GenerateAesKek|GenerateAesKek]] during key derivation. Should be 1-2, otherwise GenerateAesKek is skipped and zeros are used for the AccessKey instead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D || 0x1 || Priority. Must match one of the following, depending on the used service (doesn&#039;t apply to [[#Join]]): 55 = SystemPriority (lp2p:sys), 90 = ApplicationPriority (lp2p:app and lp2p:sys).&lt;br /&gt;
|-&lt;br /&gt;
| 0x8E || 0x1 || StealthEnabled. Bool flag, controls whether the SSID is hidden.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8F || 0x1 || If zero, a default value of 0x20 is used.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0 || 0x1 || PresharedKeyBinarySize. Must be 0x20 for PresharedKeyBinary. [11.0.0+] With WPA2-PSK, this must be value 1.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C1 || 0x3F ([9.0.0-10.2.0] 0x20) || PresharedKey. Used during key derivation. [11.0.0+] With WPA2-PSK, this is the passphrase string (length must be at least 8).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the ServiceName to be valid without a new one being generated, the following checks must pass:&lt;br /&gt;
* It loops through the characters in the string, looking for the first &#039;_&#039; character:&lt;br /&gt;
** The loop will exit once a &#039;_&#039; character is found.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will also exit once string_pos is &amp;gt;19, in which case the function will also immediately return failure.&lt;br /&gt;
* Then it checks the 11 characters which follow the above:&lt;br /&gt;
** The character must be hex: &#039;0&#039;-&#039;9&#039;, or &#039;A-F&#039; / &#039;a-&#039;f.&lt;br /&gt;
* The following character must be a NUL-terminator.&lt;br /&gt;
* The last hex character above, then the characters for the whole string prior to the last hex character are summed. return sum % 0x2B == 0. u32 is used for these calculations. (Return success when sum is a multiple of 0x2B, otherwise return failure)&lt;br /&gt;
&lt;br /&gt;
If the above fails, then the following runs, otherwise it just returns 0:&lt;br /&gt;
* It loops through the characters in the string.&lt;br /&gt;
** The character must be &#039;-&#039;, or alphanumeric (lowercase/uppercase), otherwise the function will immediately return failure.&lt;br /&gt;
** The loop will exit once string_pos&amp;gt;20 is reached, or when a NUL-terminator is reached.&lt;br /&gt;
* Once finished, success is returned if string_pos-1 is &amp;lt;20, otherwise failure is returned (which also immediately occurs if the first character is a NUL-terminator).&lt;br /&gt;
&lt;br /&gt;
If the above fails, an error is returned, otherwise a new ServiceName is generated:&lt;br /&gt;
* Up to 20 characters are copied from the original ServiceName to the output ServiceName, stopping once the limit is reached or when a NUL-terminator is reached.&lt;br /&gt;
* &#039;_&#039; is appended to the string.&lt;br /&gt;
* &amp;lt;code&amp;gt;nn::util::TSNPrintf({strptr following the above character}, {remaining size}, &amp;quot;%02X%02X%02X%02X%02X&amp;quot;, [[#GroupId|GroupId_byte3]], [[#GroupId|GroupId_byte4]], [[#GroupId|GroupId_byte5]], ([[SPL_services#IsDevelopment|IsDevelopment]] ? 0x80 : 0) | 0x1, 0);&amp;lt;/code&amp;gt;&lt;br /&gt;
* Then the last character is set to the output from a calling a function:&lt;br /&gt;
** All string characters which were already written are summed same way as above. Then: &amp;lt;code&amp;gt;return character_lookup_table[sum % 0x2B];&amp;lt;/code&amp;gt; (If the length passed to this function is 0, this will instead just return character_lookup_table[0])&lt;br /&gt;
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loaded_flags are first loaded from elsewhere, then masked with the above flags when available. loaded_flags are used when +0x8A is 0. global_flags are loaded from global data. These flags are only used with [[#CreateGroup]]/[[#Join]]. Flags (note that the following was updated with [11.0.0+], and differs from below):&lt;br /&gt;
* Bit2 clear:&lt;br /&gt;
** global_flags must be non-zero, and loaded_flags bit1 must be set.&lt;br /&gt;
** u8 +0x8A is set to value 1.&lt;br /&gt;
** When the cached [[SPL_services#IsDevelopment|IsDevelopment]] value is false (retail), an error is thrown.&lt;br /&gt;
** u8 +0x8B is set to value 0.&lt;br /&gt;
* Otherwise, if bit2 is set:&lt;br /&gt;
** u8 +0x8A is set to value 2.&lt;br /&gt;
** global_flags bit1 set:&lt;br /&gt;
*** u8 +0x8B is set to value 1.&lt;br /&gt;
** Otherwise, if global_flags bit2 is set:&lt;br /&gt;
*** u8 +0x8B is set to value 2.&lt;br /&gt;
&lt;br /&gt;
= ScanResult =&lt;br /&gt;
This is &amp;quot;nn::lp2p::ScanResult&amp;quot;. This is a 0x300-byte struct.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x200 || [[#GroupInfo]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x200 || 0x1 || &lt;br /&gt;
|-&lt;br /&gt;
| 0x206 || 0x2 || AdvertiseData size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208 || 0x80 || AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Network protocol =&lt;br /&gt;
== ldn ==&lt;br /&gt;
A beacon and Action frame are broadcasted. The SSID in the beacon is hidden (32-bytes with value 0). For [[#Scan]]/[[#ScanPrivate]] it doesn&#039;t matter if no beacon is available ([[#NetworkInfo]] is the same), as long as the Action frame is broadcasted. However, the Station will not send a probe-request during connection if no beacon is available (and therefore not attempt any communication with the AccessPoint). The beacon doesn&#039;t have any custom Nintendo data, that data is in the Acton frame.&lt;br /&gt;
&lt;br /&gt;
During connection, the Station first sends a probe-request using the [[#NetworkInfo|generated]] SSID from the Action frame. If the probe-response contains the expected data for the [[#SecurityConfig]] type, the Station then proceeds to connect to the AccessPoint. The key for data-frames, if [[#SecurityConfig|enabled]], is derived from a buffer containing: {[[#SecurityParameter]]+0x0} followed by {[[#SecurityConfig]] data with the specified data-size}. The [[#ActionFrame]]/data-frame keys are derived with the same func, the only difference is the input passed to this func + the passed constant data. The key derived by ldn is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard).&lt;br /&gt;
&lt;br /&gt;
Then the Station scans for an [[#ActionFrame]] for loading the [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Once connected, the AccessPoint sends Epigram-vendor Action frame(s) (same data) to the Station, the Station doesn&#039;t require these frames: &amp;lt;code&amp;gt;dd1afeedfacedeadbeef010000000a00000000000000000000000000&amp;lt;/code&amp;gt;. Then the Station must Authenticate with the AccessPoint, this is custom. The Station sends a frame (a maximum of 3 times in some cases if errors occur, with the same data), and the AccessPoint sends a response. Once Authenticated, the node is added to the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]]. If the Station does not successfully Authenticate X-seconds after connecting, the AccessPoint disconnects the Station. If the Station fails to Authenticate, the Station itself will disconnect as well.&lt;br /&gt;
&lt;br /&gt;
After Authentication the Station will scan for another [[#ActionFrame]], with frame-comparision enabled with the above frame (frame must have been updated since the previous scan). The Station locates the index for a [[#MacAddress|MacAddress]] matching itself in the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array (the entry for the AccessPoint is skipped), throwing an error if not found. After validating the LocalCommunicationVersion, it proceeds to handle ARP setup below.&lt;br /&gt;
&lt;br /&gt;
This does not use DHCP, each node on the network has to manually setup ARP (without sending ARP network requests) with the [[#NodeInfo|NodeInfo]] array in [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
At this point standard sockets can be used over Data frames.&lt;br /&gt;
&lt;br /&gt;
=== EthFrame ===&lt;br /&gt;
The custom Ethernet frames have the following structure:&lt;br /&gt;
* &amp;quot;Type: IEEE 802a OUI Extended Ethertype (0x88b7)&amp;quot;&lt;br /&gt;
* &amp;quot;IEEE802a OUI Extended Ethertype&amp;quot;:&lt;br /&gt;
** &amp;quot;Organization Code: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
** &amp;quot;Protocol ID: {...}&amp;quot;&lt;br /&gt;
*** Depends on the frame:&lt;br /&gt;
*** 0x0102: [[#Authentication]]&lt;br /&gt;
*** 0x0103: ?&lt;br /&gt;
* The first byte of Data is value 0, then the ProtocolID-specific data follows, see below.&lt;br /&gt;
** ProtocolID 0x0103 frames are sent by the AccessPoint to the Station. This is 0x20-bytes of zeros, except for the first byte which is 0x3. This is sent by the AccessPoint prior to destroying the network.&lt;br /&gt;
&lt;br /&gt;
==== Authentication ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || [[#AuthVersion]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Low u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x1 || Status. 0 = success, non-zero = error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3 || 0x1 || [2.0.0+] bool flag. The AccessPoint verifies that this is not set. Always set to 1 by the AccessPoint in the response. The Station only uses this when the [[#AuthVersion]] is &amp;gt;=2.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x1 || [6.0.0+] High u8 for the size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5 || 0x3 || Unused, zeros.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8 || 0x20 || [[#NetworkInfo]]+0, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x10 || [[#NetworkInfo]]+0x50, must match the corresponding data in [[#NetworkInfo]] when the receiving node verifies this. With the &lt;br /&gt;
AccessPoint-&amp;gt;Station frame, the Station verifies that this matches the data previously sent to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || See below.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || || Frame-specific data, with the above size. The total frame size - {offset of the start of this data in the frame} must match the above size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Station sets the above size to 0x40 ([6.0.0+] if [[#NetworkInfo]]+0x13 is &amp;lt;3). [6.0.0+] The Authentication challenge is only used/enabled if that value is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used.&lt;br /&gt;
&lt;br /&gt;
The AccessPoint sets the above size to 0x40 ([6.0.0+] 0x0 if the +0x0 [[#AuthVersion]] is &amp;lt;3). [6.0.0+] The AccessPoint will only use/enable the Authentication challenge when the +0x0 [[#AuthVersion]] is &amp;gt;=3, and [[#IUserLocalCommunicationService]] is being used. This data will not be included in the frame if the status field indicates error.&lt;br /&gt;
&lt;br /&gt;
[6.0.0+] Support for the Authentication challenge with [[ETicket_services|es]] cmds 1501-1504 was added.&lt;br /&gt;
&lt;br /&gt;
Station-&amp;gt;AccessPoint frame, relative to +0x0 above (frame size depends on whether +0xAC is enabled):&lt;br /&gt;
&lt;br /&gt;
The AccessPoint will not respond to frames where the source mac-address is unrecognized.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || The Station sets this to random data. Unused by the AccessPoint, except for copying into the response.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x20 || [[#UserConfig]]+0. Copied into state by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68 || 0x2 || Big-endian LocalCommunicationVersion. Byte-swapped by the AccessPoint then copied into state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A || 0x1E || Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x24 || [6.0.0+] Zeros, unused by the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAC || 0x300 || [6.0.0+] Authentication challenge data. If enabled, the total frame size must be &amp;gt;= {end offset of this data in the frame}. The frame data does not include this if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
AccessPoint-&amp;gt;Station response frame, relative to +0x0 above (frame size depends on whether +0x48/+0xCC are enabled):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x38 || 0x10 || +0x38 from the data originally sent by the Station. The Station verifies that this matches the previously sent data.&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || 0x40 || Zeros. [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0x88 || 0x44 || [6.0.0+] Only included in the frame if it&#039;s enabled (+0x0 [[#AuthVersion]] &amp;gt;= 3). Unused by the Station.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC || 0x100 || [6.0.0+] If enabled, Authentication challenge response data. Not included in the frame if it&#039;s not enabled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== AuthVersion =====&lt;br /&gt;
Must be 0x1-0xF.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Value || SystemVersion&lt;br /&gt;
|-&lt;br /&gt;
| 1 || [1.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [2.0.0+]&lt;br /&gt;
|-&lt;br /&gt;
| 3 || [6.0.0+]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following header:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || 04 00 in sent frames.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Protocol ID, must be 0x0101.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Must be 0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x2 || Zeros, unused.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then the actual data follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x20 || [[#NetworkInfo]]+0x0. The u64/u16 are big-endian. Outside of [[#Scan]]/[[#ScanPrivate]], this must match the previously loaded data for this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20 || 0x1 || [[#AuthVersion]]. Copied to [[#NetworkInfo]]+0x63. When comparing with a previous frame is enabled, this must match the value from the previous frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x21 || 0x1 || Encryption type: 1 = plaintext, 2 = encrypted, {frames with other values are ignored by [[#Scan]]/[[#ScanPrivate]]}. Must match the type which is currently being used: with [[#Scan]]/[[#ScanPrivate]] this is determined via this field, otherwise [[#SecurityConfig]] is used to determine this.&lt;br /&gt;
|-&lt;br /&gt;
| 0x22 || 0x2 || Big-endian u16 size for the data starting at +0x48, must be &amp;lt;=0x500, and must match {total frame size relative to +0x0 above} + 0x48.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated. This is incremented each time the below content is updated (including initial creation). Also used by the Station to determine whether the frame changed compared to a previous one. When comparing against a previous frame, new_counter-prev_counter must be &amp;lt;= 0xFF, and the counters must not match.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28 || 0x20 || SHA256 hash over the entire frame starting at +0x0, with the above size + 0x48. During hashing, this hash is cleared, with the new hash overwriting the original in memory (the original is copied to stack for comparing).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is enabled, the encrypted data is +0x28 with size {remaining frame size}. This is encrypted with AES-128-CTR. The key is derived from the raw 0x20-bytes at +0x0. The CTR is {raw Counter above without byte-swap}, with the rest cleared to zeros.&lt;br /&gt;
&lt;br /&gt;
The content data at +0x48 follows, which has the size specified above (which must be &amp;gt;=0x500), where all fields are big-endian:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x10 || [[#NetworkInfo]]+0x50&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || 0x2 || [[#NetworkInfo]]+0x60&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || 0x1 || [[#NetworkInfo]]+0x62&lt;br /&gt;
|-&lt;br /&gt;
| 0x13 || 0x3 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x16 || 0x1 || s8 [[#NetworkInfo]]+0x66, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x17 || 0x1 || s8 [[#NetworkInfo]]+0x67, clamped to range 1-8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || 0x1C0(0x38*8) || Array of the below node struct.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D8 || 0x2 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DA || 0x2 || [[#NetworkInfo]]+0x26A&lt;br /&gt;
|-&lt;br /&gt;
| 0x1DC || 0x180 || [[#NetworkInfo]]+0x26C&lt;br /&gt;
|-&lt;br /&gt;
| 0x35C || 0x19C || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F8 || 0x8 || [6.0.0+] [[#NetworkInfo]]+0x478&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data here is copied into [[#NetworkInfo]].&lt;br /&gt;
&lt;br /&gt;
Node data used in the above array (all fields big-endian), which are copied into the [[#NetworkInfo]] [[#NodeInfo|NodeInfo]] array:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || [[#Ipv4Address]]&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x6 || [[#MacAddress|MacAddress]]&lt;br /&gt;
|-&lt;br /&gt;
| 0xA || 0x1 || bool IsConnected&lt;br /&gt;
|-&lt;br /&gt;
| 0xB || 0x1 || Unused&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x20 || First 0x20-bytes of [[#UserConfig]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C || 0x2 || s16 LocalCommunicationVersion &lt;br /&gt;
|-&lt;br /&gt;
| 0x2E || 0xA || Unused&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== lp2p ==&lt;br /&gt;
This is used for communicating with accessories (external devices on [11.0.0+]) over local wifi. [[Mario Kart Live: Home Circuit]] uses this. [11.0.0+] [[Album_Applet|LibraryAppletPhotoViewer]] uses this.&lt;br /&gt;
&lt;br /&gt;
A beacon is broadcasted.&lt;br /&gt;
&lt;br /&gt;
Action frames are only sent when done so by [[#SendToOtherGroup]] (other than the Epigram one mentioned below).&lt;br /&gt;
&lt;br /&gt;
Communication uses sockets with standard Data frames and the above Action frames. Switch consoles presumably only use the Action frames to communicate with each other?&lt;br /&gt;
&lt;br /&gt;
The key derived by ldn-sysmodule is used directly as the static CCMP key for all data-frames (CCMP / MIC is standard). However, with [[#GroupInfo]]+0x8A value 3, standard WPA2-PSK is used instead.&lt;br /&gt;
&lt;br /&gt;
This uses infrastructure-mode (AccessPoint), and DHCP is used. The group-owner is the AccessPoint. Note that the probe response includes the same Nintendo tags included with the beacon. Once connected, the group-owner sends the same Epigram-vendor Action frame(s) described in [[#ldn]]. At this point socket communication can begin, including DHCP usage.&lt;br /&gt;
&lt;br /&gt;
The DHCP server thread is started by the &amp;quot;nn.lp2p.StateMachine&amp;quot; thread eventually during group [[#CreateGroup|creation]]. The DHCP Offer option values are the following:&lt;br /&gt;
* &amp;quot;Subnet Mask: 255.255.255.0&amp;quot;&lt;br /&gt;
* &amp;quot;DHCP Server Identifier: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;Broadcast Address: {...}&amp;quot;&lt;br /&gt;
* &amp;quot;IP Address Lease Time: (5s) 5 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Renewal Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Rebinding Time Value: (0s) 0 seconds&amp;quot;&lt;br /&gt;
* &amp;quot;Interface MTU: 1500&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the above options doesn&#039;t include &amp;quot;Domain Name Server&amp;quot; or &amp;quot;Router&amp;quot;, the client device may fail to connect if it doesn&#039;t allow those DHCP options to be missing.&lt;br /&gt;
&lt;br /&gt;
=== Beacon ===&lt;br /&gt;
The SSID in the beacon can optionally be [[#GroupInfo|hidden]] (all-zero with the same length as the original SSID). The beacon contains two custom Nintendo tags with OUI &amp;lt;code&amp;gt;00:22:aa&amp;lt;/code&amp;gt;; each tag has a 2-byte ID following the OUI. These Nintendo tags are not used when standard WPA2-PSK is being used. The beacon is identical to ldn, except for the following (besides SSID length difference and the lp2p-only Nintendo tags): &lt;br /&gt;
* &amp;quot;Tag: Traffic Indication Map (TIM)&amp;quot;: &amp;quot;DTIM count&amp;quot; for lp2p is 1, with ldn it&#039;s 0.&lt;br /&gt;
* &amp;quot;Tag: HT Capabilities (802.11n D1.10)&amp;quot;: &amp;quot;HT Short GI for 20MHz&amp;quot; is set to &amp;quot;Not supported&amp;quot;, for ldn it&#039;s &amp;quot;Supported&amp;quot;.&lt;br /&gt;
* &amp;quot;Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element&amp;quot; &amp;quot;Ac Parameters ACI 0&amp;quot;: &amp;quot;CW Min: 15&amp;quot; for lp2p, &amp;quot;CW Min: 63&amp;quot; for ldn.&lt;br /&gt;
&lt;br /&gt;
Note that during group creation the beacon may be missing the Nintendo tags in some cases, since group creation didn&#039;t finish yet.&lt;br /&gt;
&lt;br /&gt;
The first Nintendo tag (ID 0x0600) contains the following data:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 01 00 or 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || || Start of encrypted (and crypto-related) data if enabled. 0x22-bytes when encrypted, 0xE-bytes when plaintext.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The second Nintendo tag (ID 0x0601) contains the following data (data is encrypted if enabled, there&#039;s also an additional 0x14-bytes when encrypted):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x1 || Plaintext: usually 21?&lt;br /&gt;
|-&lt;br /&gt;
| 0x1 || 0x1 || Plaintext: AdvertiseData size&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || {above size} || Plaintext: AdvertiseData&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== ActionFrame ===&lt;br /&gt;
The Action frames have the following structure:&lt;br /&gt;
* &amp;quot;Fixed parameters&amp;quot;:&lt;br /&gt;
** &amp;quot;Category code: Vendor Specific (127)&amp;quot;&lt;br /&gt;
** &amp;quot;OUI: 00:22:aa (Nintendo Co., Ltd.)&amp;quot;&lt;br /&gt;
* The Data starts with the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x2 || Usually 06 00?&lt;br /&gt;
|-&lt;br /&gt;
| 0x2 || 0x2 || Usually 20 02?(Second byte depends on whether encryption is used?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || 0x2 || Usually 02 00?(varies)&lt;br /&gt;
|-&lt;br /&gt;
| 0x6 || 0x8 || Big-endian version of [[#GroupInfo]]+0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE || 0x10 || Same as [[#GroupInfo]]+0x0.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When encryption is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || 0x4 || Big-endian u32 Counter. The initial value is randomly-generated (?). This is incremented with each sent Action frame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4 || {remaining size} || Encrypted user-data. Also includes 0x10-bytes of unknown data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When plaintext is used, the remaining data is:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0 || {remaining size} || Plaintext user-data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=10620</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=10620"/>
		<updated>2021-01-29T18:55:32Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Error codes */ Add a bunch of LP2P error codes I discovered.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
These have been redesigned from the 3DS so that they fit within a Aarch64 MOV instruction immediate most of the time (without requiring the additional MOVK).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Result Errors =&lt;br /&gt;
General errors used by system modules and applications.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Fs&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Htcs&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Ncm&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Dd&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Dmnt&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Lr&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Cmif&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Hipc&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Pm&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Ns&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Bsdsockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Htc&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Tsc&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Ncm (content)&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Sm&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Ro (userland)&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Gc&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Sdmmc&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Ovln&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Spl&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Socket&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Htclow&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Ddsf&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Htcfs&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Async&lt;br /&gt;
|-&lt;br /&gt;
| 100 || Ethc&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2c&lt;br /&gt;
|-&lt;br /&gt;
| 102 || Gpio&lt;br /&gt;
|-&lt;br /&gt;
| 103 || Uart&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || Wlan&lt;br /&gt;
|-&lt;br /&gt;
| 108 || Xcd&lt;br /&gt;
|-&lt;br /&gt;
| 110 || Nifm&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 112 || Sasbus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || Vi&lt;br /&gt;
|-&lt;br /&gt;
| 115 || Nfp&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || Fgm&lt;br /&gt;
|-&lt;br /&gt;
| 118 || Oe&lt;br /&gt;
|-&lt;br /&gt;
| 120 || Pcie&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || Bcat&lt;br /&gt;
|-&lt;br /&gt;
| 123 || Ssl&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || Nfc&lt;br /&gt;
|-&lt;br /&gt;
| 128 || Am&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Prepo&lt;br /&gt;
|-&lt;br /&gt;
| 130 || Ahid&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Qlaunch&lt;br /&gt;
|-&lt;br /&gt;
| 133 || Pcv&lt;br /&gt;
|-&lt;br /&gt;
| 134 || Omm&lt;br /&gt;
|-&lt;br /&gt;
| 135 || Bpc&lt;br /&gt;
|-&lt;br /&gt;
| 136 || Psm&lt;br /&gt;
|-&lt;br /&gt;
| 137 || Nim&lt;br /&gt;
|-&lt;br /&gt;
| 138 || Psc&lt;br /&gt;
|-&lt;br /&gt;
| 139 || Tc&lt;br /&gt;
|-&lt;br /&gt;
| 140 || Usb&lt;br /&gt;
|-&lt;br /&gt;
| 141 || Nsd&lt;br /&gt;
|-&lt;br /&gt;
| 142 || Pctl&lt;br /&gt;
|-&lt;br /&gt;
| 143 || Btm&lt;br /&gt;
|-&lt;br /&gt;
| 144 || La&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || Ngc&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Erpt&lt;br /&gt;
|-&lt;br /&gt;
| 148 || Apm&lt;br /&gt;
|-&lt;br /&gt;
| 149 || Cec&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Eupld&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || Npns&lt;br /&gt;
|-&lt;br /&gt;
| 155 || Npns XMPP stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || Arp&lt;br /&gt;
|-&lt;br /&gt;
| 158 || Updater&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Swkbd&lt;br /&gt;
|-&lt;br /&gt;
| 161 || Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland (assert)&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || Ec (shop)&lt;br /&gt;
|-&lt;br /&gt;
| 165 || Spsm&lt;br /&gt;
|-&lt;br /&gt;
| 167 || Bgtc&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland (crash)&lt;br /&gt;
|-&lt;br /&gt;
| 169 || Sasbus periodic receive mode&lt;br /&gt;
|-&lt;br /&gt;
| 175 || Jit&lt;br /&gt;
|-&lt;br /&gt;
| 177 || Hdcp&lt;br /&gt;
|-&lt;br /&gt;
| 178 || Pdm&lt;br /&gt;
|-&lt;br /&gt;
| 179 || Olsc&lt;br /&gt;
|-&lt;br /&gt;
| 180 || Srepo&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 187 || Sasbus&lt;br /&gt;
|-&lt;br /&gt;
| 189 || Pwm&lt;br /&gt;
|-&lt;br /&gt;
| 191 || Rtc&lt;br /&gt;
|-&lt;br /&gt;
| 192 || Regulator&lt;br /&gt;
|-&lt;br /&gt;
| 193 || Led&lt;br /&gt;
|-&lt;br /&gt;
| 197 || Clkrst&lt;br /&gt;
|-&lt;br /&gt;
| 198 || Powctl&lt;br /&gt;
|-&lt;br /&gt;
| 202 || Hid&lt;br /&gt;
|-&lt;br /&gt;
| 203 || Ldn&lt;br /&gt;
|-&lt;br /&gt;
| 204 || Cs&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || Atk&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 || Lcs&lt;br /&gt;
|-&lt;br /&gt;
| 212 || Grc&lt;br /&gt;
|-&lt;br /&gt;
| 214 || Album&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration idc server&lt;br /&gt;
|-&lt;br /&gt;
| 218 || Hidbus&lt;br /&gt;
|-&lt;br /&gt;
| 223 || Websocket&lt;br /&gt;
|-&lt;br /&gt;
| 227 || Capmtp&lt;br /&gt;
|-&lt;br /&gt;
| 228 || Pgl&lt;br /&gt;
|-&lt;br /&gt;
| 229 || Notification&lt;br /&gt;
|-&lt;br /&gt;
| 230 || Ins&lt;br /&gt;
|-&lt;br /&gt;
| 231 || Lp2p&lt;br /&gt;
|-&lt;br /&gt;
| 244 || Dp2hdmi&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Error codes ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E01 || 1 || 7 || Session count exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || Not Implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0x7601 || 1 || 59 || Thread terminated/termination requested&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Resource exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Invalid pointer/Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Operation canceled&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt/exception&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Invalid state&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x40A01 || 1 || 517 || Invalid process ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40C01 || 1 || 518 || Invalid thread ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40E01 || 1 || 519 || Invalid thread ID (used in svcGetDebugThreadParam).&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0x202 || 2 || 1 || Path does not exist.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402 || 2 || 2 || Path already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Resource already in use (file already opened, savedata filesystem already mounted).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4602 || 2 || 35 || Not enough free space for BIS Calibration partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4802 || 2 || 36 || Not enough free space for BIS Safe partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A02 || 2 || 37 || Not enough free space for BIS User partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C02 || 2 || 38 || Not enough free space for BIS System partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E02 || 2 || 39 || Not enough free space on SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6402 || 2 || 50 || NCA is older than version 3, or NCA SDK version is older than 0.11.0.0&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B402 || 2 || 2522 || Attempted process an AsicHandler command in initial mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13D802 || 2 || 2540 || Attempted to read from the secure gamecard partition in normal mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Attempted to read from the normal gamecard partition in secure mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DC02 || 2 || 2542 || Attempted a read that spanned both the normal and secure gamecard partitions&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E002 || 2 || 2544 || Gamecard initial data hash doesn&#039;t match the initial data hash in the card header&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E202 || 2 || 2545 || Gamecard initial data reserved area is not all zeros&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E402 || 2 || 2546 || Gamecard certificate kek index doesn&#039;t match card header kek index&lt;br /&gt;
|-&lt;br /&gt;
| 0x13EE02 || 2 || 2551 || Unable to read card header on gamecard init&lt;br /&gt;
|-&lt;br /&gt;
| 0x140A02 || 2 || 2565 || Encountered SDMMC error in write operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x145002 || 2 || 2600 || Attempted to switch lotus state machine to secure mode from a mode other than normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x145202 || 2 || 2601 || Attempted to switch lotus state machine to normal mode from a mode other than initial&lt;br /&gt;
|-&lt;br /&gt;
| 0x145402 || 2 || 2602 || Attempted to switch lotus state machine to write mode from a mode other than normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x149402 || 2 || 2634 || Error processing lotus command SetUserAsicFirmware&lt;br /&gt;
|-&lt;br /&gt;
| 0x149A02 || 2 || 2637 || Error processing lotus command GetAsicCert&lt;br /&gt;
|-&lt;br /&gt;
| 0x14A002 || 2 || 2640 || Error processing lotus command SetEmmcEmbeddedSocCertificate&lt;br /&gt;
|-&lt;br /&gt;
| 0x14AA02 || 2 || 2645 || Error processing lotus command GetAsicEncryptedMessage&lt;br /&gt;
|-&lt;br /&gt;
| 0x14AC02 || 2 || 2646 || Error processing lotus command SetLibraryEncryptedMessage&lt;br /&gt;
|-&lt;br /&gt;
| 0x14B602 || 2 || 2651 || Error processing lotus command GetAsicAuthenticationData&lt;br /&gt;
|-&lt;br /&gt;
| 0x14B802 || 2 || 2652 || Error processing lotus command SetAsicAuthenticationDataHash&lt;br /&gt;
|-&lt;br /&gt;
| 0x14BA02 || 2 || 2653 || Error processing lotus command SetLibraryAuthenticationData&lt;br /&gt;
|-&lt;br /&gt;
| 0x14BC02 || 2 || 2654 || Error processing lotus command GetLibraryAuthenticationDataHash&lt;br /&gt;
|-&lt;br /&gt;
| 0x14C202 || 2 || 2657 || Error processing lotus command ExchangeRandomValuesInSecureMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x14D802 || 2 || 2668 || Error calling nn::gc::detail::GcCrypto::GenerateRandomBytes&lt;br /&gt;
|-&lt;br /&gt;
| 0x14DE02 || 2 || 2671 || Error processing lotus command ReadAsicRegister&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E002 || 2 || 2672 || Error processing lotus command GetGameCardIdSet&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E402 || 2 || 2674 || Error processing lotus command GetCardHeader&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E802 || 2 || 2676 || Error processing lotus command GetCardKeyArea&lt;br /&gt;
|-&lt;br /&gt;
| 0x14EA02 || 2 || 2677 || Error processing lotus command ChangeDebugMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x14EC02 || 2 || 2678 || Error processing lotus command GetRmaInformation&lt;br /&gt;
|-&lt;br /&gt;
| 0x150802 || 2 || 2692 || Tried sending lotus card command Refresh when not in secure mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x150A02 || 2 || 2693 || Tried sending lotus card command when not in correct mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x155602 || 2 || 2731 || Error processing lotus card command ReadId1&lt;br /&gt;
|-&lt;br /&gt;
| 0x155802 || 2 || 2732 || Error processing lotus card command ReadId2&lt;br /&gt;
|-&lt;br /&gt;
| 0x155A02 || 2 || 2733 || Error processing lotus card command ReadId3&lt;br /&gt;
|-&lt;br /&gt;
| 0x155E02 || 2 || 2735 || Error processing lotus card command ReadPage&lt;br /&gt;
|-&lt;br /&gt;
| 0x156202 || 2 || 2737 || Error processing lotus card command WritePage&lt;br /&gt;
|-&lt;br /&gt;
| 0x156402 || 2 || 2738 || Error processing lotus card command Refresh&lt;br /&gt;
|-&lt;br /&gt;
| 0x156C02 || 2 || 2742 || Error processing lotus card command ReadCrc&lt;br /&gt;
|-&lt;br /&gt;
| 0x156E02 || 2 || 2743 || Error processing lotus card command Erase or UnlockForceErase&lt;br /&gt;
|-&lt;br /&gt;
| 0x157002 || 2 || 2744 || Error processing lotus card command ReadDevParam&lt;br /&gt;
|-&lt;br /&gt;
| 0x157202 || 2 || 2745 || Error processing lotus card command WriteDevParam&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B002 || 2 || 2904 || Id2Normal did not match the value in the buffer returned by ChangeDebugMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B202 || 2 || 2905 || Id1Normal did not match Id1Writer when switching gamecard to write mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B402 || 2 || 2906 || Id2Normal did not match Id2Writer when switching gamecard to write mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x172002 || 2 || 2960 || Invalid gamecard handle when opening normal gamecard partition&lt;br /&gt;
|-&lt;br /&gt;
| 0x172202 || 2 || 2961 || Invalid gamecard handle when opening secure gamecard partition&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 2 || 3001 || Unimplemented behavior&lt;br /&gt;
|-&lt;br /&gt;
| 0x177602 || 2 || 3003 || File/Directory already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x190202 || 2 || 3201 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190602 || 2 || 3203 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190802 || 2 || 3204 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190A02 || 2 || 3205 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190C02 || 2 || 3206 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x191002 || 2 || 3208 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x195802 || 2 || 3244 || Allocation failure related to SD cards&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A3E02 || 2 || 3359 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4002 || 2 || 3360 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x21BC02 || 2 || 4318 || Invalid save data filesystem magic (valid magic is SAVE in ASCII)&lt;br /&gt;
|-&lt;br /&gt;
| 0x234202 || 2 || 4513 || Error reading ACID section in NPDM&lt;br /&gt;
|-&lt;br /&gt;
| 0x234402 || 2 || 4514 || Invalid NPDM ACID section size&lt;br /&gt;
|-&lt;br /&gt;
| 0x234602 || 2 || 4515 || Last byte of the ACID modulus is zero&lt;br /&gt;
|-&lt;br /&gt;
| 0x234802 || 2 || 4516 || Invalid ACID fixed key signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x234A02 || 2 || 4517 || Invalid NCA magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x234C02 || 2 || 4518 || Invalid NCA header fixed key signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x234E02 || 2 || 4519 || Invalid NCA header ACID signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x235002 || 2 || 4520 || Invalid NCA header section hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235602 || 2 || 4523 || Invalid encryption type&lt;br /&gt;
|-&lt;br /&gt;
| 0x235802 || 2 || 4524 || Redirection BKTR table size is negative&lt;br /&gt;
|-&lt;br /&gt;
| 0x235A02 || 2 || 4525 || Encryption BKTR table size is negative&lt;br /&gt;
|-&lt;br /&gt;
| 0x235C02 || 2 || 4526 || Redirection BKTR table end offset is past the Encryption BKTR table start offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x236002 || 2 || 4528 || NCA header value is out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0x236202 || 2 || 4529 || NCA FS header value is out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0x236802 || 2 || 4532 || PartitionFS hash block size is not a power of 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x236A02 || 2 || 4533 || PartitionFS hash &amp;quot;always_2&amp;quot; field is not 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x236C02 || 2 || 4534 || PartitionFS hash table is too small for main data&lt;br /&gt;
|-&lt;br /&gt;
| 0x236E02 || 2 || 4535 || Invalid PartitionFS block hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x244402 || 2 || 4642 || Invalid Partition file hashed region bounds&lt;br /&gt;
|-&lt;br /&gt;
| 0x244602 || 2 || 4643 || Invalid Partition FS hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x244802 || 2 || 4644 || Invalid PFS0 magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x244A02 || 2 || 4645 || Invalid HFS0 magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x244C02 || 2 || 4646 || Invalid name offset for Partition FS file entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x244E02 || 2 || 4647 || Calculated Partition FS header size changed between 2 consecutive reads&lt;br /&gt;
|-&lt;br /&gt;
| 0x249802 || 2 || 4684 || Invalid FAT file number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249C02 || 2 || 4686 || Invalid FAT format for BIS User partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249E02 || 2 || 4687 || Invalid FAT format for BIS System partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24A002 || 2 || 4688 || Invalid FAT format for BIS Safe partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24A202 || 2 || 4689 || Invalid FAT format for BIS Calibration partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x280202 || 2 || 5121 || Invalid FAT size&lt;br /&gt;
|-&lt;br /&gt;
| 0x280402 || 2 || 5122 || Invalid FAT BPB (BIOS Parameter Block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x280602 || 2 || 5123 || Invalid FAT parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x280802 || 2 || 5124 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280A02 || 2 || 5125 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280C02 || 2 || 5126 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280E02 || 2 || 5127 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x296A02 || 2 || 5301 || Mountpoint not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE802 || 2 || 6004 || Invalid character.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 2 || 6005 || Invalid directory path.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEC02 || 2 || 6006 || Unable to retrieve directory from path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x313A02 || 2 || 6301 || A specified filesystem has no MultiCommitTarget when doing a multi-filesystem commit&lt;br /&gt;
|-&lt;br /&gt;
| 0x313C02 || 2 || 6302 || Attempted to resize a nn::fs::SubStorage or BufferedStorage that is marked as non-resizable&lt;br /&gt;
|-&lt;br /&gt;
| 0x313E02 || 2 || 6303 || Attempted to resize a nn::fs::SubStorage or BufferedStorage when the SubStorage ends before the base storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x314002 || 2 || 6304 || Attempted to call nn::fs::MemoryStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x314202 || 2 || 6305 || Invalid Operation ID in nn::fs::MemoryStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314402 || 2 || 6306 || Invalid Operation ID in nn::fs::FileStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314602 || 2 || 6307 || Invalid Operation ID in nn::fs::FileHandleStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314802 || 2 || 6308 || Invalid Operation ID in nn::fssystem::SwitchStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314A02 || 2 || 6309 || Invalid Operation ID in nn::fs::detail::StorageServiceObjectAdapter::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314C02 || 2 || 6310 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x314E02 || 2 || 6311 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315002 || 2 || 6312 || Invalid Operation ID in nn::fssystem::AesCtrCounterExtendedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x315202 || 2 || 6313 || Attempted to call nn::fssystem::AesCtrStorageExternal::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x315402 || 2 || 6314 || Attempted to call nn::fssystem::AesCtrStorageExternal::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315602 || 2 || 6315 || Attempted to call nn::fssystem::AesCtrStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315802 || 2 || 6316 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315A02 || 2 || 6317 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x315C02 || 2 || 6318 || Attempted to call nn::fssystem::save::IntegrityVerificationStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315E02 || 2 || 6319 || Attempted to invalidate the cache of a RomFs IVFC storage in nn::fssystem::save::IntegrityVerificationStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316002 || 2 || 6320 || Invalid Operation ID in nn::fssystem::save::IntegrityVerificationStorage::OperateRange &lt;br /&gt;
|-&lt;br /&gt;
| 0x316202 || 2 || 6321 || Attempted to call nn::fssystem::save::BlockCacheBufferedStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x316402 || 2 || 6322 || Attempted to invalidate the cache of something other than a savedata IVFC storage in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316602 || 2 || 6323 || Invalid Operation ID in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316802 || 2 || 6324 || Attempted to call nn::fssystem::IndirectStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x316A02 || 2 || 6325 || Attempted to call nn::fssystem::IndirectStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x316C02 || 2 || 6326 || Invalid Operation ID in nn::fssystem::IndirectStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316E02 || 2 || 6327 || Attempted to call nn::fssystem::SparseStorage::ZeroStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x317002 || 2 || 6328 || Attempted to call nn::fssystem::SparseStorage::ZeroStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317202 || 2 || 6329 || Attempted to call nn::fssystem::HierarchicalSha256Storage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317402 || 2 || 6330 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x317602 || 2 || 6331 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317802 || 2 || 6332 || Attempted to call nn::fssystem::IntegrityRomFsStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317A02 || 2 || 6333 || Attempted to call nn::fssystem::save::DuplexStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317C02 || 2 || 6334 || Invalid Operation ID in nn::fssystem::save::DuplexStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x317E02 || 2 || 6335 || Attempted to call nn::fssystem::save::HierarchicalDuplexStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318002 || 2 || 6336 || Attempted to call nn::fssystem::save::RemapStorage::GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318202 || 2 || 6337 || Attempted to call nn::fssystem::save::RemapStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318402 || 2 || 6338 || Invalid Operation ID in nn::fssystem::save::RemapStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318602 || 2 || 6339 || Attempted to call nn::fssystem::save::IntegritySaveDataStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318802 || 2 || 6340 || Invalid Operation ID in nn::fssystem::save::IntegritySaveDataStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318A02 || 2 || 6341 || Attempted to call nn::fssystem::save::JournalIntegritySaveDataStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318C02 || 2 || 6342 || Invalid Operation ID in nn::fssystem::save::JournalIntegritySaveDataStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318E02 || 2 || 6343 || Attempted to call nn::fssystem::save::JournalStorage::GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319002 || 2 || 6344 || Attempted to call nn::fssystem::save::JournalStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319202 || 2 || 6345 || Invalid Operation ID in nn::fssystem::save::JournalStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x319402 || 2 || 6346 || Attempted to call nn::fssystem::save::UnionStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319602 || 2 || 6347 || Attempted to call nn::fssystem::dbm::AllocationTableStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319802 || 2 || 6348 || Attempted to call nn::fssrv::fscreator::WriteOnlyGameCardStorage::Read&lt;br /&gt;
|-&lt;br /&gt;
| 0x319A02 || 2 || 6349 || Attempted to call nn::fssrv::fscreator::WriteOnlyGameCardStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319C02 || 2 || 6350 || Attempted to call nn::fssrv::fscreator::ReadOnlyGameCardStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x319E02 || 2 || 6351 || Attempted to call nn::fssrv::fscreator::ReadOnlyGameCardStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A002 || 2 || 6352 || Invalid Operation ID in nn::fssrv::fscreator::ReadOnlyGameCardStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A202 || 2 || 6353 || Attempted to call SdStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A402 || 2 || 6354 || Invalid Operation ID in SdStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A602 || 2 || 6355 || Invalid Operation ID in nn::fat::FatFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A802 || 2 || 6356 || Invalid Operation ID in nn::fssystem::StorageFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AA02 || 2 || 6357 || Attempted to call nn::fssystem::ConcatenationFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AC02 || 2 || 6358 || Attempted to call nn::fssystem::ConcatenationFile::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AE02 || 2 || 6359 || Invalid Query ID in nn::fssystem::ConcatenationFileSystem::DoQueryEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B002 || 2 || 6360 || Invalid Operation ID in nn::fssystem::ConcatenationFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B202 || 2 || 6361 || Attempted to call nn::fssystem::ZeroBitmapFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B402 || 2 || 6362 || Invalid Operation ID in nn::fs::detail::FileServiceObjectAdapter::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B602 || 2 || 6363 || Invalid Operation ID in nn::fssystem::AesXtsFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B802 || 2 || 6364 || Attempted to modify a nn::fs::RomFsFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BA02 || 2 || 6365 || Attempted to call nn::fs::RomFsFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BC02 || 2 || 6366 || Attempted to query the space in a nn::fs::RomFsFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BE02 || 2 || 6367 || Attempted to modify a nn::fssystem::RomFsFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C002 || 2 || 6368 || Invalid Operation ID in nn::fssystem::RomFsFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C202 || 2 || 6369 || Attempted to modify a nn::fs::ReadOnlyFileSystemTemplate&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C402 || 2 || 6370 || Attempted to call nn::fs::ReadOnlyFileSystemTemplate::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C602 || 2 || 6371 || Attempted to query the space in a nn::fs::ReadOnlyFileSystemTemplate&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C802 || 2 || 6372 || Attempted to modify a nn::fs::ReadOnlyFileSystemFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CA02 || 2 || 6373 || Invalid Operation ID in nn::fs::ReadOnlyFileSystemFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CC02 || 2 || 6374 || Attempted to modify a nn::fssystem::PartitionFileSystemCore&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CE02 || 2 || 6375 || Attempted to call nn::fssystem::PartitionFileSystemCore::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D002 || 2 || 6376 || Attempted to call nn::fssystem::PartitionFileSystemCore::PartitionFile::DoSetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D202 || 2 || 6377 || Invalid Operation ID in nn::fssystem::PartitionFileSystemCore::PartitionFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D402 || 2 || 6378 || Invalid Operation ID in nn::fssystem::TmFileSystemFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D602 || 2 || 6379 || Attempted to call unsupported functions in nn::fssrv::fscreator::SaveDataInternalStorageFileSystem, nn::fssrv::detail::SaveDataInternalStorageAccessor::PaddingFile or nn::fssystem::save::detail::SaveDataExtraDataInternalStorageFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31DC02 || 2 || 6382 || Attempted to call nn::fssystem::ApplicationTemporaryFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31DE02 || 2 || 6383 || Attempted to call nn::fssystem::SaveDataFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E002 || 2 || 6384 || Attempted to call nn::fssystem::DirectorySaveDataFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E202 || 2 || 6385 || Attempted to call nn::fssystem::ZeroBitmapHashStorageFile::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E402 || 2 || 6386 || Attempted to call nn::fssystem::ZeroBitmapHashStorageFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x326E02 || 2 || 6455 || File not closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x327002 || 2 || 6456 || Directory not closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x327202 || 2 || 6457 || Writable file not closed when committing&lt;br /&gt;
|-&lt;br /&gt;
| 0x327402 || 2 || 6458 || FS allocators already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x327602 || 2 || 6459 || FS allocators already used&lt;br /&gt;
|-&lt;br /&gt;
| 0x327A02 || 2 || 6461 || FS allocator alignment violation&lt;br /&gt;
|-&lt;br /&gt;
| 0x339402 || 2 || 6602 || File not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x339602 || 2 || 6603 || Directory not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346C02 || 2 || 6710 || Multi-commit limit reached&lt;br /&gt;
|-&lt;br /&gt;
| 0x35F202 || 2 || 6905 || Mount name not found in table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DBC02 || 2 || 7902 || RomFs table: Entry not found in dictionary&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DBE02 || 2 || 7903 || RomFs table: File not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC002 || 2 || 7904 || RomFs table: Directory not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC402 || 2 || 7906 || RomFs table: Entry already exists when trying to add a new entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC602 || 2 || 7907 || RomFs table: Insufficient space to add new entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC802 || 2 || 7908 || RomFs table: Unable to add new directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DCA02 || 2 || 7909 || RomFs table: Unable to add new file&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DCC02 || 2 || 7910 || RomFs directory has no more child directories/files when iterating&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DD402 || 2 || 7914 || RomFs table: Path is file, not directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x803 || 3 || 4 || OS busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xE03 || 3 || 7 || Invalid parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x1003 || 3 || 8 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1203 || 3 || 9 || Out of resources&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1408 || 8 || 10 || Program location for debug entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid NSO.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC09 || 9 || 6 || Invalid Path.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1409 || 9 || 10 || Invalid version in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Insufficient address space.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6809 || 9 || 52 || Insufficient NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C09 || 9 || 54 || Invalid signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x6E09 || 9 || 55 || Insufficient NRO registrations.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7009 || 9 || 56 || Insufficient NRR registrations.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7209 || 9 || 57 || NRO Already loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xA809 || 9 || 84 || NRR Not Loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1940A || 10 || 202 || Invalid CMIF header size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A60A || 10 || 211 || Invalid CMIF input header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Invalid CMIF output header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BA0A || 10 || 221 || Invalid method dispatch ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D60A || 10 || 235 || Invalid in object count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D80A || 10 || 236 || Invalid out object count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0A || 10 || 301 || Out of domain entries.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC0B || 11 || 102 || Out of server session memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3240B || 11 || 402 || Data/buffer length(s) too large for IPC buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3260B || 11 || 403 || Unknown request type&lt;br /&gt;
|-&lt;br /&gt;
| 0x3480B || 11 || 420 || Number(s) of buffers/handles/PIDs passed differ from what method expects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A810 || 16 || 340 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64210 || 16 || 801 || [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] system_delivery_protocol_version is less than the system-setting.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64410 || 16 || 802 || [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] system_delivery_protocol_version is larger than the system-setting.&lt;br /&gt;
|-&lt;br /&gt;
| 0x74610 || 16 || 931 || Invalid [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] HMAC / invalid Meta Id.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6F810 || 16 || 892 || Unknown state ref-count is zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x215 || 21 || 1 || Out of processes&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0x815 || 21 || 4 || Service already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xA15 || 21 || 5 || Out of services&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE15 || 21 || 7 || Service not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x1215 || 21 || 9 || Service Access Control too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A || 26 || 1 || SMC is not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || SMC argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x61A || 26 || 3 || SMC is currently in progress/secmon is busy&lt;br /&gt;
|-&lt;br /&gt;
| 0x81A || 26 || 4 || Secmon not currently performing async operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xA1A || 26 || 5 || Invalid SMC async callback key&lt;br /&gt;
|-&lt;br /&gt;
| 0xC1A || 26 || 6 || SMC is blacklisted during current boot&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Invalid (buffer) size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown SMC error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Decryption failure&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || No AES keyslots available&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES keyslot&lt;br /&gt;
|-&lt;br /&gt;
| 0xD41A || 26 || 106 || BootReason already set&lt;br /&gt;
|-&lt;br /&gt;
| 0xD61A || 26 || 107 || BootReason not set&lt;br /&gt;
|-&lt;br /&gt;
| 0xD81A || 26 || 108 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19269 || 105 || 201 || Null settings name&lt;br /&gt;
|-&lt;br /&gt;
| 0x19469 || 105 || 202 || Null settings key&lt;br /&gt;
|-&lt;br /&gt;
| 0x19669 || 105 || 203 || Null settings value&lt;br /&gt;
|-&lt;br /&gt;
| 0x19A69 || 105 || 205 || Null settings value buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A069 || 105 || 208 || Null setting value size buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A269 || 105 || 209 || Null debug mode flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BA69 || 105 || 221 || Setting group name has zero length&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BC69 || 105 || 222 || Empty settings item key&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E269 || 105 || 241 || Setting group name is too long (64 character limit?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E469 || 105 || 242 || Setting name is too long (64 character limit?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20A69 || 105 || 261 || Setting group name ends with &#039;.&#039; or contains invalid characters (allowed: [a-z0-9_\-.])&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C69 || 105 || 262 || Setting name ends with &#039;.&#039; or contains invalid characters (allowed: [a-z0-9_\-.])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4DA69 || 105 || 621 || Null language code buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E269 || 105 || 625 || Language out of valid range&lt;br /&gt;
|-&lt;br /&gt;
| 0x4EE69 || 105 || 631 || Null network settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F069 || 105 || 632 || Null network settings output count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x50269 || 105 || 641 || Null backlight settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51669 || 105 || 651 || Null Bluetooth device setting buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51869 || 105 || 652 || Null Bluetooth device setting output count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51A69 || 105 || 653 || Null Bluetooth enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51C69 || 105 || 654 || Null Bluetooth AFH enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51E69 || 105 || 655 || Null Bluetooth boost enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52069 || 105 || 656 || Null BLE pairing settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52269 || 105 || 657 || Null BLE pairing settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52A69 || 105 || 661 || Null external steady clock source ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52C69 || 105 || 662 || Null user system clock context buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52E69 || 105 || 663 || Null network system clock context buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53069 || 105 || 664 || Null user system clock automatic correction enabled flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53269 || 105 || 665 || Null shutdown RTC value buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53469 || 105 || 666 || Null external steady clock internal offset buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53E69 || 105 || 671 || Null account settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55269 || 105 || 681 || Null audio volume buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55669 || 105 || 683 || Null ForceMuteOnHeadphoneRemoved buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55869 || 105 || 684 || Null headphone volume warning count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55E69 || 105 || 687 || Invalid audio output mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x56069 || 105 || 688 || Null headphone volume update flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x56669 || 105 || 691 || Null console information upload flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57A69 || 105 || 701 || Null automatic application download flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57C69 || 105 || 702 || Null notification settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57E69 || 105 || 703 || Null account notification settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x58069 || 105 || 704 || Null account notification settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x58E69 || 105 || 711 || Null vibration master volume buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59069 || 105 || 712 || Null NX controller settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59269 || 105 || 713 || Null NX controller settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59469 || 105 || 714 || Null USB full key enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A269 || 105 || 721 || Null TV settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A469 || 105 || 722 || Null EDID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5B669 || 105 || 731 || Null data deletion settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CA69 || 105 || 741 || Null initial system applet program ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CC69 || 105 || 742 || Null overlay disp program ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CE69 || 105 || 743 || Null IsInRepairProcess buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D069 || 105 || 744 || Null RequiresRunRepairTimeReviser buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5DE69 || 105 || 751 || Null device timezone location name buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F269 || 105 || 761 || Null primary album storage buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x60669 || 105 || 771 || Null USB 3.0 enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x60869 || 105 || 772 || Null USB Type-C power source circuit version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x61A69 || 105 || 781 || Null battery lot buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x62E69 || 105 || 791 || Null serial number buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64269 || 105 || 801 || Null lock screen flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64669 || 105 || 803 || Null color set ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64869 || 105 || 804 || Null quest flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64A69 || 105 || 805 || Null wireless certification file size buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64C69 || 105 || 806 || Null wireless certification file buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64E69 || 105 || 807 || Null initial launch settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65069 || 105 || 808 || Null device nickname buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65269 || 105 || 809 || Null battery percentage flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65469 || 105 || 810 || Null applet launch flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E869 || 105 || 1012 || Null wireless LAN enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FA69 || 105 || 1021 || Null product model buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E69 || 105 || 1031 || Null NFC enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x82269 || 105 || 1041 || Null ECI device certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x82469 || 105 || 1042 || Null E-Ticket device certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x83669 || 105 || 1051 || Null sleep settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x84A69 || 105 || 1061 || Null EULA version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x84C69 || 105 || 1062 || Null EULA version entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x85E69 || 105 || 1071 || Null LDN channel buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x87269 || 105 || 1081 || Null SSL key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x87469 || 105 || 1082 || Null SSL certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x88669 || 105 || 1091 || Null telemetry flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x89A69 || 105 || 1101 || Null Gamecard key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x89C69 || 105 || 1102 || Null Gamecard certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8AE69 || 105 || 1111 || Null PTM battery lot buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B069 || 105 || 1112 || Null PTM fuel gauge parameter buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C269 || 105 || 1121 || Null ECI device key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C469 || 105 || 1122 || Null E-Ticket device key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D669 || 105 || 1131 || Null speaker parameter buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EA69 || 105 || 1141 || Null firmware version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EC69 || 105 || 1142 || Null firmware version digest buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EE69 || 105 || 1143 || Null rebootless system update version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8FE69 || 105 || 1151 || Null Mii author ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x91269 || 105 || 1161 || Null fatal flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x92669 || 105 || 1171 || Null auto update enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x93A69 || 105 || 1181 || Null external RTC reset flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x94E69 || 105 || 1191 || Null push notification activity mode buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x96269 || 105 || 1201 || Null service discovery control setting buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x97669 || 105 || 1211 || Null error report share permission buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x98A69 || 105 || 1221 || Null LCD vendor ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x99E69 || 105 || 1231 || Null console SixAxis sensor acceleration bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A069 || 105 || 1232 || Null console SixAxis sensor angular velocity bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A269 || 105 || 1233 || Null console SixAxis sensor acceleration gain buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A469 || 105 || 1234 || Null console SixAxis sensor angular velocity gain buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A669 || 105 || 1235 || Null console SixAxis sensor angular velocity time bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A869 || 105 || 1236 || Null console SixAxis sensor angular acceleration buffer &lt;br /&gt;
|-&lt;br /&gt;
| 0x9B269 || 105 || 1241 || Null keyboard layout buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9BA69 || 105 || 1245 || Invalid keyboard layout&lt;br /&gt;
|-&lt;br /&gt;
| 0x9C669 || 105 || 1251 || Null web inspector flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9C869 || 105 || 1252 || Null allowed SSL hosts buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9CA69 || 105 || 1253 || Null allowed SSL hosts entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9CC69 || 105 || 1254 || Null host FS mount point buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9EE69 || 105 || 1271 || Null Amiibo key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F069 || 105 || 1272 || Null Amiibo ECQV certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F269 || 105 || 1273 || Null Amiibo ECDSA certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F469 || 105 || 1274 || Null Amiibo ECQV BLS key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F669 || 105 || 1275 || Null Amiibo ECQV BLS certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F869 || 105 || 1276 || Null Amiibo ECQV BLS root certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xC72 || 114 || 6 || Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || 116 || 0 || Time service not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x274 || 116 || 1 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set / Clock Source Id mismatch&lt;br /&gt;
|-&lt;br /&gt;
| 0x19074 || 116 || 200 || Invalid time comparison&lt;br /&gt;
|-&lt;br /&gt;
| 0x19274 || 116 || 201 || Signed overflow/underflow&lt;br /&gt;
|-&lt;br /&gt;
| 0x64274 || 116 || 801 || Memory allocation failure&lt;br /&gt;
|-&lt;br /&gt;
| 0x70A74 || 116 || 901 || Null pointer&lt;br /&gt;
|-&lt;br /&gt;
| 0x70C74 || 116 || 902 || Value out of valid range&lt;br /&gt;
|-&lt;br /&gt;
| 0x70E74 || 116 || 903 || TimeZoneRule conversion failed&lt;br /&gt;
|-&lt;br /&gt;
| 0x7BA74 || 116 || 989 || TimeZone location name not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x7BC74 || 116 || 990 || Unimplemented functionality&lt;br /&gt;
|-&lt;br /&gt;
| 0xC79 || 121 || 6 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x27A || 122 || 1 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x47A || 122 || 2 || Object not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x67A || 122 || 3 || Object locked/in used&lt;br /&gt;
|-&lt;br /&gt;
| 0x87A || 122 || 4 || Target already mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0xA7A || 122 || 5 || Target not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0xC7A || 122 || 6 || Object already opened&lt;br /&gt;
|-&lt;br /&gt;
| 0xE7A || 122 || 7 || Object not opened&lt;br /&gt;
|-&lt;br /&gt;
| 0x107A || 122 || 8 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA07A || 122 || 80 || Passphrase not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA27A || 122 || 81 || Data verification failed&lt;br /&gt;
|-&lt;br /&gt;
| 0xB47A || 122 || 90 || Invalid API call&lt;br /&gt;
|-&lt;br /&gt;
| 0xC47A || 122 || 98 || Invalid operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x167B || 123 || 11 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8192 (SEC_ERROR_IO), -8191 (SEC_ERROR_LIBRARY_FAILURE), -8190 (SEC_ERROR_BAD_DATA), -8189 (SEC_ERROR_OUTPUT_LEN), -8188 (SEC_ERROR_INPUT_LEN), -8187 (SEC_ERROR_INVALID_ARGS), -8186 (SEC_ERROR_INVALID_ALGORITHM), -8184 (SEC_ERROR_INVALID_TIME), -8152 (SEC_ERROR_INVALID_KEY).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] errors: -5991 (PR_IO_ERROR), -5962 (PR_BUFFER_OVERFLOW_ERROR), -5950 (PR_FILE_NOT_FOUND_ERROR), -5949 (PR_NOT_DIRECTORY_ERROR), -5946 (PR_FILESYSTEM_MOUNTED_ERROR), -5938 (PR_END_OF_FILE_ERROR).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12223 (SSL_ERROR_GENERATE_RANDOM_FAILURE), -12222 (SSL_ERROR_SIGN_HASHES_FAILURE), -12221 (SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE), -12219 (SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE), -12218 (SSL_ERROR_ENCRYPTION_FAILURE), -12217 (SSL_ERROR_DECRYPTION_FAILURE), -12216 (SSL_ERROR_SOCKET_WRITE_FAILURE), -12212 (SSL_ERROR_SYM_KEY_CONTEXT_FAILURE), -12209 (SSL_ERROR_IV_PARAM_FAILURE), -12207 (SSL_ERROR_SESSION_KEY_GEN_FAILURE), -12203 (SSL_ERROR_NO_COMPRESSION_OVERLAP), -12202 (SSL_ERROR_HANDSHAKE_NOT_COMPLETED), -12201 (SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE), -12172 (SSL_ERROR_NEXT_PROTOCOL_DATA_INVALID).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A7B || 123 || 13 || Unrecognized error.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC7B || 123 || 102 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8173 (SEC_ERROR_NO_MEMORY).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] errors: -6000 (PR_OUT_OF_MEMORY_ERROR), -5974 (PR_INSUFFICIENT_RESOURCES_ERROR, -5971 (PR_PROC_DESC_TABLE_FULL_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0xE87B || 123 || 116 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5999 (PR_BAD_DESCRIPTOR_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1027B || 123 || 129 || DER CRL decoding failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1987B || 123 || 204 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5998 (PR_WOULD_BLOCK_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19A7B || 123 || 205 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5990 (PR_IO_TIMEOUT_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19C7B || 123 || 206 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5935 (PR_OPERATION_ABORTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A07B || 123 || 208 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5978 (PR_NOT_CONNECTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A27B || 123 || 209 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5961 (PR_CONNECT_RESET_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A47B || 123 || 210 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5928 (PR_CONNECT_ABORTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A67B || 123 || 211 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5929 (PR_SOCKET_SHUTDOWN_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A87B || 123 || 212 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5930 (PR_NETWORK_DOWN_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1AE7B || 123 || 215 || ClientPki/InternalPki was already previously imported/registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B47B || 123 || 218 || Maximum number of ServerPki objects were already imported.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A7B || 123 || 301 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12276 (SSL_ERROR_BAD_CERT_DOMAIN).&lt;br /&gt;
|-&lt;br /&gt;
| 0x25C7B || 123 || 302 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12285 (SSL_ERROR_NO_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x25E7B || 123 || 303 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8181 (SEC_ERROR_EXPIRED_CERTIFICATE), -8162 (SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2607B || 123 || 304 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8180 (SEC_ERROR_REVOKED_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2627B || 123 || 305 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8183 (SEC_ERROR_BAD_DER).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2647B || 123 || 306 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8102 (SEC_ERROR_INADEQUATE_KEY_USAGE), -8101 (SEC_ERROR_INADEQUATE_CERT_TYPE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2667B || 123 || 307 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8185 (SEC_ERROR_INVALID_AVA), -8182 (SEC_ERROR_BAD_SIGNATURE), -8158 (SEC_ERROR_EXTENSION_VALUE_INVALID), -8156 (SEC_ERROR_CA_CERT_INVALID), -8151 (SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION), -8080 (SEC_ERROR_CERT_NOT_IN_NAME_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2687B || 123 || 308 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8179 (SEC_ERROR_UNKNOWN_ISSUER), -8172 (SEC_ERROR_UNTRUSTED_ISSUER), -8014 (SEC_ERROR_APPLICATION_CALLBACK_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A7B || 123 || 309 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8171 (SEC_ERROR_UNTRUSTED_CERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C7B || 123 || 310 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12233 (SSL_ERROR_RX_UNKNOWN_RECORD_TYPE), -12232 (SSL_ERROR_RX_UNKNOWN_HANDSHAKE), -12231 (SSL_ERROR_RX_UNKNOWN_ALERT). This is also returned by ImportClientPki when import fails.&lt;br /&gt;
|-&lt;br /&gt;
| 0x26E7B || 123 || 311 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12261 (SSL_ERROR_RX_MALFORMED_HELLO_REQUEST), -12260 (SSL_ERROR_RX_MALFORMED_CLIENT_HELLO), -12259 (SSL_ERROR_RX_MALFORMED_SERVER_HELLO), -12258 (SSL_ERROR_RX_MALFORMED_CERTIFICATE), -12257 (SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH), -12256 (SSL_ERROR_RX_MALFORMED_CERT_REQUEST), -12255 (SSL_ERROR_RX_MALFORMED_HELLO_DONE), -12254 (SSL_ERROR_RX_MALFORMED_CERT_VERIFY), -12253 (SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH), -12252 (SSL_ERROR_RX_MALFORMED_FINISHED), -12251 (SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER), -12250 (SSL_ERROR_RX_MALFORMED_ALERT), -12249 (SSL_ERROR_RX_MALFORMED_HANDSHAKE), -12248 (SSL_ERROR_RX_MALFORMED_APPLICATION_DATA), -12166 (SSL_ERROR_RX_MALFORMED_HELLO_VERIFY_REQUEST).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2707B || 123 || 312 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8144 (SEC_ERROR_UNSUPPORTED_KEYALG).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12274 (SSL_ERROR_SSL2_DISABLED), -12247 (SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST), -12246 (SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO), -12245 (SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO), -12244 (SSL_ERROR_RX_UNEXPECTED_CERTIFICATE), -12243 (SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH), -12242 (SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST), -12241 (SSL_ERROR_RX_UNEXPECTED_HELLO_DONE), -12240 (SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY), -12239 (SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH), -12238 (SSL_ERROR_RX_UNEXPECTED_FINISHED).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2727B || 123 || 313 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12237 (SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER), -12236 (SSL_ERROR_RX_UNEXPECTED_ALERT), -12235 (SSL_ERROR_RX_UNEXPECTED_HANDSHAKE), -12234 (SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2747B || 123 || 314 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2767B || 123 || 315 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12165 (SSL_ERROR_RX_UNEXPECTED_HELLO_VERIFY_REQUEST).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2787B || 123 || 316 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12163 (SSL_ERROR_RX_UNEXPECTED_CERT_STATUS).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27A7B || 123 || 317 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12160 (SSL_ERROR_INCORRECT_SIGNATURE_ALGORITHM).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27C7B || 123 || 318 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12173 (SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY), -12156 (SSL_ERROR_WEAK_SERVER_CERT_KEY).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27E7B || 123 || 319 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12273 (SSL_ERROR_BAD_MAC_READ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2827B || 123 || 321 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12215 (SSL_ERROR_MD5_DIGEST_FAILURE), -12214 (SSL_ERROR_SHA_DIGEST_FAILURE), -12161 (SSL_ERROR_DIGEST_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2847B || 123 || 322 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12213 (SSL_ERROR_MAC_COMPUTATION_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2887B || 123 || 324 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8157 (SEC_ERROR_EXTENSION_NOT_FOUND).&lt;br /&gt;
|-&lt;br /&gt;
| 0x28A7B || 123 || 325 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8049 (SEC_ERROR_UNRECOGNIZED_OID).&lt;br /&gt;
|-&lt;br /&gt;
| 0x28C7B || 123 || 326 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8032 (SEC_ERROR_POLICY_VALIDATION_FAILED).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2947B || 123 || 330 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12177 (SSL_ERROR_DECOMPRESSION_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBA7B || 123 || 1501 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12230 (SSL_ERROR_CLOSE_NOTIFY_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBC7B || 123 || 1502 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12229 (SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBE7B || 123 || 1503 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12272 (SSL_ERROR_BAD_MAC_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC07B || 123 || 1504 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12197 (SSL_ERROR_DECRYPTION_FAILED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC27B || 123 || 1505 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12196 (SSL_ERROR_RECORD_OVERFLOW_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC47B || 123 || 1506 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12228 (SSL_ERROR_DECOMPRESSION_FAILURE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC67B || 123 || 1507 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12227 (SSL_ERROR_HANDSHAKE_FAILURE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCA7B || 123 || 1509 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12271 (SSL_ERROR_BAD_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCC7B || 123 || 1510 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12225 (SSL_ERROR_UNSUPPORTED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCE7B || 123 || 1511 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12270 (SSL_ERROR_REVOKED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD07B || 123 || 1512 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12269 (SSL_ERROR_EXPIRED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD27B || 123 || 1513 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12224 (SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD47B || 123 || 1514 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12226 (SSL_ERROR_ILLEGAL_PARAMETER_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD67B || 123 || 1515 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12195 (SSL_ERROR_UNKNOWN_CA_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD87B || 123 || 1516 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12194 (SSL_ERROR_ACCESS_DENIED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDA7B || 123 || 1517 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12193 (SSL_ERROR_DECODE_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDC7B || 123 || 1518 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12192 (SSL_ERROR_DECRYPT_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDE7B || 123 || 1519 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12191 (SSL_ERROR_EXPORT_RESTRICTION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE07B || 123 || 1520 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12190 (SSL_ERROR_PROTOCOL_VERSION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE27B || 123 || 1521 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12189 (SSL_ERROR_INSUFFICIENT_SECURITY_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE47B || 123 || 1522 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12188 (SSL_ERROR_INTERNAL_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE67B || 123 || 1523 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12157 (SSL_ERROR_INAPPROPRIATE_FALLBACK_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE87B || 123 || 1524 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12187 (SSL_ERROR_USER_CANCELED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEA7B || 123 || 1525 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12186 (SSL_ERROR_NO_RENEGOTIATION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEC7B || 123 || 1526 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12184 (SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEE7B || 123 || 1527 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12183 (SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF07B || 123 || 1528 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12182 (SSL_ERROR_UNRECOGNIZED_NAME_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF27B || 123 || 1529 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12181 (SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF47B || 123 || 1530 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12180 (SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27127B || 123 || 5001 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12155 (SSL_ERROR_RX_SHORT_DTLS_READ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x271E7B || 123 || 5007 || Out-of-bounds error during error conversion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x767C || 124 || 59 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 3000 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/27166/ System Update Required]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 3001 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28969/ Game Update Required]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4007 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28046/ Account Permanent Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4508 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28046/ Account Permanent Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4517 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/43652/ Account Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4609 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/46482/ Service Discontinued]&lt;br /&gt;
|-&lt;br /&gt;
| 0x27E || 126 || 1 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x87E || 126 || 4 || Entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE7E || 126 || 67 || Invalid database signature value (should be &amp;quot;NFDB&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD27E || 126 || 69 || Invalid database entry count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1987E || 126 || 204 || Development/debug-only behavior&lt;br /&gt;
|-&lt;br /&gt;
| 0x480 || 128 || 2 || IStorage not available.&lt;br /&gt;
|-&lt;br /&gt;
| 0x680 || 128 || 3 || No messages&lt;br /&gt;
|-&lt;br /&gt;
| 0x4680 || 128 || 35 || Error while launching applet.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A80 || 128 || 37 || Title-ID not found. Caused by code 0x410 when applet launch fails&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E880 || 128 || 500 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC80 || 128 || 502 || IStorage has already been opened by another accessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE80 || 128 || 503 || IStorage Read/Write out-of-bounds&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F480 || 128 || 506 || Invalid parameters&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FE80 || 128 || 511 || IStorage opened as wrong type (data opened as transfermem, transfermem opened as data)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40080 || 128 || 512 || Unbalanced fatal section leave (returned when executing LeaveFatalSection without a preceding EnterFatalSection call)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40C80 || 128 || 518 || Null object&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B080 || 128 || 600 || Failed to allocate memory for IStorage&lt;br /&gt;
|-&lt;br /&gt;
| 0x59080 || 128 || 712 || Thread stack pool exhausted (out of memory)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79C80 || 128 || 974 || DebugMode not enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 980 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set / DebugMode not enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x7CC80 || 128 || 998 || Not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC81 || 129 || 102 || Transmission not agreed&lt;br /&gt;
|-&lt;br /&gt;
| 0xD281 || 129 || 105 || Network unavailable&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DA81 || 129 || 1005 || HTTP error: Couldnt resolve proxy&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DC81 || 129 || 1006 || HTTP error: Couldnt resolve host&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DE81 || 129 || 1007 || HTTP error: Couldnt connect&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE81 || 129 || 1023 || HTTP error: Write error&lt;br /&gt;
|-&lt;br /&gt;
| 0x80481 || 129 || 1026 || HTTP error: Read error&lt;br /&gt;
|-&lt;br /&gt;
| 0x80681 || 129 || 1027 || HTTP error: Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x80881 || 129 || 1028 || HTTP error: Operation timedout&lt;br /&gt;
|-&lt;br /&gt;
| 0x81681 || 129 || 1035 || HTTP error: SSL connect error&lt;br /&gt;
|-&lt;br /&gt;
| 0x83681 || 129 || 1051 || HTTP error: Peer failed verification&lt;br /&gt;
|-&lt;br /&gt;
| 0x83881 || 129 || 1052 || HTTP error: Got nothing&lt;br /&gt;
|-&lt;br /&gt;
| 0x83E81 || 129 || 1055 || HTTP error: Send error&lt;br /&gt;
|-&lt;br /&gt;
| 0x84081 || 129 || 1056 || HTTP error: Recv error&lt;br /&gt;
|-&lt;br /&gt;
| 0x84481 || 129 || 1058 || HTTP error: SSL cert problem&lt;br /&gt;
|-&lt;br /&gt;
| 0x84681 || 129 || 1059 || HTTP error: SSL cipher&lt;br /&gt;
|-&lt;br /&gt;
| 0x84881 || 129 || 1060 || HTTP error: SSL CA cert&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C081 || 129 || 2400 || Server error: Status 400&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C281 || 129 || 2401 || Server error: Status 401&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C681 || 129 || 2403 || Server error: Status 403&lt;br /&gt;
|-&lt;br /&gt;
| 0x138881 || 129 || 2500 || Server error: Status 500&lt;br /&gt;
|-&lt;br /&gt;
| 0x138E81 || 129 || 2503 || Server error: Status 503&lt;br /&gt;
|-&lt;br /&gt;
| 0x139081 || 129 || 2504 || Server error: Status 504&lt;br /&gt;
|-&lt;br /&gt;
| 0xA83 || 131 || 5 || Unrecognized applet ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x485 || 133 || 2 || Invalid DVFS table ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x685 || 133 || 3 || DVFS table ID for debug only, see [[PCV_services#Module|DVFS Table]] notes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x885 || 133 || 4 || Invalid parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x1489 || 137 || 10 || Already initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C89 || 137 || 30 || Task not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5089 || 137  || 40 || Memory allocation failed / bad input.&lt;br /&gt;
|-&lt;br /&gt;
| 0x29489 || 137 || 330 || [[NCM_services#ContentMetaType|ContentMetaType]] doesn&#039;t match SystemUpdate.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271289 || 137 || 5001 || One of the following socket errors occurred: ENETDOWN, ECONNRESET, EHOSTDOWN, EHOSTUNREACH, or EPIPE. Also occurs when the received size doesn&#039;t match the expected size (recvfrom() ret with [[NIM_services#Contents_Delivery|meta_size]] data receiving).&lt;br /&gt;
|-&lt;br /&gt;
| 0x272489 || 137 || 5010 || Socket was [[Sockets_services|shutdown()]] due to the async operation being cancelled.&lt;br /&gt;
|-&lt;br /&gt;
| 0x273889 || 137 || 5020 || Too many internal output entries with [[NIM_services|nim]] cmd42, system is [[NIM_services#Contents_Delivery|Internet-connected]], or an unrecognized socket error occured.&lt;br /&gt;
|-&lt;br /&gt;
| 0x27D889 || 137 || 5100 || Connection timeout.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A4489 || 137 || 5410 || Invalid [[NIM_services#Contents_Delivery|ID]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A5889 || 137 || 5420 || Invalid [[NIM_services#Contents_Delivery|magicnum]]. Can also be caused by the connection being closed by the peer, since non-negative return values from recv() are ignored in this case.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A6C89 || 137 || 5430 || Invalid [[NIM_services#Contents_Delivery|data_size]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A8089 || 137 || 5440 || The input [[NCM_services#ContentMetaKey|ContentMetaKey]] doesn&#039;t match the ContentMetaKey in state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A9489 || 137 || 5450 || Invalid [[NIM_services#Contents_Delivery|meta_size]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B289 || 137 || 7001 || HTTP invalid response code (&amp;gt;=600).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B489 || 137 || 7002 || HTTP invalid client response code (4xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B689 || 137 || 7003 || HTTP invalid server response code (5xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B889 || 137 || 7004 || HTTP invalid redirect response code (3xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x390889-0x391889 || 137 || 7300-7308 || HTTP response code 300-308.&lt;br /&gt;
|-&lt;br /&gt;
| 0x39D089-0x39F289 || 137 || 7400-7417 || HTTP response code 400-417.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A9889-0x3AAA89 || 137 || 7500-7509 || HTTP response code 500-509.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E8289-0x3F4089 || 137 || 8001-8096 || libcurl error 1-96. Some of the libcurl errors in the error-table map to the above unknown-libcurl-error however.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68A || 138 || 3 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BE8E || 142 || 223 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x290 || 144 || 1 || Exited Abnormally ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Abormal)&lt;br /&gt;
|-&lt;br /&gt;
| 0x690 || 144 || 3 || Canceled ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Canceled)&lt;br /&gt;
|-&lt;br /&gt;
| 0x890 || 144 || 4 || Rejected&lt;br /&gt;
|-&lt;br /&gt;
| 0xA90 || 144 || 5 || Exited Unexpectedly ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Unexpected)&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Operation couldn&#039;t complete successfully&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x899 || 153 || 4 || Buffer size too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x1099 || 153 || 8 || Too many buffers are still unreleased&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0x40299 || 153 || 513 || Invalid/Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0099 || 153 || 1536 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x49E || 158 || 2 || BootImagePackage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x69E || 158 || 3 || Invalid BootImagePackage&lt;br /&gt;
|-&lt;br /&gt;
| 0x89E || 158 || 4 || Work buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0xA9E || 158 || 5 || Work buffer not aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0xC9E || 158 || 6 || BootImages need repair&lt;br /&gt;
|-&lt;br /&gt;
| 0x29F || 159 || 1 || Cancel was selected&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA3 || 163 ||  5 || System is booting up repair process without VOL+ held down.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA3 || 163 || 6 || System is booting up repair process that requires RepairTimeReviser but does not have special cartridge inserted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x70A4 || 164 || 56 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4AF || 175 || 2 || Bad version returned from calling the &amp;quot;nnjitpluginGetVersion&amp;quot; symbol.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCAAF || 175 || 101 || Input NRO/NRR are too large for the storage buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B0AF || 175 || 600 || Symbol funcptr used by this cmd is not initialized (Control/GenerateCode).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B2AF || 175 || 601 || DllPlugin Not initialized, or plugin NRO has already been loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B4AF || 175 || 602 || An error was returned from calling the symbol funcptr with the Control cmd.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8B2 || 178 || 100 || Invalid user ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xCAB2 || 178 || 101 || User does not exist&lt;br /&gt;
|-&lt;br /&gt;
| 0x12CB2 || 178 || 150 || Service unavailable&lt;br /&gt;
|-&lt;br /&gt;
| 0x190B2 || 178 || 200 || File storage failure&lt;br /&gt;
|-&lt;br /&gt;
| 0xAB4 || 180 || 5 || Invalid event ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4EB5 || 181 || 4007 || Device authentication error: System update required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F50B5 || 181 || 4008 || Device authentication error: [https://en-americas-support.nintendo.com/app/answers/detail/a_id/42061/ Permanant Ban]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F52B5 || 181 || 4009 || Device authentication error: Internal server error&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F54B5 || 181 || 4007 || Device authentication error: Under maintenance&lt;br /&gt;
|-&lt;br /&gt;
|  || 181 || 4017 || Device authentication error: [https://en-americas-support.nintendo.com/app/answers/detail/a_id/43653/ Ban]&lt;br /&gt;
|-&lt;br /&gt;
| 0x58ACA || 202 || 709 || Npad ID is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2032CA || 202 || 4121 || [[Settings_services#ButtonConfigSettings|ButtonConfigSettings]] IsFull flag is clear.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28CB || 203 || 20 || The [6.0.0+] Authentication challenge failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40CB || 203 || 32 || Bad State / bad state ptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82CB || 203 || 65 || Failed to connect to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x84CB || 203 || 66 || Timeout occured during Authentication / while attempting to find a valid ActionFrame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86CB || 203 || 67 || Maximum participants reached, Station not allowed to connect, ...&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0CB || 203 || 96 || Bad input, or not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC2CB || 203 || 97 || Matching LocalCommunicationId not found in the user-process [[NACP_Format|control.nacp]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xE2CB || 203 || 113 || The specified LocalCommunicationVersion is less than the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4CB || 203 || 114 || The specified LocalCommunicationVersion is larger than the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF0CD || 205 || 120 || IR image data not available/ready.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A8CD || 205 || 212 || IR camera handle pointer is null.&lt;br /&gt;
|-&lt;br /&gt;
| 0x198CD || 205 || 204 || IR camera invalid handle value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE || 206 || 2 || Invalid argument.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6CE || 206 || 3 || Out of memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10CE || 206 || 8 || Out of range. Buffer needs to be aligned.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18CE || 206 || 12 || Invalid FileId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1ACE || 206 || 13 || Invalid storage ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1CCE || 206 || 14 || Invalid content type.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2ACE || 206 || 21 || Failed to mount Image Directory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2CCE || 206 || 23 || File too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30CE || 206 || 24 || Invalid file size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CCE || 206 || 30 || Buffer insufficient.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAF2CE || 206 || 1401 || Too many files already saved.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4DA || 218 || 2 || StatusManager entry IsValid flag not set, or controller-update currently in-progress.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6DA || 218 || 3 || Controller-update failed via the LibraryApplet.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8DA || 218 || 4 || Invalid BusHandle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xADA || 218 || 5 || StatusManager entry flag +0x0 not set, or device not connected.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEDA || 218 || 7 || PollingReceivedData not available.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10DA || 218 || 8 || StatusManager entry DeviceEnabled flag not set, or flag +0x0 not set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12DA || 218 || 9 || ExternalDeviceId mismatch.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14DA || 218 || 10 || BusHandle already initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x104E7 || 231 || 130 || Nullptr passed to the LocalCommunicationId [[NACP_Format|control.nacp]] validation func.&lt;br /&gt;
|-&lt;br /&gt;
| 0x140E7 || 231 || 160 || GroupInfo field out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x142E7 || 231 || 161 || SupportedPlatform not appropriate for this operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x146E7 || 231 || 163 || Invalid ServiceName.&lt;br /&gt;
|-&lt;br /&gt;
| 0x148E7 || 231 || 164 || Must provide PresharedBinaryKey.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C0E7 || 231 || 224 || Requested Priority value not allowed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C2E7 || 231 || 225 || Matching LocalCommunicationId not found in the user-process [[NACP_Format|control.nacp]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x200E7 || 231 || 256 || Invalid flag.&lt;br /&gt;
|-&lt;br /&gt;
| 0x204E7 || 231 || 258 || Invalid SupportedPlatform.&lt;br /&gt;
|-&lt;br /&gt;
| 0x208E7 || 231 || 260 || Invalid StaticAesKeyIndex.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20AE7 || 231 || 261 || MemberCountMax cannot be greater than 8.&lt;br /&gt;
|-&lt;br /&gt;
| 0x210E7 || 231 || 264 || GroupInfo+8F must be 0x20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== FS Error codes ===&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || nn::svc::ResultInvalidCurrentMemory: Error: Passed buffer is not usable for fs library. See a manual of fs library for more information.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || nn::fs::ResultMountNameAlreadyExists: Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || nn::fs::ResultPartitionNotFound: Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || nn::fs::ResultTargetNotFound: Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || nn::fs::ResultSdCardAccessFailed: Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || nn::fs::ResultGameCardAccessFailed: Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || nn::fs::ResultNotImplemented: Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || nn::fs::ResultOutOfRange: Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x190002 - 0x1B5602 || 3200 - 3499 || nn::fs::ResultAllocationMemoryFailed: Error: Failed to allocate memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || nn::fs::ResultMmcAccessFailed: Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || nn::fs::ResultRomCorrupted: Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || nn::fs::ResultSaveDataCorrupted: Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || nn::fs::ResultNcaCorrupted: Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || nn::fs::ResultIntegrityVerificationStorageCorrupted: Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || nn::fs::ResultPartitionFileSystemCorrupted: Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || nn::fs::ResultBuiltInStorageCorrupted: Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || nn::fs::ResultFatFileSystemCorrupted: Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || nn::fs::ResultHostFileSystemCorrupted: Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || nn::fs::ResultDataCorrupted: Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || nn::fs::ResultUnexpected: Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 - 0x32C602 || 6000-6499 || nn::fs::ResultPreconditionViolation: Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || nn::fs::ResultInvalidArgument: Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || nn::fs::ResultInvalidPath: Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 6003 || nn::fs::ResultTooLongPath: Error: Too long path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE802 || 6004 || nn::fs::ResultInvalidCharacter: Error: Invalid path character was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 6005 || nn::fs::ResultInvalidPathFormat: Error: Invalid path format was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || nn::fs::ResultInvalidOffset: Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || nn::fs::ResultInvalidSize: Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || nn::fs::ResultNullptrArgument: Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6202 || 6065 || nn::fs::ResultInvalidMountName: Error: Invalid mount name was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6402 || 6066 || nn::fs::ResultExtensionSizeTooLarge: Error: Extension size exceeds max value set in nmeta file.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6602 || 6067 || nn::fs::ResultExtensionSizeInvalid: Error: Extension size is not a multiple of nn::fs::SaveDataExtensionUnitSize.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || nn::fs::ResultFileExtensionWithoutOpenModeAllowAppend: Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || nn::fs::ResultInvalidOperationForOpenMode: Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || nn::fs::ResultUnsupportedOperation: Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x326202 || 6400-6449 || nn::fs::ResultPermissionDenied: Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x327202 || 6457 || nn::fs::ResultWriteModeFileNotClosed: Error: Close files opened in write mode before committing.&lt;br /&gt;
|-&lt;br /&gt;
| 0x328202 || 6465 || nn::fs::ResultUserNotExist: Error: Specified user doesn&#039;t exist.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || nn::fs::ResultMappingTableFull: Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || nn::fs::ResultOpenCountLimit: Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x353602 || 6811 || nn::fs::ResultMapFull: Error: Save data extension count reached the limitation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x35F202 || 6905 || nn::fs::ResultNotMounted: Error: Specified mount name is not found.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no effect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| Userland ARM data abort. Also caused by abnormal process termination via [[SVC|svcExitProcess]]. Note: directly jumping to nnMain()-retaddr from non-main-thread has the same result.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
This section is for Support Errors displayed by the error-applet, separate from the normal Result Errors.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 520 || Nverpt&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
== Error codes ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;br /&gt;
&lt;br /&gt;
= Homebrew Errors =&lt;br /&gt;
Custom errors used by homebrew libraries and applications.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx NVIDIA errors&lt;br /&gt;
|-&lt;br /&gt;
| 349 || libnx Binder errors&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
	<entry>
		<id>https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=10619</id>
		<title>Error codes</title>
		<link rel="alternate" type="text/html" href="https://switchbrew.org/w/index.php?title=Error_codes&amp;diff=10619"/>
		<updated>2021-01-29T18:45:48Z</updated>

		<summary type="html">&lt;p&gt;CFSworks: /* Error codes */ Add a couple of HIPC server error codes I discovered&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Structure =&lt;br /&gt;
These have been redesigned from the 3DS so that they fit within a Aarch64 MOV instruction immediate most of the time (without requiring the additional MOVK).&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Bits || Field&lt;br /&gt;
|-&lt;br /&gt;
| 8-0 || Module&lt;br /&gt;
|-&lt;br /&gt;
| 21-9 || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
When a fatal-error is received the error code is outputted using the following formatter:&lt;br /&gt;
  %04d-%04d&lt;br /&gt;
&lt;br /&gt;
.. where the first code is &amp;lt;code&amp;gt;2000 + Module&amp;lt;/code&amp;gt;, and the other being &amp;lt;code&amp;gt;Description&amp;lt;/code&amp;gt;. Bits &amp;gt;=22 from the error-code are unused when displaying fatal-errors, since the Description ends with bit21.&lt;br /&gt;
&lt;br /&gt;
= Result Errors =&lt;br /&gt;
General errors used by system modules and applications.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Kernel&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Fs&lt;br /&gt;
|-&lt;br /&gt;
| 3 || OS&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Htcs&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Ncm&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Dd&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Dmnt&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Lr&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Loader&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Cmif&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Hipc&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Pm&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Ns&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Bsdsockets&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Htc&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Tsc&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Ncm (content)&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Sm&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Ro (userland)&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Gc&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Sdmmc&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Ovln&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Spl&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Socket&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Htclow&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Ddsf&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Htcfs&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Async&lt;br /&gt;
|-&lt;br /&gt;
| 100 || Ethc&lt;br /&gt;
|-&lt;br /&gt;
| 101 || I2c&lt;br /&gt;
|-&lt;br /&gt;
| 102 || Gpio&lt;br /&gt;
|-&lt;br /&gt;
| 103 || Uart&lt;br /&gt;
|-&lt;br /&gt;
| 105 || Settings&lt;br /&gt;
|-&lt;br /&gt;
| 107 || Wlan&lt;br /&gt;
|-&lt;br /&gt;
| 108 || Xcd&lt;br /&gt;
|-&lt;br /&gt;
| 110 || Nifm&lt;br /&gt;
|-&lt;br /&gt;
| 111 || Hwopus&lt;br /&gt;
|-&lt;br /&gt;
| 112 || Sasbus&lt;br /&gt;
|-&lt;br /&gt;
| 113 || Bluetooth&lt;br /&gt;
|-&lt;br /&gt;
| 114 || Vi&lt;br /&gt;
|-&lt;br /&gt;
| 115 || Nfp&lt;br /&gt;
|-&lt;br /&gt;
| 116 || Time&lt;br /&gt;
|-&lt;br /&gt;
| 117 || Fgm&lt;br /&gt;
|-&lt;br /&gt;
| 118 || Oe&lt;br /&gt;
|-&lt;br /&gt;
| 120 || Pcie&lt;br /&gt;
|-&lt;br /&gt;
| 121 || Friends&lt;br /&gt;
|-&lt;br /&gt;
| 122 || Bcat&lt;br /&gt;
|-&lt;br /&gt;
| 123 || Ssl&lt;br /&gt;
|-&lt;br /&gt;
| 124 || Account&lt;br /&gt;
|-&lt;br /&gt;
| 125 || News&lt;br /&gt;
|-&lt;br /&gt;
| 126 || Mii&lt;br /&gt;
|-&lt;br /&gt;
| 127 || Nfc&lt;br /&gt;
|-&lt;br /&gt;
| 128 || Am&lt;br /&gt;
|-&lt;br /&gt;
| 129 || Prepo&lt;br /&gt;
|-&lt;br /&gt;
| 130 || Ahid&lt;br /&gt;
|-&lt;br /&gt;
| 132 || Qlaunch&lt;br /&gt;
|-&lt;br /&gt;
| 133 || Pcv&lt;br /&gt;
|-&lt;br /&gt;
| 134 || Omm&lt;br /&gt;
|-&lt;br /&gt;
| 135 || Bpc&lt;br /&gt;
|-&lt;br /&gt;
| 136 || Psm&lt;br /&gt;
|-&lt;br /&gt;
| 137 || Nim&lt;br /&gt;
|-&lt;br /&gt;
| 138 || Psc&lt;br /&gt;
|-&lt;br /&gt;
| 139 || Tc&lt;br /&gt;
|-&lt;br /&gt;
| 140 || Usb&lt;br /&gt;
|-&lt;br /&gt;
| 141 || Nsd&lt;br /&gt;
|-&lt;br /&gt;
| 142 || Pctl&lt;br /&gt;
|-&lt;br /&gt;
| 143 || Btm&lt;br /&gt;
|-&lt;br /&gt;
| 144 || La&lt;br /&gt;
|-&lt;br /&gt;
| 145 || ETicket&lt;br /&gt;
|-&lt;br /&gt;
| 146 || Ngc&lt;br /&gt;
|-&lt;br /&gt;
| 147 || Erpt&lt;br /&gt;
|-&lt;br /&gt;
| 148 || Apm&lt;br /&gt;
|-&lt;br /&gt;
| 149 || Cec&lt;br /&gt;
|-&lt;br /&gt;
| 150 || Profiler&lt;br /&gt;
|-&lt;br /&gt;
| 151 || Eupld&lt;br /&gt;
|-&lt;br /&gt;
| 153 || Audio&lt;br /&gt;
|-&lt;br /&gt;
| 154 || Npns&lt;br /&gt;
|-&lt;br /&gt;
| 155 || Npns XMPP stream&lt;br /&gt;
|-&lt;br /&gt;
| 157 || Arp&lt;br /&gt;
|-&lt;br /&gt;
| 158 || Updater&lt;br /&gt;
|-&lt;br /&gt;
| 159 || Swkbd&lt;br /&gt;
|-&lt;br /&gt;
| 161 || Mifare&lt;br /&gt;
|-&lt;br /&gt;
| 162 || Userland (assert)&lt;br /&gt;
|-&lt;br /&gt;
| 163 || Fatal&lt;br /&gt;
|-&lt;br /&gt;
| 164 || Ec (shop)&lt;br /&gt;
|-&lt;br /&gt;
| 165 || Spsm&lt;br /&gt;
|-&lt;br /&gt;
| 167 || Bgtc&lt;br /&gt;
|-&lt;br /&gt;
| 168 || Userland (crash)&lt;br /&gt;
|-&lt;br /&gt;
| 169 || Sasbus periodic receive mode&lt;br /&gt;
|-&lt;br /&gt;
| 175 || Jit&lt;br /&gt;
|-&lt;br /&gt;
| 177 || Hdcp&lt;br /&gt;
|-&lt;br /&gt;
| 178 || Pdm&lt;br /&gt;
|-&lt;br /&gt;
| 179 || Olsc&lt;br /&gt;
|-&lt;br /&gt;
| 180 || Srepo&lt;br /&gt;
|-&lt;br /&gt;
| 181 || Dauth&lt;br /&gt;
|-&lt;br /&gt;
| 187 || Sasbus&lt;br /&gt;
|-&lt;br /&gt;
| 189 || Pwm&lt;br /&gt;
|-&lt;br /&gt;
| 191 || Rtc&lt;br /&gt;
|-&lt;br /&gt;
| 192 || Regulator&lt;br /&gt;
|-&lt;br /&gt;
| 193 || Led&lt;br /&gt;
|-&lt;br /&gt;
| 197 || Clkrst&lt;br /&gt;
|-&lt;br /&gt;
| 198 || Powctl&lt;br /&gt;
|-&lt;br /&gt;
| 202 || Hid&lt;br /&gt;
|-&lt;br /&gt;
| 203 || Ldn&lt;br /&gt;
|-&lt;br /&gt;
| 204 || Cs&lt;br /&gt;
|-&lt;br /&gt;
| 205 || Irsensor&lt;br /&gt;
|-&lt;br /&gt;
| 206 || Capture&lt;br /&gt;
|-&lt;br /&gt;
| 208 || Manu&lt;br /&gt;
|-&lt;br /&gt;
| 209 || Atk&lt;br /&gt;
|-&lt;br /&gt;
| 210 || Web&lt;br /&gt;
|-&lt;br /&gt;
| 211 || Lcs&lt;br /&gt;
|-&lt;br /&gt;
| 212 || Grc&lt;br /&gt;
|-&lt;br /&gt;
| 214 || Album&lt;br /&gt;
|-&lt;br /&gt;
| 216 || Migration&lt;br /&gt;
|-&lt;br /&gt;
| 217 || Migration idc server&lt;br /&gt;
|-&lt;br /&gt;
| 218 || Hidbus&lt;br /&gt;
|-&lt;br /&gt;
| 223 || Websocket&lt;br /&gt;
|-&lt;br /&gt;
| 227 || Capmtp&lt;br /&gt;
|-&lt;br /&gt;
| 228 || Pgl&lt;br /&gt;
|-&lt;br /&gt;
| 229 || Notification&lt;br /&gt;
|-&lt;br /&gt;
| 230 || Ins&lt;br /&gt;
|-&lt;br /&gt;
| 231 || Lp2p&lt;br /&gt;
|-&lt;br /&gt;
| 244 || Dp2hdmi&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Error codes ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0x0E01 || 1 || 7 || Session count exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C01 || 1 || 14 || Invalid kernel capability descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x4201 || 1 || 33 || Not Implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0x7601 || 1 || 59 || Thread terminated/termination requested&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C01 || 1 || 70 || No more debug events&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA01 || 1 || 101 || Invalid size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC01 || 1 || 102 || Invalid address&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE01 || 1 || 103 || Resource exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD001 || 1 || 104 || Memory exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD201 || 1 || 105 || Handle-table exhaustion&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 1 || 106 || Invalid memory state / invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD801 || 1 || 108 || Invalid memory permissions.&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC01 || 1 || 110 || Invalid memory range&lt;br /&gt;
|-&lt;br /&gt;
| 0xE001 || 1 || 112 || Invalid thread priority.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE201 || 1 || 113 || Invalid processor id.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE401 || 1 || 114 || Invalid handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE601 || 1 || 115 || Invalid pointer/Syscall copy from user failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE801 || 1 || 116 || Invalid combination&lt;br /&gt;
|-&lt;br /&gt;
| 0xEA01 || 1 || 117 || Time out. Also when you give 0 handles to svcWaitSynchronizationN.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEC01 || 1 || 118 || Operation canceled&lt;br /&gt;
|-&lt;br /&gt;
| 0xEE01 || 1 || 119 || Out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0xF001 || 1 || 120 || Invalid enum&lt;br /&gt;
|-&lt;br /&gt;
| 0xF201 || 1 || 121 || No such entry&lt;br /&gt;
|-&lt;br /&gt;
| 0xF401 || 1 || 122 || Irq/DeviceAddressSpace/{...} already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xF601 || 1 || 123 || Port remote dead&lt;br /&gt;
|-&lt;br /&gt;
| 0xF801 || 1 || 124 || [Usermode] Unhandled interrupt/exception&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA01 || 1 || 125 || Invalid state&lt;br /&gt;
|-&lt;br /&gt;
| 0xFC01 || 1 || 126 || Reserved value&lt;br /&gt;
|-&lt;br /&gt;
| 0xFE01 || 1 || 127 || Invalid hardware breakpoint&lt;br /&gt;
|-&lt;br /&gt;
| 0x10001 || 1 || 128 || [Usermode] Fatal exception&lt;br /&gt;
|-&lt;br /&gt;
| 0x10201 || 1 || 129 || Last thread didn&#039;t belong to your process&lt;br /&gt;
|-&lt;br /&gt;
| 0x10601 || 1 || 131 || Port closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x10801 || 1 || 132 || Resource limit exceeded&lt;br /&gt;
|-&lt;br /&gt;
| 0x20801 || 1 || 260 || Command buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x40A01 || 1 || 517 || Invalid process ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40C01 || 1 || 518 || Invalid thread ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40E01 || 1 || 519 || Invalid thread ID (used in svcGetDebugThreadParam).&lt;br /&gt;
|-&lt;br /&gt;
| 0x41001 || 1 || 520 || Process not being debugged&lt;br /&gt;
|-&lt;br /&gt;
| 0x202 || 2 || 1 || Path does not exist.&lt;br /&gt;
|-&lt;br /&gt;
| 0x402 || 2 || 2 || Path already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE02 || 2 || 7 || Resource already in use (file already opened, savedata filesystem already mounted).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4602 || 2 || 35 || Not enough free space for BIS Calibration partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4802 || 2 || 36 || Not enough free space for BIS Safe partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A02 || 2 || 37 || Not enough free space for BIS User partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4C02 || 2 || 38 || Not enough free space for BIS System partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E02 || 2 || 39 || Not enough free space on SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6402 || 2 || 50 || NCA is older than version 3, or NCA SDK version is older than 0.11.0.0&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 2 || 60 || Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 2 || 1001 || Process does not have RomFs &lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 2 || 1002 || Title-id not found / savedata not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA202 || 2 || 2001 || SD card not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B002 || 2 || 2520 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x13B402 || 2 || 2522 || Attempted process an AsicHandler command in initial mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13D802 || 2 || 2540 || Attempted to read from the secure gamecard partition in normal mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DA02 || 2 || 2541 || Attempted to read from the normal gamecard partition in secure mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x13DC02 || 2 || 2542 || Attempted a read that spanned both the normal and secure gamecard partitions&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E002 || 2 || 2544 || Gamecard initial data hash doesn&#039;t match the initial data hash in the card header&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E202 || 2 || 2545 || Gamecard initial data reserved area is not all zeros&lt;br /&gt;
|-&lt;br /&gt;
| 0x13E402 || 2 || 2546 || Gamecard certificate kek index doesn&#039;t match card header kek index&lt;br /&gt;
|-&lt;br /&gt;
| 0x13EE02 || 2 || 2551 || Unable to read card header on gamecard init&lt;br /&gt;
|-&lt;br /&gt;
| 0x140A02 || 2 || 2565 || Encountered SDMMC error in write operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x145002 || 2 || 2600 || Attempted to switch lotus state machine to secure mode from a mode other than normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x145202 || 2 || 2601 || Attempted to switch lotus state machine to normal mode from a mode other than initial&lt;br /&gt;
|-&lt;br /&gt;
| 0x145402 || 2 || 2602 || Attempted to switch lotus state machine to write mode from a mode other than normal&lt;br /&gt;
|-&lt;br /&gt;
| 0x149402 || 2 || 2634 || Error processing lotus command SetUserAsicFirmware&lt;br /&gt;
|-&lt;br /&gt;
| 0x149A02 || 2 || 2637 || Error processing lotus command GetAsicCert&lt;br /&gt;
|-&lt;br /&gt;
| 0x14A002 || 2 || 2640 || Error processing lotus command SetEmmcEmbeddedSocCertificate&lt;br /&gt;
|-&lt;br /&gt;
| 0x14AA02 || 2 || 2645 || Error processing lotus command GetAsicEncryptedMessage&lt;br /&gt;
|-&lt;br /&gt;
| 0x14AC02 || 2 || 2646 || Error processing lotus command SetLibraryEncryptedMessage&lt;br /&gt;
|-&lt;br /&gt;
| 0x14B602 || 2 || 2651 || Error processing lotus command GetAsicAuthenticationData&lt;br /&gt;
|-&lt;br /&gt;
| 0x14B802 || 2 || 2652 || Error processing lotus command SetAsicAuthenticationDataHash&lt;br /&gt;
|-&lt;br /&gt;
| 0x14BA02 || 2 || 2653 || Error processing lotus command SetLibraryAuthenticationData&lt;br /&gt;
|-&lt;br /&gt;
| 0x14BC02 || 2 || 2654 || Error processing lotus command GetLibraryAuthenticationDataHash&lt;br /&gt;
|-&lt;br /&gt;
| 0x14C202 || 2 || 2657 || Error processing lotus command ExchangeRandomValuesInSecureMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x14D802 || 2 || 2668 || Error calling nn::gc::detail::GcCrypto::GenerateRandomBytes&lt;br /&gt;
|-&lt;br /&gt;
| 0x14DE02 || 2 || 2671 || Error processing lotus command ReadAsicRegister&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E002 || 2 || 2672 || Error processing lotus command GetGameCardIdSet&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E402 || 2 || 2674 || Error processing lotus command GetCardHeader&lt;br /&gt;
|-&lt;br /&gt;
| 0x14E802 || 2 || 2676 || Error processing lotus command GetCardKeyArea&lt;br /&gt;
|-&lt;br /&gt;
| 0x14EA02 || 2 || 2677 || Error processing lotus command ChangeDebugMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x14EC02 || 2 || 2678 || Error processing lotus command GetRmaInformation&lt;br /&gt;
|-&lt;br /&gt;
| 0x150802 || 2 || 2692 || Tried sending lotus card command Refresh when not in secure mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x150A02 || 2 || 2693 || Tried sending lotus card command when not in correct mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x155602 || 2 || 2731 || Error processing lotus card command ReadId1&lt;br /&gt;
|-&lt;br /&gt;
| 0x155802 || 2 || 2732 || Error processing lotus card command ReadId2&lt;br /&gt;
|-&lt;br /&gt;
| 0x155A02 || 2 || 2733 || Error processing lotus card command ReadId3&lt;br /&gt;
|-&lt;br /&gt;
| 0x155E02 || 2 || 2735 || Error processing lotus card command ReadPage&lt;br /&gt;
|-&lt;br /&gt;
| 0x156202 || 2 || 2737 || Error processing lotus card command WritePage&lt;br /&gt;
|-&lt;br /&gt;
| 0x156402 || 2 || 2738 || Error processing lotus card command Refresh&lt;br /&gt;
|-&lt;br /&gt;
| 0x156C02 || 2 || 2742 || Error processing lotus card command ReadCrc&lt;br /&gt;
|-&lt;br /&gt;
| 0x156E02 || 2 || 2743 || Error processing lotus card command Erase or UnlockForceErase&lt;br /&gt;
|-&lt;br /&gt;
| 0x157002 || 2 || 2744 || Error processing lotus card command ReadDevParam&lt;br /&gt;
|-&lt;br /&gt;
| 0x157202 || 2 || 2745 || Error processing lotus card command WriteDevParam&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B002 || 2 || 2904 || Id2Normal did not match the value in the buffer returned by ChangeDebugMode&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B202 || 2 || 2905 || Id1Normal did not match Id1Writer when switching gamecard to write mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x16B402 || 2 || 2906 || Id2Normal did not match Id2Writer when switching gamecard to write mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x171402 || 2 || 2954 || Invalid gamecard handle.&lt;br /&gt;
|-&lt;br /&gt;
| 0x172002 || 2 || 2960 || Invalid gamecard handle when opening normal gamecard partition&lt;br /&gt;
|-&lt;br /&gt;
| 0x172202 || 2 || 2961 || Invalid gamecard handle when opening secure gamecard partition&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 2 || 3001 || Unimplemented behavior&lt;br /&gt;
|-&lt;br /&gt;
| 0x177602 || 2 || 3003 || File/Directory already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x190202 || 2 || 3201 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190602 || 2 || 3203 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190802 || 2 || 3204 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190A02 || 2 || 3205 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x190C02 || 2 || 3206 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x191002 || 2 || 3208 || Memory allocation failure related to FAT filesystem code&lt;br /&gt;
|-&lt;br /&gt;
| 0x195802 || 2 || 3244 || Allocation failure related to SD cards&lt;br /&gt;
|-&lt;br /&gt;
| 0x196002 || 2 || 3248 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x196202 || 2 || 3249 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A3E02 || 2 || 3359 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4002 || 2 || 3360 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A4A02 || 2 || 3365 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x21BC02 || 2 || 4318 || Invalid save data filesystem magic (valid magic is SAVE in ASCII)&lt;br /&gt;
|-&lt;br /&gt;
| 0x234202 || 2 || 4513 || Error reading ACID section in NPDM&lt;br /&gt;
|-&lt;br /&gt;
| 0x234402 || 2 || 4514 || Invalid NPDM ACID section size&lt;br /&gt;
|-&lt;br /&gt;
| 0x234602 || 2 || 4515 || Last byte of the ACID modulus is zero&lt;br /&gt;
|-&lt;br /&gt;
| 0x234802 || 2 || 4516 || Invalid ACID fixed key signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x234A02 || 2 || 4517 || Invalid NCA magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x234C02 || 2 || 4518 || Invalid NCA header fixed key signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x234E02 || 2 || 4519 || Invalid NCA header ACID signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x235002 || 2 || 4520 || Invalid NCA header section hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x235202 || 2 || 4521 || Invalid NCA Key index&lt;br /&gt;
|-&lt;br /&gt;
| 0x235602 || 2 || 4523 || Invalid encryption type&lt;br /&gt;
|-&lt;br /&gt;
| 0x235802 || 2 || 4524 || Redirection BKTR table size is negative&lt;br /&gt;
|-&lt;br /&gt;
| 0x235A02 || 2 || 4525 || Encryption BKTR table size is negative&lt;br /&gt;
|-&lt;br /&gt;
| 0x235C02 || 2 || 4526 || Redirection BKTR table end offset is past the Encryption BKTR table start offset&lt;br /&gt;
|-&lt;br /&gt;
| 0x235E02 || 2 || 4527 || NCA-path used with the wrong titleID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x236002 || 2 || 4528 || NCA header value is out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0x236202 || 2 || 4529 || NCA FS header value is out of range&lt;br /&gt;
|-&lt;br /&gt;
| 0x236802 || 2 || 4532 || PartitionFS hash block size is not a power of 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x236A02 || 2 || 4533 || PartitionFS hash &amp;quot;always_2&amp;quot; field is not 2&lt;br /&gt;
|-&lt;br /&gt;
| 0x236C02 || 2 || 4534 || PartitionFS hash table is too small for main data&lt;br /&gt;
|-&lt;br /&gt;
| 0x236E02 || 2 || 4535 || Invalid PartitionFS block hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x244402 || 2 || 4642 || Invalid Partition file hashed region bounds&lt;br /&gt;
|-&lt;br /&gt;
| 0x244602 || 2 || 4643 || Invalid Partition FS hash&lt;br /&gt;
|-&lt;br /&gt;
| 0x244802 || 2 || 4644 || Invalid PFS0 magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x244A02 || 2 || 4645 || Invalid HFS0 magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x244C02 || 2 || 4646 || Invalid name offset for Partition FS file entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x244E02 || 2 || 4647 || Calculated Partition FS header size changed between 2 consecutive reads&lt;br /&gt;
|-&lt;br /&gt;
| 0x249802 || 2 || 4684 || Invalid FAT file number.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249C02 || 2 || 4686 || Invalid FAT format for BIS User partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249E02 || 2 || 4687 || Invalid FAT format for BIS System partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24A002 || 2 || 4688 || Invalid FAT format for BIS Safe partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24A202 || 2 || 4689 || Invalid FAT format for BIS Calibration partition.&lt;br /&gt;
|-&lt;br /&gt;
| 0x250E02 || 2 || 4743 || [[NAX0|Corrupted]] NAX0 header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x251002 || 2 || 4744 || Invalid [[NAX0]] magicnum.&lt;br /&gt;
|-&lt;br /&gt;
| 0x280202 || 2 || 5121 || Invalid FAT size&lt;br /&gt;
|-&lt;br /&gt;
| 0x280402 || 2 || 5122 || Invalid FAT BPB (BIOS Parameter Block)&lt;br /&gt;
|-&lt;br /&gt;
| 0x280602 || 2 || 5123 || Invalid FAT parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x280802 || 2 || 5124 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280A02 || 2 || 5125 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280C02 || 2 || 5126 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x280E02 || 2 || 5127 || Invalid FAT sector&lt;br /&gt;
|-&lt;br /&gt;
| 0x296A02 || 2 || 5301 || Mountpoint not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 || 2 || 6001 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 2 || 6003 || Path too long&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE802 || 2 || 6004 || Invalid character.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 2 || 6005 || Invalid directory path.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEC02 || 2 || 6006 || Unable to retrieve directory from path&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 2 || 6061 || Offset outside storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 || 2 || 6300 || Operation not supported&lt;br /&gt;
|-&lt;br /&gt;
| 0x313A02 || 2 || 6301 || A specified filesystem has no MultiCommitTarget when doing a multi-filesystem commit&lt;br /&gt;
|-&lt;br /&gt;
| 0x313C02 || 2 || 6302 || Attempted to resize a nn::fs::SubStorage or BufferedStorage that is marked as non-resizable&lt;br /&gt;
|-&lt;br /&gt;
| 0x313E02 || 2 || 6303 || Attempted to resize a nn::fs::SubStorage or BufferedStorage when the SubStorage ends before the base storage&lt;br /&gt;
|-&lt;br /&gt;
| 0x314002 || 2 || 6304 || Attempted to call nn::fs::MemoryStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x314202 || 2 || 6305 || Invalid Operation ID in nn::fs::MemoryStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314402 || 2 || 6306 || Invalid Operation ID in nn::fs::FileStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314602 || 2 || 6307 || Invalid Operation ID in nn::fs::FileHandleStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314802 || 2 || 6308 || Invalid Operation ID in nn::fssystem::SwitchStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314A02 || 2 || 6309 || Invalid Operation ID in nn::fs::detail::StorageServiceObjectAdapter::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x314C02 || 2 || 6310 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x314E02 || 2 || 6311 || Attempted to call nn::fssystem::AesCtrCounterExtendedStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315002 || 2 || 6312 || Invalid Operation ID in nn::fssystem::AesCtrCounterExtendedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x315202 || 2 || 6313 || Attempted to call nn::fssystem::AesCtrStorageExternal::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x315402 || 2 || 6314 || Attempted to call nn::fssystem::AesCtrStorageExternal::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315602 || 2 || 6315 || Attempted to call nn::fssystem::AesCtrStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315802 || 2 || 6316 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315A02 || 2 || 6317 || Attempted to call nn::fssystem::save::HierarchicalIntegrityVerificationStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x315C02 || 2 || 6318 || Attempted to call nn::fssystem::save::IntegrityVerificationStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x315E02 || 2 || 6319 || Attempted to invalidate the cache of a RomFs IVFC storage in nn::fssystem::save::IntegrityVerificationStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316002 || 2 || 6320 || Invalid Operation ID in nn::fssystem::save::IntegrityVerificationStorage::OperateRange &lt;br /&gt;
|-&lt;br /&gt;
| 0x316202 || 2 || 6321 || Attempted to call nn::fssystem::save::BlockCacheBufferedStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x316402 || 2 || 6322 || Attempted to invalidate the cache of something other than a savedata IVFC storage in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316602 || 2 || 6323 || Invalid Operation ID in nn::fssystem::save::BlockCacheBufferedStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316802 || 2 || 6324 || Attempted to call nn::fssystem::IndirectStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x316A02 || 2 || 6325 || Attempted to call nn::fssystem::IndirectStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x316C02 || 2 || 6326 || Invalid Operation ID in nn::fssystem::IndirectStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x316E02 || 2 || 6327 || Attempted to call nn::fssystem::SparseStorage::ZeroStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x317002 || 2 || 6328 || Attempted to call nn::fssystem::SparseStorage::ZeroStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317202 || 2 || 6329 || Attempted to call nn::fssystem::HierarchicalSha256Storage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317402 || 2 || 6330 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x317602 || 2 || 6331 || Attempted to call nn::fssystem::ReadOnlyBlockCacheStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317802 || 2 || 6332 || Attempted to call nn::fssystem::IntegrityRomFsStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317A02 || 2 || 6333 || Attempted to call nn::fssystem::save::DuplexStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x317C02 || 2 || 6334 || Invalid Operation ID in nn::fssystem::save::DuplexStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x317E02 || 2 || 6335 || Attempted to call nn::fssystem::save::HierarchicalDuplexStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318002 || 2 || 6336 || Attempted to call nn::fssystem::save::RemapStorage::GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318202 || 2 || 6337 || Attempted to call nn::fssystem::save::RemapStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318402 || 2 || 6338 || Invalid Operation ID in nn::fssystem::save::RemapStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318602 || 2 || 6339 || Attempted to call nn::fssystem::save::IntegritySaveDataStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318802 || 2 || 6340 || Invalid Operation ID in nn::fssystem::save::IntegritySaveDataStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318A02 || 2 || 6341 || Attempted to call nn::fssystem::save::JournalIntegritySaveDataStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x318C02 || 2 || 6342 || Invalid Operation ID in nn::fssystem::save::JournalIntegritySaveDataStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x318E02 || 2 || 6343 || Attempted to call nn::fssystem::save::JournalStorage::GetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319002 || 2 || 6344 || Attempted to call nn::fssystem::save::JournalStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319202 || 2 || 6345 || Invalid Operation ID in nn::fssystem::save::JournalStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x319402 || 2 || 6346 || Attempted to call nn::fssystem::save::UnionStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319602 || 2 || 6347 || Attempted to call nn::fssystem::dbm::AllocationTableStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319802 || 2 || 6348 || Attempted to call nn::fssrv::fscreator::WriteOnlyGameCardStorage::Read&lt;br /&gt;
|-&lt;br /&gt;
| 0x319A02 || 2 || 6349 || Attempted to call nn::fssrv::fscreator::WriteOnlyGameCardStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x319C02 || 2 || 6350 || Attempted to call nn::fssrv::fscreator::ReadOnlyGameCardStorage::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x319E02 || 2 || 6351 || Attempted to call nn::fssrv::fscreator::ReadOnlyGameCardStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A002 || 2 || 6352 || Invalid Operation ID in nn::fssrv::fscreator::ReadOnlyGameCardStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A202 || 2 || 6353 || Attempted to call SdStorage::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A402 || 2 || 6354 || Invalid Operation ID in SdStorage::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A602 || 2 || 6355 || Invalid Operation ID in nn::fat::FatFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31A802 || 2 || 6356 || Invalid Operation ID in nn::fssystem::StorageFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AA02 || 2 || 6357 || Attempted to call nn::fssystem::ConcatenationFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AC02 || 2 || 6358 || Attempted to call nn::fssystem::ConcatenationFile::OperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31AE02 || 2 || 6359 || Invalid Query ID in nn::fssystem::ConcatenationFileSystem::DoQueryEntry&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B002 || 2 || 6360 || Invalid Operation ID in nn::fssystem::ConcatenationFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B202 || 2 || 6361 || Attempted to call nn::fssystem::ZeroBitmapFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B402 || 2 || 6362 || Invalid Operation ID in nn::fs::detail::FileServiceObjectAdapter::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B602 || 2 || 6363 || Invalid Operation ID in nn::fssystem::AesXtsFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31B802 || 2 || 6364 || Attempted to modify a nn::fs::RomFsFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BA02 || 2 || 6365 || Attempted to call nn::fs::RomFsFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BC02 || 2 || 6366 || Attempted to query the space in a nn::fs::RomFsFileSystem&lt;br /&gt;
|-&lt;br /&gt;
| 0x31BE02 || 2 || 6367 || Attempted to modify a nn::fssystem::RomFsFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C002 || 2 || 6368 || Invalid Operation ID in nn::fssystem::RomFsFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C202 || 2 || 6369 || Attempted to modify a nn::fs::ReadOnlyFileSystemTemplate&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C402 || 2 || 6370 || Attempted to call nn::fs::ReadOnlyFileSystemTemplate::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C602 || 2 || 6371 || Attempted to query the space in a nn::fs::ReadOnlyFileSystemTemplate&lt;br /&gt;
|-&lt;br /&gt;
| 0x31C802 || 2 || 6372 || Attempted to modify a nn::fs::ReadOnlyFileSystemFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CA02 || 2 || 6373 || Invalid Operation ID in nn::fs::ReadOnlyFileSystemFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CC02 || 2 || 6374 || Attempted to modify a nn::fssystem::PartitionFileSystemCore&lt;br /&gt;
|-&lt;br /&gt;
| 0x31CE02 || 2 || 6375 || Attempted to call nn::fssystem::PartitionFileSystemCore::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D002 || 2 || 6376 || Attempted to call nn::fssystem::PartitionFileSystemCore::PartitionFile::DoSetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D202 || 2 || 6377 || Invalid Operation ID in nn::fssystem::PartitionFileSystemCore::PartitionFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D402 || 2 || 6378 || Invalid Operation ID in nn::fssystem::TmFileSystemFile::DoOperateRange&lt;br /&gt;
|-&lt;br /&gt;
| 0x31D602 || 2 || 6379 || Attempted to call unsupported functions in nn::fssrv::fscreator::SaveDataInternalStorageFileSystem, nn::fssrv::detail::SaveDataInternalStorageAccessor::PaddingFile or nn::fssystem::save::detail::SaveDataExtraDataInternalStorageFile&lt;br /&gt;
|-&lt;br /&gt;
| 0x31DC02 || 2 || 6382 || Attempted to call nn::fssystem::ApplicationTemporaryFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31DE02 || 2 || 6383 || Attempted to call nn::fssystem::SaveDataFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E002 || 2 || 6384 || Attempted to call nn::fssystem::DirectorySaveDataFileSystem::DoCommitProvisionally&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E202 || 2 || 6385 || Attempted to call nn::fssystem::ZeroBitmapHashStorageFile::Write&lt;br /&gt;
|-&lt;br /&gt;
| 0x31E402 || 2 || 6386 || Attempted to call nn::fssystem::ZeroBitmapHashStorageFile::SetSize&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 || 2 || 6400 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x326602 || 2 || 6451 || Missing titlekey(?) required to mount content&lt;br /&gt;
|-&lt;br /&gt;
| 0x326E02 || 2 || 6455 || File not closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x327002 || 2 || 6456 || Directory not closed&lt;br /&gt;
|-&lt;br /&gt;
| 0x327202 || 2 || 6457 || Writable file not closed when committing&lt;br /&gt;
|-&lt;br /&gt;
| 0x327402 || 2 || 6458 || FS allocators already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x327602 || 2 || 6459 || FS allocators already used&lt;br /&gt;
|-&lt;br /&gt;
| 0x327A02 || 2 || 6461 || FS allocator alignment violation&lt;br /&gt;
|-&lt;br /&gt;
| 0x339402 || 2 || 6602 || File not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x339602 || 2 || 6603 || Directory not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346C02 || 2 || 6710 || Multi-commit limit reached&lt;br /&gt;
|-&lt;br /&gt;
| 0x35F202 || 2 || 6905 || Mount name not found in table.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DBC02 || 2 || 7902 || RomFs table: Entry not found in dictionary&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DBE02 || 2 || 7903 || RomFs table: File not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC002 || 2 || 7904 || RomFs table: Directory not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC402 || 2 || 7906 || RomFs table: Entry already exists when trying to add a new entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC602 || 2 || 7907 || RomFs table: Insufficient space to add new entry&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DC802 || 2 || 7908 || RomFs table: Unable to add new directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DCA02 || 2 || 7909 || RomFs table: Unable to add new file&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DCC02 || 2 || 7910 || RomFs directory has no more child directories/files when iterating&lt;br /&gt;
|-&lt;br /&gt;
| 0x3DD402 || 2 || 7914 || RomFs table: Path is file, not directory&lt;br /&gt;
|-&lt;br /&gt;
| 0x803 || 3 || 4 || OS busy&lt;br /&gt;
|-&lt;br /&gt;
| 0xE03 || 3 || 7 || Invalid parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x1003 || 3 || 8 || Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x1203 || 3 || 9 || Out of resources&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EA03 || 3 || 501 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE03 || 3 || 503 || Invalid memory mirror&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE03 || 3 || 1023 || TLS slot is not allocated&lt;br /&gt;
|-&lt;br /&gt;
| 0xA05 || 5 || 5 || [[Content_Manager_services|NcaID]] not found. Returned when attempting to mount titles which exist that aren&#039;t *8XX titles, the same way *8XX titles are mounted.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE05 || 5 || 7 || TitleId not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1805 || 5 || 12 || Invalid StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0xDC05 || 5 || 110 || Gamecard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x17C05 || 5 || 190 || Gamecard not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F405 || 5 || 250 || Sdcard not inserted&lt;br /&gt;
|-&lt;br /&gt;
| 0x20805 || 5 || 260 || Storage not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0x806 || 6 || 4 || Converted from error 0xD401&lt;br /&gt;
|-&lt;br /&gt;
| 0x1006 || 6 || 8 || Converted from error 0xE401&lt;br /&gt;
|-&lt;br /&gt;
| 0x408 || 8 || 2 || Program location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x608 || 8 || 3 || Invalid context for control location&lt;br /&gt;
|-&lt;br /&gt;
| 0x808 || 8 || 4 || Storage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA08 || 8 || 5 || Access denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xC08 || 8 || 6 || Offline manual HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xE08 || 8 || 7 || Title is not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1008 || 8 || 8 || Control location entry for host not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1208 || 8 || 9 || Legal info HTML location entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x1408 || 8 || 10 || Program location for debug entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x209 || 9 || 1 || Args too long.&lt;br /&gt;
|-&lt;br /&gt;
| 0x409 || 9 || 2 || Maximum processes loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x609 || 9 || 3 || NPDM too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x809 || 9 || 4 || Invalid NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA09 || 9 || 5 || Invalid NSO.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC09 || 9 || 6 || Invalid Path.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE09 || 9 || 7 || Already registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1009 || 9 || 8 || Title not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1209 || 9 || 9 || Title-id in ACI0 doesn&#039;t match range in ACID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1409 || 9 || 10 || Invalid version in NPDM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6609 || 9 || 51 || Insufficient address space.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6809 || 9 || 52 || Insufficient NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6A09 || 9 || 53 || Invalid NRR&lt;br /&gt;
|-&lt;br /&gt;
| 0x6C09 || 9 || 54 || Invalid signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x6E09 || 9 || 55 || Insufficient NRO registrations.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7009 || 9 || 56 || Insufficient NRR registrations.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7209 || 9 || 57 || NRO Already loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA209 || 9 || 81 || Unaligned NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xA409 || 9 || 82 || Bad NRR size&lt;br /&gt;
|-&lt;br /&gt;
| 0xA809 || 9 || 84 || NRR Not Loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA09 || 9 || 85 || Bad NRR address&lt;br /&gt;
|-&lt;br /&gt;
| 0xAE09 || 9 || 87 || Bad initialization&lt;br /&gt;
|-&lt;br /&gt;
| 0xC809 || 9 || 100 || Unknown ACI0 descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE09 || 9 || 103 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD009 || 9 || 104 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;SyscallMask&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD409 || 9 || 106 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapIoOrNormalRange&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xD609 || 9 || 107 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;MapNormalPage&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xDE09 || 9 || 111 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;InterruptPair&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE209 || 9 || 113 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;ApplicationType&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE409 || 9 || 114 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;KernelReleaseVersion&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE609 || 9 || 115 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;HandleTableSize&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0xE809 || 9 || 116 || ACID/ACI0 don&#039;t match for descriptor &amp;quot;DebugFlags&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 0x1940A || 10 || 202 || Invalid CMIF header size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A60A || 10 || 211 || Invalid CMIF input header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A80A || 10 || 212 || Invalid CMIF output header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BA0A || 10 || 221 || Invalid method dispatch ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D60A || 10 || 235 || Invalid in object count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1D80A || 10 || 236 || Invalid out object count.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0A || 10 || 301 || Out of domain entries.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20B || 11 || 1 || Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC0B || 11 || 102 || Out of server session memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x11A0B || 11 || 141 || Went past maximum during marshalling.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1900B || 11 || 200 || Session doesn&#039;t support domains.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A0B || 11 || 301 || Remote process is dead.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3240B || 11 || 402 || Data/buffer length(s) too large for IPC buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3260B || 11 || 403 || Unknown request type&lt;br /&gt;
|-&lt;br /&gt;
| 0x3480B || 11 || 420 || Number(s) of buffers/handles/PIDs passed differ from what method expects.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3D60B || 11 || 491 || IPC Query 1 failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x20F || 15 || 1 || Pid not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x60F || 15 || 3 || Process has no pending events&lt;br /&gt;
|-&lt;br /&gt;
| 0xA0F || 15 || 5 || Application already running&lt;br /&gt;
|-&lt;br /&gt;
| 0x410 || 16 || 2 || Title-id not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xF010 || 16 || 120 || Sysupdate not required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F610 || 16 || 251 || Unexpected StorageId&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A810 || 16 || 340 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64210 || 16 || 801 || [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] system_delivery_protocol_version is less than the system-setting.&lt;br /&gt;
|-&lt;br /&gt;
| 0x64410 || 16 || 802 || [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] system_delivery_protocol_version is larger than the system-setting.&lt;br /&gt;
|-&lt;br /&gt;
| 0x74610 || 16 || 931 || Invalid [[NS_Services#SystemDeliveryInfo|SystemDeliveryInfo]] HMAC / invalid Meta Id.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6F810 || 16 || 892 || Unknown state ref-count is zero.&lt;br /&gt;
|-&lt;br /&gt;
| 0x215 || 21 || 1 || Out of processes&lt;br /&gt;
|-&lt;br /&gt;
| 0x415 || 21 || 2 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x615 || 21 || 3 || Max sessions&lt;br /&gt;
|-&lt;br /&gt;
| 0x815 || 21 || 4 || Service already registered&lt;br /&gt;
|-&lt;br /&gt;
| 0xA15 || 21 || 5 || Out of services&lt;br /&gt;
|-&lt;br /&gt;
| 0xC15 || 21 || 6 || Invalid name (all zeroes)&lt;br /&gt;
|-&lt;br /&gt;
| 0xE15 || 21 || 7 || Service not registered&lt;br /&gt;
|-&lt;br /&gt;
| 0x1015 || 21 || 8 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0x1215 || 21 || 9 || Service Access Control too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x416 || 22 || 2 || Address space is full&lt;br /&gt;
|-&lt;br /&gt;
| 0x616 || 22 || 3 || NRO already loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x816 || 22 || 4 || Invalid NRO header values&lt;br /&gt;
|-&lt;br /&gt;
| 0xC16 || 22 || 6 || Bad NRR magic&lt;br /&gt;
|-&lt;br /&gt;
| 0x1016 || 22 || 8 || Reached max NRR count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1216 || 22 || 9 || Unable to verify NRO hash or NRR signature&lt;br /&gt;
|-&lt;br /&gt;
| 0x80216 || 22 || 1025 || Address not page-aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0x80416 || 22 || 1026 || Incorrect NRO size&lt;br /&gt;
|-&lt;br /&gt;
| 0x80816 || 22 || 1028 || NRO not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80A16 || 22 || 1029 || NRR not loaded&lt;br /&gt;
|-&lt;br /&gt;
| 0x80C16 || 22 || 1030 || Already initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E16 || 22 || 1031 || Not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x21A || 26 || 1 || SMC is not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0x41A || 26 || 2 || SMC argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x61A || 26 || 3 || SMC is currently in progress/secmon is busy&lt;br /&gt;
|-&lt;br /&gt;
| 0x81A || 26 || 4 || Secmon not currently performing async operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xA1A || 26 || 5 || Invalid SMC async callback key&lt;br /&gt;
|-&lt;br /&gt;
| 0xC1A || 26 || 6 || SMC is blacklisted during current boot&lt;br /&gt;
|-&lt;br /&gt;
| 0xC81A || 26 || 100 || Invalid (buffer) size&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Unknown SMC error&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA1A || 26 || 101 || Decryption failure&lt;br /&gt;
|-&lt;br /&gt;
| 0xD01A || 26 || 104 || No AES keyslots available&lt;br /&gt;
|-&lt;br /&gt;
| 0xD21A || 26 || 105 || Invalid AES keyslot&lt;br /&gt;
|-&lt;br /&gt;
| 0xD41A || 26 || 106 || BootReason already set&lt;br /&gt;
|-&lt;br /&gt;
| 0xD61A || 26 || 107 || BootReason not set&lt;br /&gt;
|-&lt;br /&gt;
| 0xD81A || 26 || 108 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x35B || 347 || 1 || Failed to init SM.&lt;br /&gt;
|-&lt;br /&gt;
| 0x55B || 347 || 2 || Failed to init FS.&lt;br /&gt;
|-&lt;br /&gt;
| 0x75B || 347 || 3 || Failed to open NRO file. May also happen when SD card isn&#039;t inserted / SD mounting failed earlier.&lt;br /&gt;
|-&lt;br /&gt;
| 0x95B || 347 || 4 || Failed to read NRO header.&lt;br /&gt;
|-&lt;br /&gt;
| 0xB5B || 347 || 5 || Invalid NRO magic.&lt;br /&gt;
|-&lt;br /&gt;
| 0xD5B || 347 || 6 || Invalid NRO segments.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF5B || 347 || 7 || Failed to read NRO.&lt;br /&gt;
|-&lt;br /&gt;
| 0x135B || 347 || 9 || Failed to allocate heap.&lt;br /&gt;
|-&lt;br /&gt;
| 0x255B || 347 || 18 || Failed to map code-binary memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x275B || 347 || 19 || Failed to map code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x295B || 347 || 20 || Failed to map code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2B5B || 347 || 21 || Failed to map code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x315B || 347 || 24 || Failed to unmap code memory (.text).&lt;br /&gt;
|-&lt;br /&gt;
| 0x335B || 347 || 25 || Failed to unmap code memory (.rodata).&lt;br /&gt;
|-&lt;br /&gt;
| 0x355B || 347 || 26 || Failed to unmap code memory (.data+.bss).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19269 || 105 || 201 || Null settings name&lt;br /&gt;
|-&lt;br /&gt;
| 0x19469 || 105 || 202 || Null settings key&lt;br /&gt;
|-&lt;br /&gt;
| 0x19669 || 105 || 203 || Null settings value&lt;br /&gt;
|-&lt;br /&gt;
| 0x19A69 || 105 || 205 || Null settings value buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A069 || 105 || 208 || Null setting value size buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A269 || 105 || 209 || Null debug mode flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BA69 || 105 || 221 || Setting group name has zero length&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BC69 || 105 || 222 || Empty settings item key&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E269 || 105 || 241 || Setting group name is too long (64 character limit?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x1E469 || 105 || 242 || Setting name is too long (64 character limit?)&lt;br /&gt;
|-&lt;br /&gt;
| 0x20A69 || 105 || 261 || Setting group name ends with &#039;.&#039; or contains invalid characters (allowed: [a-z0-9_\-.])&lt;br /&gt;
|-&lt;br /&gt;
| 0x20C69 || 105 || 262 || Setting name ends with &#039;.&#039; or contains invalid characters (allowed: [a-z0-9_\-.])&lt;br /&gt;
|-&lt;br /&gt;
| 0x4DA69 || 105 || 621 || Null language code buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x4E269 || 105 || 625 || Language out of valid range&lt;br /&gt;
|-&lt;br /&gt;
| 0x4EE69 || 105 || 631 || Null network settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x4F069 || 105 || 632 || Null network settings output count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x50269 || 105 || 641 || Null backlight settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51669 || 105 || 651 || Null Bluetooth device setting buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51869 || 105 || 652 || Null Bluetooth device setting output count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51A69 || 105 || 653 || Null Bluetooth enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51C69 || 105 || 654 || Null Bluetooth AFH enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x51E69 || 105 || 655 || Null Bluetooth boost enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52069 || 105 || 656 || Null BLE pairing settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52269 || 105 || 657 || Null BLE pairing settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52A69 || 105 || 661 || Null external steady clock source ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52C69 || 105 || 662 || Null user system clock context buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x52E69 || 105 || 663 || Null network system clock context buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53069 || 105 || 664 || Null user system clock automatic correction enabled flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53269 || 105 || 665 || Null shutdown RTC value buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53469 || 105 || 666 || Null external steady clock internal offset buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x53E69 || 105 || 671 || Null account settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55269 || 105 || 681 || Null audio volume buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55669 || 105 || 683 || Null ForceMuteOnHeadphoneRemoved buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55869 || 105 || 684 || Null headphone volume warning count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x55E69 || 105 || 687 || Invalid audio output mode&lt;br /&gt;
|-&lt;br /&gt;
| 0x56069 || 105 || 688 || Null headphone volume update flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x56669 || 105 || 691 || Null console information upload flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57A69 || 105 || 701 || Null automatic application download flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57C69 || 105 || 702 || Null notification settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x57E69 || 105 || 703 || Null account notification settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x58069 || 105 || 704 || Null account notification settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x58E69 || 105 || 711 || Null vibration master volume buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59069 || 105 || 712 || Null NX controller settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59269 || 105 || 713 || Null NX controller settings entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x59469 || 105 || 714 || Null USB full key enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A269 || 105 || 721 || Null TV settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5A469 || 105 || 722 || Null EDID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5B669 || 105 || 731 || Null data deletion settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CA69 || 105 || 741 || Null initial system applet program ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CC69 || 105 || 742 || Null overlay disp program ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5CE69 || 105 || 743 || Null IsInRepairProcess buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5D069 || 105 || 744 || Null RequiresRunRepairTimeReviser buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5DE69 || 105 || 751 || Null device timezone location name buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x5F269 || 105 || 761 || Null primary album storage buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x60669 || 105 || 771 || Null USB 3.0 enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x60869 || 105 || 772 || Null USB Type-C power source circuit version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x61A69 || 105 || 781 || Null battery lot buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x62E69 || 105 || 791 || Null serial number buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64269 || 105 || 801 || Null lock screen flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64669 || 105 || 803 || Null color set ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64869 || 105 || 804 || Null quest flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64A69 || 105 || 805 || Null wireless certification file size buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64C69 || 105 || 806 || Null wireless certification file buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x64E69 || 105 || 807 || Null initial launch settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65069 || 105 || 808 || Null device nickname buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65269 || 105 || 809 || Null battery percentage flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x65469 || 105 || 810 || Null applet launch flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7E869 || 105 || 1012 || Null wireless LAN enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FA69 || 105 || 1021 || Null product model buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x80E69 || 105 || 1031 || Null NFC enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x82269 || 105 || 1041 || Null ECI device certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x82469 || 105 || 1042 || Null E-Ticket device certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x83669 || 105 || 1051 || Null sleep settings buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x84A69 || 105 || 1061 || Null EULA version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x84C69 || 105 || 1062 || Null EULA version entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x85E69 || 105 || 1071 || Null LDN channel buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x87269 || 105 || 1081 || Null SSL key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x87469 || 105 || 1082 || Null SSL certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x88669 || 105 || 1091 || Null telemetry flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x89A69 || 105 || 1101 || Null Gamecard key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x89C69 || 105 || 1102 || Null Gamecard certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8AE69 || 105 || 1111 || Null PTM battery lot buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8B069 || 105 || 1112 || Null PTM fuel gauge parameter buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C269 || 105 || 1121 || Null ECI device key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8C469 || 105 || 1122 || Null E-Ticket device key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8D669 || 105 || 1131 || Null speaker parameter buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EA69 || 105 || 1141 || Null firmware version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EC69 || 105 || 1142 || Null firmware version digest buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8EE69 || 105 || 1143 || Null rebootless system update version buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x8FE69 || 105 || 1151 || Null Mii author ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x91269 || 105 || 1161 || Null fatal flags buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x92669 || 105 || 1171 || Null auto update enable flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x93A69 || 105 || 1181 || Null external RTC reset flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x94E69 || 105 || 1191 || Null push notification activity mode buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x96269 || 105 || 1201 || Null service discovery control setting buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x97669 || 105 || 1211 || Null error report share permission buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x98A69 || 105 || 1221 || Null LCD vendor ID buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x99E69 || 105 || 1231 || Null console SixAxis sensor acceleration bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A069 || 105 || 1232 || Null console SixAxis sensor angular velocity bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A269 || 105 || 1233 || Null console SixAxis sensor acceleration gain buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A469 || 105 || 1234 || Null console SixAxis sensor angular velocity gain buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A669 || 105 || 1235 || Null console SixAxis sensor angular velocity time bias buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9A869 || 105 || 1236 || Null console SixAxis sensor angular acceleration buffer &lt;br /&gt;
|-&lt;br /&gt;
| 0x9B269 || 105 || 1241 || Null keyboard layout buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9BA69 || 105 || 1245 || Invalid keyboard layout&lt;br /&gt;
|-&lt;br /&gt;
| 0x9C669 || 105 || 1251 || Null web inspector flag buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9C869 || 105 || 1252 || Null allowed SSL hosts buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9CA69 || 105 || 1253 || Null allowed SSL hosts entry count buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9CC69 || 105 || 1254 || Null host FS mount point buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9EE69 || 105 || 1271 || Null Amiibo key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F069 || 105 || 1272 || Null Amiibo ECQV certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F269 || 105 || 1273 || Null Amiibo ECDSA certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F469 || 105 || 1274 || Null Amiibo ECQV BLS key buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F669 || 105 || 1275 || Null Amiibo ECQV BLS certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x9F869 || 105 || 1276 || Null Amiibo ECQV BLS root certificate buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x272 || 114 || 1 || Generic error&lt;br /&gt;
|-&lt;br /&gt;
| 0xC72 || 114 || 6 || Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x74 || 116 || 0 || Time service not initialized&lt;br /&gt;
|-&lt;br /&gt;
| 0x274 || 116 || 1 || Permission denied&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC74 || 116 || 102 || Time not set / Clock Source Id mismatch&lt;br /&gt;
|-&lt;br /&gt;
| 0x19074 || 116 || 200 || Invalid time comparison&lt;br /&gt;
|-&lt;br /&gt;
| 0x19274 || 116 || 201 || Signed overflow/underflow&lt;br /&gt;
|-&lt;br /&gt;
| 0x64274 || 116 || 801 || Memory allocation failure&lt;br /&gt;
|-&lt;br /&gt;
| 0x70A74 || 116 || 901 || Null pointer&lt;br /&gt;
|-&lt;br /&gt;
| 0x70C74 || 116 || 902 || Value out of valid range&lt;br /&gt;
|-&lt;br /&gt;
| 0x70E74 || 116 || 903 || TimeZoneRule conversion failed&lt;br /&gt;
|-&lt;br /&gt;
| 0x7BA74 || 116 || 989 || TimeZone location name not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x7BC74 || 116 || 990 || Unimplemented functionality&lt;br /&gt;
|-&lt;br /&gt;
| 0xC79 || 121 || 6 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x27A || 122 || 1 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x47A || 122 || 2 || Object not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x67A || 122 || 3 || Object locked/in used&lt;br /&gt;
|-&lt;br /&gt;
| 0x87A || 122 || 4 || Target already mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0xA7A || 122 || 5 || Target not mounted&lt;br /&gt;
|-&lt;br /&gt;
| 0xC7A || 122 || 6 || Object already opened&lt;br /&gt;
|-&lt;br /&gt;
| 0xE7A || 122 || 7 || Object not opened&lt;br /&gt;
|-&lt;br /&gt;
| 0x107A || 122 || 8 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0xA07A || 122 || 80 || Passphrase not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xA27A || 122 || 81 || Data verification failed&lt;br /&gt;
|-&lt;br /&gt;
| 0xB47A || 122 || 90 || Invalid API call&lt;br /&gt;
|-&lt;br /&gt;
| 0xC47A || 122 || 98 || Invalid operation&lt;br /&gt;
|-&lt;br /&gt;
| 0x167B || 123 || 11 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8192 (SEC_ERROR_IO), -8191 (SEC_ERROR_LIBRARY_FAILURE), -8190 (SEC_ERROR_BAD_DATA), -8189 (SEC_ERROR_OUTPUT_LEN), -8188 (SEC_ERROR_INPUT_LEN), -8187 (SEC_ERROR_INVALID_ARGS), -8186 (SEC_ERROR_INVALID_ALGORITHM), -8184 (SEC_ERROR_INVALID_TIME), -8152 (SEC_ERROR_INVALID_KEY).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] errors: -5991 (PR_IO_ERROR), -5962 (PR_BUFFER_OVERFLOW_ERROR), -5950 (PR_FILE_NOT_FOUND_ERROR), -5949 (PR_NOT_DIRECTORY_ERROR), -5946 (PR_FILESYSTEM_MOUNTED_ERROR), -5938 (PR_END_OF_FILE_ERROR).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12223 (SSL_ERROR_GENERATE_RANDOM_FAILURE), -12222 (SSL_ERROR_SIGN_HASHES_FAILURE), -12221 (SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE), -12219 (SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE), -12218 (SSL_ERROR_ENCRYPTION_FAILURE), -12217 (SSL_ERROR_DECRYPTION_FAILURE), -12216 (SSL_ERROR_SOCKET_WRITE_FAILURE), -12212 (SSL_ERROR_SYM_KEY_CONTEXT_FAILURE), -12209 (SSL_ERROR_IV_PARAM_FAILURE), -12207 (SSL_ERROR_SESSION_KEY_GEN_FAILURE), -12203 (SSL_ERROR_NO_COMPRESSION_OVERLAP), -12202 (SSL_ERROR_HANDSHAKE_NOT_COMPLETED), -12201 (SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE), -12172 (SSL_ERROR_NEXT_PROTOCOL_DATA_INVALID).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A7B || 123 || 13 || Unrecognized error.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC7B || 123 || 102 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8173 (SEC_ERROR_NO_MEMORY).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] errors: -6000 (PR_OUT_OF_MEMORY_ERROR), -5974 (PR_INSUFFICIENT_RESOURCES_ERROR, -5971 (PR_PROC_DESC_TABLE_FULL_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0xE87B || 123 || 116 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5999 (PR_BAD_DESCRIPTOR_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1027B || 123 || 129 || DER CRL decoding failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1987B || 123 || 204 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5998 (PR_WOULD_BLOCK_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19A7B || 123 || 205 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5990 (PR_IO_TIMEOUT_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x19C7B || 123 || 206 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5935 (PR_OPERATION_ABORTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A07B || 123 || 208 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5978 (PR_NOT_CONNECTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A27B || 123 || 209 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5961 (PR_CONNECT_RESET_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A47B || 123 || 210 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5928 (PR_CONNECT_ABORTED_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A67B || 123 || 211 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5929 (PR_SOCKET_SHUTDOWN_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A87B || 123 || 212 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_Error_Handling NSPR] error -5930 (PR_NETWORK_DOWN_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x1AE7B || 123 || 215 || ClientPki/InternalPki was already previously imported/registered.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B47B || 123 || 218 || Maximum number of ServerPki objects were already imported.&lt;br /&gt;
|-&lt;br /&gt;
| 0x25A7B || 123 || 301 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12276 (SSL_ERROR_BAD_CERT_DOMAIN).&lt;br /&gt;
|-&lt;br /&gt;
| 0x25C7B || 123 || 302 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12285 (SSL_ERROR_NO_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x25E7B || 123 || 303 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8181 (SEC_ERROR_EXPIRED_CERTIFICATE), -8162 (SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2607B || 123 || 304 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8180 (SEC_ERROR_REVOKED_CERTIFICATE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2627B || 123 || 305 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8183 (SEC_ERROR_BAD_DER).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2647B || 123 || 306 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8102 (SEC_ERROR_INADEQUATE_KEY_USAGE), -8101 (SEC_ERROR_INADEQUATE_CERT_TYPE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2667B || 123 || 307 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8185 (SEC_ERROR_INVALID_AVA), -8182 (SEC_ERROR_BAD_SIGNATURE), -8158 (SEC_ERROR_EXTENSION_VALUE_INVALID), -8156 (SEC_ERROR_CA_CERT_INVALID), -8151 (SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION), -8080 (SEC_ERROR_CERT_NOT_IN_NAME_SPACE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2687B || 123 || 308 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC errors: -8179 (SEC_ERROR_UNKNOWN_ISSUER), -8172 (SEC_ERROR_UNTRUSTED_ISSUER), -8014 (SEC_ERROR_APPLICATION_CALLBACK_ERROR).&lt;br /&gt;
|-&lt;br /&gt;
| 0x26A7B || 123 || 309 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8171 (SEC_ERROR_UNTRUSTED_CERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0x26C7B || 123 || 310 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12233 (SSL_ERROR_RX_UNKNOWN_RECORD_TYPE), -12232 (SSL_ERROR_RX_UNKNOWN_HANDSHAKE), -12231 (SSL_ERROR_RX_UNKNOWN_ALERT). This is also returned by ImportClientPki when import fails.&lt;br /&gt;
|-&lt;br /&gt;
| 0x26E7B || 123 || 311 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12261 (SSL_ERROR_RX_MALFORMED_HELLO_REQUEST), -12260 (SSL_ERROR_RX_MALFORMED_CLIENT_HELLO), -12259 (SSL_ERROR_RX_MALFORMED_SERVER_HELLO), -12258 (SSL_ERROR_RX_MALFORMED_CERTIFICATE), -12257 (SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH), -12256 (SSL_ERROR_RX_MALFORMED_CERT_REQUEST), -12255 (SSL_ERROR_RX_MALFORMED_HELLO_DONE), -12254 (SSL_ERROR_RX_MALFORMED_CERT_VERIFY), -12253 (SSL_ERROR_RX_MALFORMED_CLIENT_KEY_EXCH), -12252 (SSL_ERROR_RX_MALFORMED_FINISHED), -12251 (SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER), -12250 (SSL_ERROR_RX_MALFORMED_ALERT), -12249 (SSL_ERROR_RX_MALFORMED_HANDSHAKE), -12248 (SSL_ERROR_RX_MALFORMED_APPLICATION_DATA), -12166 (SSL_ERROR_RX_MALFORMED_HELLO_VERIFY_REQUEST).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2707B || 123 || 312 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8144 (SEC_ERROR_UNSUPPORTED_KEYALG).&lt;br /&gt;
&lt;br /&gt;
Also converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12274 (SSL_ERROR_SSL2_DISABLED), -12247 (SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST), -12246 (SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO), -12245 (SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO), -12244 (SSL_ERROR_RX_UNEXPECTED_CERTIFICATE), -12243 (SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH), -12242 (SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST), -12241 (SSL_ERROR_RX_UNEXPECTED_HELLO_DONE), -12240 (SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY), -12239 (SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH), -12238 (SSL_ERROR_RX_UNEXPECTED_FINISHED).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2727B || 123 || 313 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12237 (SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER), -12236 (SSL_ERROR_RX_UNEXPECTED_ALERT), -12235 (SSL_ERROR_RX_UNEXPECTED_HANDSHAKE), -12234 (SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2747B || 123 || 314 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12263 (SSL_ERROR_RX_RECORD_TOO_LONG).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2767B || 123 || 315 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12165 (SSL_ERROR_RX_UNEXPECTED_HELLO_VERIFY_REQUEST).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2787B || 123 || 316 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12163 (SSL_ERROR_RX_UNEXPECTED_CERT_STATUS).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27A7B || 123 || 317 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12160 (SSL_ERROR_INCORRECT_SIGNATURE_ALGORITHM).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27C7B || 123 || 318 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12173 (SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY), -12156 (SSL_ERROR_WEAK_SERVER_CERT_KEY).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27E7B || 123 || 319 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12273 (SSL_ERROR_BAD_MAC_READ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2827B || 123 || 321 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL errors: -12215 (SSL_ERROR_MD5_DIGEST_FAILURE), -12214 (SSL_ERROR_SHA_DIGEST_FAILURE), -12161 (SSL_ERROR_DIGEST_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2847B || 123 || 322 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12213 (SSL_ERROR_MAC_COMPUTATION_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2887B || 123 || 324 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8157 (SEC_ERROR_EXTENSION_NOT_FOUND).&lt;br /&gt;
|-&lt;br /&gt;
| 0x28A7B || 123 || 325 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8049 (SEC_ERROR_UNRECOGNIZED_OID).&lt;br /&gt;
|-&lt;br /&gt;
| 0x28C7B || 123 || 326 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SEC error -8032 (SEC_ERROR_POLICY_VALIDATION_FAILED).&lt;br /&gt;
|-&lt;br /&gt;
| 0x2947B || 123 || 330 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12177 (SSL_ERROR_DECOMPRESSION_FAILURE).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBA7B || 123 || 1501 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12230 (SSL_ERROR_CLOSE_NOTIFY_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBC7B || 123 || 1502 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12229 (SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBBE7B || 123 || 1503 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12272 (SSL_ERROR_BAD_MAC_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC07B || 123 || 1504 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12197 (SSL_ERROR_DECRYPTION_FAILED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC27B || 123 || 1505 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12196 (SSL_ERROR_RECORD_OVERFLOW_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC47B || 123 || 1506 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12228 (SSL_ERROR_DECOMPRESSION_FAILURE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBC67B || 123 || 1507 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12227 (SSL_ERROR_HANDSHAKE_FAILURE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCA7B || 123 || 1509 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12271 (SSL_ERROR_BAD_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCC7B || 123 || 1510 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12225 (SSL_ERROR_UNSUPPORTED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBCE7B || 123 || 1511 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12270 (SSL_ERROR_REVOKED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD07B || 123 || 1512 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12269 (SSL_ERROR_EXPIRED_CERT_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD27B || 123 || 1513 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12224 (SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD47B || 123 || 1514 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12226 (SSL_ERROR_ILLEGAL_PARAMETER_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD67B || 123 || 1515 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12195 (SSL_ERROR_UNKNOWN_CA_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBD87B || 123 || 1516 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12194 (SSL_ERROR_ACCESS_DENIED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDA7B || 123 || 1517 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12193 (SSL_ERROR_DECODE_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDC7B || 123 || 1518 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12192 (SSL_ERROR_DECRYPT_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBDE7B || 123 || 1519 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12191 (SSL_ERROR_EXPORT_RESTRICTION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE07B || 123 || 1520 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12190 (SSL_ERROR_PROTOCOL_VERSION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE27B || 123 || 1521 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12189 (SSL_ERROR_INSUFFICIENT_SECURITY_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE47B || 123 || 1522 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12188 (SSL_ERROR_INTERNAL_ERROR_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE67B || 123 || 1523 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12157 (SSL_ERROR_INAPPROPRIATE_FALLBACK_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBE87B || 123 || 1524 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12187 (SSL_ERROR_USER_CANCELED_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEA7B || 123 || 1525 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12186 (SSL_ERROR_NO_RENEGOTIATION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEC7B || 123 || 1526 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12184 (SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBEE7B || 123 || 1527 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12183 (SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF07B || 123 || 1528 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12182 (SSL_ERROR_UNRECOGNIZED_NAME_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF27B || 123 || 1529 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12181 (SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0xBF47B || 123 || 1530 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12180 (SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT).&lt;br /&gt;
|-&lt;br /&gt;
| 0x27127B || 123 || 5001 || Converted from [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html NSS] SSL error -12155 (SSL_ERROR_RX_SHORT_DTLS_READ).&lt;br /&gt;
|-&lt;br /&gt;
| 0x271E7B || 123 || 5007 || Out-of-bounds error during error conversion.&lt;br /&gt;
|-&lt;br /&gt;
| 0x287C || 124 || 20 || Argument is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x2C7C || 124 || 22 || Argument is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C7C || 124 || 30 || Bad input buffer size&lt;br /&gt;
|-&lt;br /&gt;
| 0x407C || 124 || 32 || Invalid input buffer&lt;br /&gt;
|-&lt;br /&gt;
| 0x767C || 124 || 59 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 3000 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/27166/ System Update Required]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 3001 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28969/ Game Update Required]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4007 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28046/ Account Permanent Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4508 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/28046/ Account Permanent Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4517 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/43652/ Account Ban]&lt;br /&gt;
|-&lt;br /&gt;
|  || 124 || 4609 || [https://en-americas-support.nintendo.com/app/answers/detail/a_id/46482/ Service Discontinued]&lt;br /&gt;
|-&lt;br /&gt;
| 0x27E || 126 || 1 || Invalid argument&lt;br /&gt;
|-&lt;br /&gt;
| 0x87E || 126 || 4 || Entry not found&lt;br /&gt;
|-&lt;br /&gt;
| 0xCE7E || 126 || 67 || Invalid database signature value (should be &amp;quot;NFDB&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| 0xD27E || 126 || 69 || Invalid database entry count&lt;br /&gt;
|-&lt;br /&gt;
| 0x1987E || 126 || 204 || Development/debug-only behavior&lt;br /&gt;
|-&lt;br /&gt;
| 0x480 || 128 || 2 || IStorage not available.&lt;br /&gt;
|-&lt;br /&gt;
| 0x680 || 128 || 3 || No messages&lt;br /&gt;
|-&lt;br /&gt;
| 0x4680 || 128 || 35 || Error while launching applet.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4A80 || 128 || 37 || Title-ID not found. Caused by code 0x410 when applet launch fails&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E880 || 128 || 500 || Invalid input&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EC80 || 128 || 502 || IStorage has already been opened by another accessor&lt;br /&gt;
|-&lt;br /&gt;
| 0x3EE80 || 128 || 503 || IStorage Read/Write out-of-bounds&lt;br /&gt;
|-&lt;br /&gt;
| 0x3F480 || 128 || 506 || Invalid parameters&lt;br /&gt;
|-&lt;br /&gt;
| 0x3FE80 || 128 || 511 || IStorage opened as wrong type (data opened as transfermem, transfermem opened as data)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40080 || 128 || 512 || Unbalanced fatal section leave (returned when executing LeaveFatalSection without a preceding EnterFatalSection call)&lt;br /&gt;
|-&lt;br /&gt;
| 0x40C80 || 128 || 518 || Null object&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B080 || 128 || 600 || Failed to allocate memory for IStorage&lt;br /&gt;
|-&lt;br /&gt;
| 0x59080 || 128 || 712 || Thread stack pool exhausted (out of memory)&lt;br /&gt;
|-&lt;br /&gt;
| 0x79C80 || 128 || 974 || DebugMode not enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x7A880 || 128 || 980 || &amp;lt;code&amp;gt;am.debug!dev_function&amp;lt;/code&amp;gt; setting needs to be set / DebugMode not enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x7CC80 || 128 || 998 || Not implemented&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC81 || 129 || 102 || Transmission not agreed&lt;br /&gt;
|-&lt;br /&gt;
| 0xD281 || 129 || 105 || Network unavailable&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DA81 || 129 || 1005 || HTTP error: Couldnt resolve proxy&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DC81 || 129 || 1006 || HTTP error: Couldnt resolve host&lt;br /&gt;
|-&lt;br /&gt;
| 0x7DE81 || 129 || 1007 || HTTP error: Couldnt connect&lt;br /&gt;
|-&lt;br /&gt;
| 0x7FE81 || 129 || 1023 || HTTP error: Write error&lt;br /&gt;
|-&lt;br /&gt;
| 0x80481 || 129 || 1026 || HTTP error: Read error&lt;br /&gt;
|-&lt;br /&gt;
| 0x80681 || 129 || 1027 || HTTP error: Out of memory&lt;br /&gt;
|-&lt;br /&gt;
| 0x80881 || 129 || 1028 || HTTP error: Operation timedout&lt;br /&gt;
|-&lt;br /&gt;
| 0x81681 || 129 || 1035 || HTTP error: SSL connect error&lt;br /&gt;
|-&lt;br /&gt;
| 0x83681 || 129 || 1051 || HTTP error: Peer failed verification&lt;br /&gt;
|-&lt;br /&gt;
| 0x83881 || 129 || 1052 || HTTP error: Got nothing&lt;br /&gt;
|-&lt;br /&gt;
| 0x83E81 || 129 || 1055 || HTTP error: Send error&lt;br /&gt;
|-&lt;br /&gt;
| 0x84081 || 129 || 1056 || HTTP error: Recv error&lt;br /&gt;
|-&lt;br /&gt;
| 0x84481 || 129 || 1058 || HTTP error: SSL cert problem&lt;br /&gt;
|-&lt;br /&gt;
| 0x84681 || 129 || 1059 || HTTP error: SSL cipher&lt;br /&gt;
|-&lt;br /&gt;
| 0x84881 || 129 || 1060 || HTTP error: SSL CA cert&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C081 || 129 || 2400 || Server error: Status 400&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C281 || 129 || 2401 || Server error: Status 401&lt;br /&gt;
|-&lt;br /&gt;
| 0x12C681 || 129 || 2403 || Server error: Status 403&lt;br /&gt;
|-&lt;br /&gt;
| 0x138881 || 129 || 2500 || Server error: Status 500&lt;br /&gt;
|-&lt;br /&gt;
| 0x138E81 || 129 || 2503 || Server error: Status 503&lt;br /&gt;
|-&lt;br /&gt;
| 0x139081 || 129 || 2504 || Server error: Status 504&lt;br /&gt;
|-&lt;br /&gt;
| 0xA83 || 131 || 5 || Unrecognized applet ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x485 || 133 || 2 || Invalid DVFS table ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x685 || 133 || 3 || DVFS table ID for debug only, see [[PCV_services#Module|DVFS Table]] notes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x885 || 133 || 4 || Invalid parameter&lt;br /&gt;
|-&lt;br /&gt;
| 0x1489 || 137 || 10 || Already initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C89 || 137 || 30 || Task not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x5089 || 137  || 40 || Memory allocation failed / bad input.&lt;br /&gt;
|-&lt;br /&gt;
| 0x29489 || 137 || 330 || [[NCM_services#ContentMetaType|ContentMetaType]] doesn&#039;t match SystemUpdate.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271289 || 137 || 5001 || One of the following socket errors occurred: ENETDOWN, ECONNRESET, EHOSTDOWN, EHOSTUNREACH, or EPIPE. Also occurs when the received size doesn&#039;t match the expected size (recvfrom() ret with [[NIM_services#Contents_Delivery|meta_size]] data receiving).&lt;br /&gt;
|-&lt;br /&gt;
| 0x272489 || 137 || 5010 || Socket was [[Sockets_services|shutdown()]] due to the async operation being cancelled.&lt;br /&gt;
|-&lt;br /&gt;
| 0x273889 || 137 || 5020 || Too many internal output entries with [[NIM_services|nim]] cmd42, system is [[NIM_services#Contents_Delivery|Internet-connected]], or an unrecognized socket error occured.&lt;br /&gt;
|-&lt;br /&gt;
| 0x27D889 || 137 || 5100 || Connection timeout.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A4489 || 137 || 5410 || Invalid [[NIM_services#Contents_Delivery|ID]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A5889 || 137 || 5420 || Invalid [[NIM_services#Contents_Delivery|magicnum]]. Can also be caused by the connection being closed by the peer, since non-negative return values from recv() are ignored in this case.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A6C89 || 137 || 5430 || Invalid [[NIM_services#Contents_Delivery|data_size]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A8089 || 137 || 5440 || The input [[NCM_services#ContentMetaKey|ContentMetaKey]] doesn&#039;t match the ContentMetaKey in state.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2A9489 || 137 || 5450 || Invalid [[NIM_services#Contents_Delivery|meta_size]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B289 || 137 || 7001 || HTTP invalid response code (&amp;gt;=600).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B489 || 137 || 7002 || HTTP invalid client response code (4xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B689 || 137 || 7003 || HTTP invalid server response code (5xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x36B889 || 137 || 7004 || HTTP invalid redirect response code (3xx).&lt;br /&gt;
|-&lt;br /&gt;
| 0x390889-0x391889 || 137 || 7300-7308 || HTTP response code 300-308.&lt;br /&gt;
|-&lt;br /&gt;
| 0x39D089-0x39F289 || 137 || 7400-7417 || HTTP response code 400-417.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3A9889-0x3AAA89 || 137 || 7500-7509 || HTTP response code 500-509.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CF089 || 137 || 7800 || Unknown/invalid libcurl error.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E8289-0x3F4089 || 137 || 8001-8096 || libcurl error 1-96. Some of the libcurl errors in the error-table map to the above unknown-libcurl-error however.&lt;br /&gt;
|-&lt;br /&gt;
| 0x68A || 138 || 3 || Not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x668C || 140 || 51 || USB data-transfer in progress&lt;br /&gt;
|-&lt;br /&gt;
| 0xD48C || 140 || 106 || Invalid descriptor&lt;br /&gt;
|-&lt;br /&gt;
| 0x1928C || 140 || 201 || USB device not bound / interface already enabled&lt;br /&gt;
|-&lt;br /&gt;
| 0x1BE8E || 142 || 223 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x290 || 144 || 1 || Exited Abnormally ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Abormal)&lt;br /&gt;
|-&lt;br /&gt;
| 0x690 || 144 || 3 || Canceled ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Canceled)&lt;br /&gt;
|-&lt;br /&gt;
| 0x890 || 144 || 4 || Rejected&lt;br /&gt;
|-&lt;br /&gt;
| 0xA90 || 144 || 5 || Exited Unexpectedly ([[Applet_Manager_services#LibraryAppletExitReason|ExitReason]] == Unexpected)&lt;br /&gt;
|-&lt;br /&gt;
| 0x299 || 153 || 1 || Invalid audio device&lt;br /&gt;
|-&lt;br /&gt;
| 0x499 || 153 || 2 || Operation couldn&#039;t complete successfully&lt;br /&gt;
|-&lt;br /&gt;
| 0x699 || 153 || 3 || Invalid sample rate&lt;br /&gt;
|-&lt;br /&gt;
| 0x899 || 153 || 4 || Buffer size too small&lt;br /&gt;
|-&lt;br /&gt;
| 0x1099 || 153 || 8 || Too many buffers are still unreleased&lt;br /&gt;
|-&lt;br /&gt;
| 0x1499 || 153 || 10 || Invalid channel count&lt;br /&gt;
|-&lt;br /&gt;
| 0x40299 || 153 || 513 || Invalid/Unsupported operation&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0099 || 153 || 1536 || Invalid handle&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0899 || 153 || 1540 || Audio output was already started&lt;br /&gt;
|-&lt;br /&gt;
| 0x3C9D || 157 || 30 || Address is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x3E9D || 157 || 31 || PID is NULL&lt;br /&gt;
|-&lt;br /&gt;
| 0x549D || 157 || 42 || Already bound&lt;br /&gt;
|-&lt;br /&gt;
| 0xCC9D || 157 || 102 || Invalid PID&lt;br /&gt;
|-&lt;br /&gt;
| 0x49E || 158 || 2 || BootImagePackage not found&lt;br /&gt;
|-&lt;br /&gt;
| 0x69E || 158 || 3 || Invalid BootImagePackage&lt;br /&gt;
|-&lt;br /&gt;
| 0x89E || 158 || 4 || Work buffer too small&lt;br /&gt;
|-&lt;br /&gt;
| 0xA9E || 158 || 5 || Work buffer not aligned&lt;br /&gt;
|-&lt;br /&gt;
| 0xC9E || 158 || 6 || BootImages need repair&lt;br /&gt;
|-&lt;br /&gt;
| 0x29F || 159 || 1 || Cancel was selected&lt;br /&gt;
|-&lt;br /&gt;
| 0xAA3 || 163 ||  5 || System is booting up repair process without VOL+ held down.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCA3 || 163 || 6 || System is booting up repair process that requires RepairTimeReviser but does not have special cartridge inserted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x70A4 || 164 || 56 || [[Network_Interface_services#IsAnyInternetRequestAccepted|IsAnyInternetRequestAccepted]] with the output from [[#Network_Interface_services#GetClientId|GetClientId]] returned false.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4AF || 175 || 2 || Bad version returned from calling the &amp;quot;nnjitpluginGetVersion&amp;quot; symbol.&lt;br /&gt;
|-&lt;br /&gt;
| 0xCAAF || 175 || 101 || Input NRO/NRR are too large for the storage buffer.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B0AF || 175 || 600 || Symbol funcptr used by this cmd is not initialized (Control/GenerateCode).&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B2AF || 175 || 601 || DllPlugin Not initialized, or plugin NRO has already been loaded.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4B4AF || 175 || 602 || An error was returned from calling the symbol funcptr with the Control cmd.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC8B2 || 178 || 100 || Invalid user ID&lt;br /&gt;
|-&lt;br /&gt;
| 0xCAB2 || 178 || 101 || User does not exist&lt;br /&gt;
|-&lt;br /&gt;
| 0x12CB2 || 178 || 150 || Service unavailable&lt;br /&gt;
|-&lt;br /&gt;
| 0x190B2 || 178 || 200 || File storage failure&lt;br /&gt;
|-&lt;br /&gt;
| 0xAB4 || 180 || 5 || Invalid event ID&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4EB5 || 181 || 4007 || Device authentication error: System update required&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F50B5 || 181 || 4008 || Device authentication error: [https://en-americas-support.nintendo.com/app/answers/detail/a_id/42061/ Permanant Ban]&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F52B5 || 181 || 4009 || Device authentication error: Internal server error&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F54B5 || 181 || 4007 || Device authentication error: Under maintenance&lt;br /&gt;
|-&lt;br /&gt;
|  || 181 || 4017 || Device authentication error: [https://en-americas-support.nintendo.com/app/answers/detail/a_id/43653/ Ban]&lt;br /&gt;
|-&lt;br /&gt;
| 0x58ACA || 202 || 709 || Npad ID is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2032CA || 202 || 4121 || [[Settings_services#ButtonConfigSettings|ButtonConfigSettings]] IsFull flag is clear.&lt;br /&gt;
|-&lt;br /&gt;
| 0x28CB || 203 || 20 || The [6.0.0+] Authentication challenge failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40CB || 203 || 32 || Bad State / bad state ptr.&lt;br /&gt;
|-&lt;br /&gt;
| 0x82CB || 203 || 65 || Failed to connect to the AccessPoint.&lt;br /&gt;
|-&lt;br /&gt;
| 0x84CB || 203 || 66 || Timeout occured during Authentication / while attempting to find a valid ActionFrame.&lt;br /&gt;
|-&lt;br /&gt;
| 0x86CB || 203 || 67 || Maximum participants reached, Station not allowed to connect, ...&lt;br /&gt;
|-&lt;br /&gt;
| 0xC0CB || 203 || 96 || Bad input, or not initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0xC2CB || 203 || 97 || Matching LocalCommunicationId not found in the user-process [[NACP_Format|control.nacp]].&lt;br /&gt;
|-&lt;br /&gt;
| 0xE2CB || 203 || 113 || The specified LocalCommunicationVersion is less than the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0xE4CB || 203 || 114 || The specified LocalCommunicationVersion is larger than the AccessPoint LocalCommunicationVersion.&lt;br /&gt;
|-&lt;br /&gt;
| 0xF0CD || 205 || 120 || IR image data not available/ready.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A8CD || 205 || 212 || IR camera handle pointer is null.&lt;br /&gt;
|-&lt;br /&gt;
| 0x198CD || 205 || 204 || IR camera invalid handle value.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4CE || 206 || 2 || Invalid argument.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6CE || 206 || 3 || Out of memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10CE || 206 || 8 || Out of range. Buffer needs to be aligned.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18CE || 206 || 12 || Invalid FileId.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1ACE || 206 || 13 || Invalid storage ID.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1CCE || 206 || 14 || Invalid content type.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2ACE || 206 || 21 || Failed to mount Image Directory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2CCE || 206 || 23 || File too big.&lt;br /&gt;
|-&lt;br /&gt;
| 0x30CE || 206 || 24 || Invalid file size.&lt;br /&gt;
|-&lt;br /&gt;
| 0x3CCE || 206 || 30 || Buffer insufficient.&lt;br /&gt;
|-&lt;br /&gt;
| 0xAF2CE || 206 || 1401 || Too many files already saved.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4DA || 218 || 2 || StatusManager entry IsValid flag not set, or controller-update currently in-progress.&lt;br /&gt;
|-&lt;br /&gt;
| 0x6DA || 218 || 3 || Controller-update failed via the LibraryApplet.&lt;br /&gt;
|-&lt;br /&gt;
| 0x8DA || 218 || 4 || Invalid BusHandle.&lt;br /&gt;
|-&lt;br /&gt;
| 0xADA || 218 || 5 || StatusManager entry flag +0x0 not set, or device not connected.&lt;br /&gt;
|-&lt;br /&gt;
| 0xEDA || 218 || 7 || PollingReceivedData not available.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10DA || 218 || 8 || StatusManager entry DeviceEnabled flag not set, or flag +0x0 not set.&lt;br /&gt;
|-&lt;br /&gt;
| 0x12DA || 218 || 9 || ExternalDeviceId mismatch.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14DA || 218 || 10 || BusHandle already initialized.&lt;br /&gt;
|-&lt;br /&gt;
| 0x104E7 || 231 || 130 || Nullptr passed to the LocalCommunicationId [[NACP_Format|control.nacp]] validation func.&lt;br /&gt;
|-&lt;br /&gt;
| 0x146E7 || 231 || 163 || Invalid ServiceName.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C2E7 || 231 || 225 || Matching LocalCommunicationId not found in the user-process [[NACP_Format|control.nacp]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== FS Error codes ===&lt;br /&gt;
The following are the error codes recognized by nn::fs::detail::LogErrorMessage found in some [[Factory Setup|factory]] titles:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Description || Message&lt;br /&gt;
|-&lt;br /&gt;
| 0xD401 || 106 || nn::svc::ResultInvalidCurrentMemory: Error: Passed buffer is not usable for fs library. See a manual of fs library for more information.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7802 || 60 || nn::fs::ResultMountNameAlreadyExists: Error: Specified mount name already exists.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D202 || 1001 || nn::fs::ResultPartitionNotFound: Error: Specified partition is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0x7D402 || 1002 || nn::fs::ResultTargetNotFound: Error: Specified target is not found.&lt;br /&gt;
|-&lt;br /&gt;
| 0xFA002 - 0x138602 || 2000 - 2499 || nn::fs::ResultSdCardAccessFailed: Error: Failed to access SD card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x136802 - 0x176E02 || 2500 - 2999 || nn::fs::ResultGameCardAccessFailed: Error: Failed to access game card.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177202 || 3001 || nn::fs::ResultNotImplemented: Error: Specified operation is not implemented.&lt;br /&gt;
|-&lt;br /&gt;
| 0x177A02 || 3005 || nn::fs::ResultOutOfRange: Error: Specified value is out of range.&lt;br /&gt;
|-&lt;br /&gt;
| 0x190002 - 0x1B5602 || 3200 - 3499 || nn::fs::ResultAllocationMemoryFailed: Error: Failed to allocate memory.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1B5802 - 0x1F3E02 || 3500 - 3999 || nn::fs::ResultMmcAccessFailed: Error: Failed to access MMC.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4202 - 0x219602 || 4001 - 4299 || nn::fs::ResultRomCorrupted: Error: ROM is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x219A02 - 0x232602 || 4301 - 4499 || nn::fs::ResultSaveDataCorrupted: Error: Save data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x232A02 - 0x23EE02 || 4501 - 4599 || nn::fs::ResultNcaCorrupted: Error: NCA is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x23F202 - 0x243E02 || 4601 - 4639 || nn::fs::ResultIntegrityVerificationStorageCorrupted: Error: Integrity verification failed.&lt;br /&gt;
|-&lt;br /&gt;
| 0x244202 - 0x246602 || 4641 - 4659 || nn::fs::ResultPartitionFileSystemCorrupted: Error: Partition FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x246A02 - 0x248E02 || 4661 - 4679 || nn::fs::ResultBuiltInStorageCorrupted: Error: Built-in-storage is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x249202 - 0x24B602 || 4681 - 4699 || nn::fs::ResultFatFileSystemCorrupted: Error: FAT FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x24BA02 - 0x24DE02 || 4701 - 4719 || nn::fs::ResultHostFileSystemCorrupted: Error: HOST FS is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1F4002 - 0x270E02 || 4000, 4300, 4500, 4600, 4640, 4660, 4680, 4700, 4720-4999 || nn::fs::ResultDataCorrupted: Error: Data is corrupted.&lt;br /&gt;
|-&lt;br /&gt;
| 0x271002 - 0x2EDE02 || 5000-5999 || nn::fs::ResultUnexpected: Error: Unexpected failure occurred.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE002 - 0x32C602 || 6000-6499 || nn::fs::ResultPreconditionViolation: Error: Precondition violation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE202 - 0x306E02 || 6001-6199 || nn::fs::ResultInvalidArgument: Error: Invalid argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE402 - 0x2F1A02 || 6002-6029 || nn::fs::ResultInvalidPath: Error: Invalid path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE602 || 6003 || nn::fs::ResultTooLongPath: Error: Too long path was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EE802 || 6004 || nn::fs::ResultInvalidCharacter: Error: Invalid path character was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2EEA02 || 6005 || nn::fs::ResultInvalidPathFormat: Error: Invalid path format was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5A02 || 6061 || nn::fs::ResultInvalidOffset: Error: Invalid offset was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5C02 || 6062 || nn::fs::ResultInvalidSize: Error: Invalid size was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F5E02 || 6063 || nn::fs::ResultNullptrArgument: Error: Null pointer argument was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6202 || 6065 || nn::fs::ResultInvalidMountName: Error: Invalid mount name was specified.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6402 || 6066 || nn::fs::ResultExtensionSizeTooLarge: Error: Extension size exceeds max value set in nmeta file.&lt;br /&gt;
|-&lt;br /&gt;
| 0x2F6602 || 6067 || nn::fs::ResultExtensionSizeInvalid: Error: Extension size is not a multiple of nn::fs::SaveDataExtensionUnitSize.&lt;br /&gt;
|-&lt;br /&gt;
| 0x307202 || 6201 || nn::fs::ResultFileExtensionWithoutOpenModeAllowAppend: Error: OpenMode_AllowAppend is required for implicit extension of file size by WriteFile().&lt;br /&gt;
|-&lt;br /&gt;
| 0x307002 - 0x313602 || 6200, 6202 - 6299 || nn::fs::ResultInvalidOperationForOpenMode: Error: Invalid operation for the open mode.&lt;br /&gt;
|-&lt;br /&gt;
| 0x313802 - 0x31FE02 || 6300-6399 || nn::fs::ResultUnsupportedOperation: Error: Unsupported operation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x320002 - 0x326202 || 6400-6449 || nn::fs::ResultPermissionDenied: Error: Permission denied.&lt;br /&gt;
|-&lt;br /&gt;
| 0x327202 || 6457 || nn::fs::ResultWriteModeFileNotClosed: Error: Close files opened in write mode before committing.&lt;br /&gt;
|-&lt;br /&gt;
| 0x328202 || 6465 || nn::fs::ResultUserNotExist: Error: Specified user doesn&#039;t exist.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346402 || 6706 || nn::fs::ResultMappingTableFull: Error: Enough journal space is not left.&lt;br /&gt;
|-&lt;br /&gt;
| 0x346A02 || 6709 || nn::fs::ResultOpenCountLimit: Error: The open count of files and directories reached the limitation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x353602 || 6811 || nn::fs::ResultMapFull: Error: Save data extension count reached the limitation.&lt;br /&gt;
|-&lt;br /&gt;
| 0x35F202 || 6905 || nn::fs::ResultNotMounted: Error: Specified mount name is not found.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Fatal Errors =&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Error || Description&lt;br /&gt;
|-&lt;br /&gt;
| 2162-0002&lt;br /&gt;
| Can be triggered by running [[SVC|svcBreak]]. The svcBreak params have no effect on the value of the thrown error-code.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0000&lt;br /&gt;
| Userland ARM undefined instruction exception&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0001&lt;br /&gt;
| Userland ARM prefetch-abort due to PC set to non-executable region&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0002&lt;br /&gt;
| Userland ARM data abort. Also caused by abnormal process termination via [[SVC|svcExitProcess]]. Note: directly jumping to nnMain()-retaddr from non-main-thread has the same result.&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0003&lt;br /&gt;
| Userland PC address not aligned to 4 bytes&lt;br /&gt;
|-&lt;br /&gt;
| 2168-0008&lt;br /&gt;
| Can occur when attempting to call an svc outside the whitelist&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Support Errors =&lt;br /&gt;
This section is for Support Errors displayed by the error-applet, separate from the normal Result Errors.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 520 || Nverpt&lt;br /&gt;
|-&lt;br /&gt;
| 800 || [[Internet_Browser|General web-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 809 || [[Internet_Browser|WifiWebAuthApplet]]&lt;br /&gt;
|-&lt;br /&gt;
| 810 || [[Internet_Browser|Whitelisted-applet]]&lt;br /&gt;
|-&lt;br /&gt;
| 811 || [[Internet_Browser|ShopN]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
8XX is for/includes system applets.&lt;br /&gt;
&lt;br /&gt;
== Error codes ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Module || Description || Notes&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| {web-applets listed above}&lt;br /&gt;
| 2750&lt;br /&gt;
| MP4 parsing failed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Normal error-codes displayed by the system also use the same format as fatal-errors.&lt;br /&gt;
&lt;br /&gt;
= Homebrew Errors =&lt;br /&gt;
Custom errors used by homebrew libraries and applications.&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Value || Name&lt;br /&gt;
|-&lt;br /&gt;
| 345 || libnx&lt;br /&gt;
|-&lt;br /&gt;
| 346 || [[Homebrew ABI]]&lt;br /&gt;
|-&lt;br /&gt;
| 347 || Homebrew Loader&lt;br /&gt;
|-&lt;br /&gt;
| 348 || libnx NVIDIA errors&lt;br /&gt;
|-&lt;br /&gt;
| 349 || libnx Binder errors&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>CFSworks</name></author>
	</entry>
</feed>