LDN services: Difference between revisions
No edit summary |
No edit summary |
||
Line 128: | Line 128: | ||
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]] | | 104 || [5.0.0+] [[#SetWirelessControllerRestriction]] | ||
|- | |- | ||
| 105 || [13.1.0+] SetBluetoothAudioDeviceConnectableMode | | 105 || [13.1.0+] [[#SetBluetoothAudioDeviceConnectableMode]] | ||
|- | |- | ||
| 106 || [18.0.0+] | | 106 || [18.0.0+] | ||
Line 170: | Line 170: | ||
| 403 || [7.0.0+] [[#InitializeSystem2]] | | 403 || [7.0.0+] [[#InitializeSystem2]] | ||
|- | |- | ||
| 500 || [18.0.0+] | | 500 || [18.0.0+] EnableActionFrame | ||
|- | |- | ||
| 501 || [18.0.0+] | | 501 || [18.0.0+] DisableActionFrame | ||
|- | |- | ||
| 502 || [18.0.0+] | | 502 || [18.0.0+] SendActionFrame | ||
|- | |- | ||
| 503 || [18.0.0+] | | 503 || [18.0.0+] RecvActionFrame | ||
|- | |- | ||
| 505 || [18.0.0+] | | 505 || [18.0.0+] SetHomeChannel | ||
|- | |- | ||
| 600 || [18.0.0+] | | 600 || [18.0.0+] SetTxPower | ||
|- | |- | ||
| 601 || [18.0.0+] | | 601 || [18.0.0+] ResetTxPower | ||
|} | |} | ||
=== GetState === | === GetState === | ||
No input, returns an output | No input, returns an output [[#State]]. | ||
sdknso implements this by <code>return</code>ing the u32, with 0 being returned on error / when service isn't initialized. | sdknso implements this by <code>return</code>ing the u32, with 0 being returned on error / when service isn't initialized. | ||
=== GetNetworkInfo === | === GetNetworkInfo === | ||
Line 218: | Line 197: | ||
=== GetDisconnectReason === | === GetDisconnectReason === | ||
No input, returns an output | No input, returns an output [[#DisconnectReason]]. | ||
sdknso implements this by <code>return</code>ing the s16 as a s32, with -1 being returned on error. | sdknso implements this by <code>return</code>ing the s16 as a s32, with -1 being returned on error. | ||
=== GetSecurityParameter === | === GetSecurityParameter === | ||
Line 286: | Line 243: | ||
The input value is written into state. | The input value is written into state. | ||
=== SetBluetoothAudioDeviceConnectableMode === | |||
Takes an input [[#BluetoothAudioDeviceConnectableMode]], no output. | |||
=== OpenAccessPoint === | === OpenAccessPoint === | ||
Line 468: | Line 428: | ||
| 104 || [5.0.0+] [[#SetWirelessControllerRestriction]] | | 104 || [5.0.0+] [[#SetWirelessControllerRestriction]] | ||
|- | |- | ||
| 105 || [13.1.0+] SetBluetoothAudioDeviceConnectableMode | | 105 || [13.1.0+] [[#SetBluetoothAudioDeviceConnectableMode]] | ||
|- | |- | ||
| 106 || [18.0.0+] | | 106 || [18.0.0+] | ||
Line 508: | Line 468: | ||
| 402 || [7.0.0+] [[#Initialize2]] | | 402 || [7.0.0+] [[#Initialize2]] | ||
|- | |- | ||
| 500 || [18.0.0+] | | 500 || [18.0.0+] EnableActionFrame | ||
|- | |- | ||
| 501 || [18.0.0+] | | 501 || [18.0.0+] DisableActionFrame | ||
|- | |- | ||
| 502 || [18.0.0+] | | 502 || [18.0.0+] SendActionFrame | ||
|- | |- | ||
| 503 || [18.0.0+] | | 503 || [18.0.0+] RecvActionFrame | ||
|- | |- | ||
| 505 || [18.0.0+] | | 505 || [18.0.0+] SetHomeChannel | ||
|- | |- | ||
| 600 || [18.0.0+] | | 600 || [18.0.0+] SetTxPower | ||
|- | |- | ||
| 601 || [18.0.0+] | | 601 || [18.0.0+] ResetTxPower | ||
|} | |} | ||
Line 869: | Line 829: | ||
=== Initialize === | === Initialize === | ||
Returns 0. | Returns 0. | ||
= State = | |||
This is "nn::ldn::State". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| 0 || None | |||
|- | |||
| 1 || Initialized | |||
|- | |||
| 2 || AccessPoint | |||
|- | |||
| 3 || AccessPointCreated | |||
|- | |||
| 4 || Station | |||
|- | |||
| 5 || StationConnected | |||
|- | |||
| 6 || Error | |||
|- | |||
|} | |||
= Ipv4Address = | = Ipv4Address = | ||
Line 893: | Line 877: | ||
! Description | ! Description | ||
|- | |- | ||
| 0x0 || 0x1 || Length excluding NUL-terminator, must be 0x1-0x20 | | 0x0 || 0x1 || Length (excluding NUL-terminator, must be 0x1-0x20) | ||
|- | |- | ||
| 0x1 || 0x21 || SSID string including NUL-terminator, str[{above length}] must be 0 | | 0x1 || 0x21 || Raw (SSID string including NUL-terminator, str[{above length}] must be 0) | ||
|} | |} | ||
Line 987: | Line 971: | ||
| 0x4C || 0x10 || Cleared to zero for the tmp struct. | | 0x4C || 0x10 || Cleared to zero for the tmp struct. | ||
|- | |- | ||
| 0x5C || 0x4 || | | 0x5C || 0x4 || [[#ScanFilterFlag|Flag]] (masked with 0x37 for [[#Scan]], with [[#ScanPrivate]] this is masked with 0x3F) | ||
|} | |} | ||
= ScanFilterFlag = | |||
This is "nn::ldn::ScanFilterFlag". | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! | ! Value | ||
! Description | ! Description | ||
|- | |||
| 0x0 || None | |||
|- | |||
| 0x1 || LocalCommunicationId | |||
|- | |||
| 0x2 || SessionId | |||
|- | |||
| 0x4 || NetworkType | |||
|- | |- | ||
| | | 0x8 || Bssid | ||
|- | |- | ||
| | | 0x10 || Ssid | ||
|- | |- | ||
| | | 0x20 || SceneId | ||
|- | |- | ||
| | | 0x21 || IntentId | ||
|- | |- | ||
| | | 0x23 || NetworkId | ||
|- | |- | ||
| | | 0x3F || All | ||
|} | |} | ||
Line 1,064: | Line 1,057: | ||
! Description | ! Description | ||
|- | |- | ||
| 0 || | | 0 || Disabled | ||
|- | |||
| 1 || Enabled | |||
|} | |||
= BluetoothAudioDeviceConnectableMode = | |||
This is "nn::ldn::BluetoothAudioDeviceConnectableMode". This is an u32 enum. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| 0 || Disabled | |||
|- | |||
| 1 || Enabled | |||
|} | |||
= SecurityMode = | |||
This is "nn::ldn::SecurityMode". This is an u32 enum. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| 0 || Any | |||
|- | |- | ||
| 1 || | | 1 || Product | ||
|- | |||
| 2 || Debug | |||
|- | |||
| 3 || SystemDebug | |||
|} | |} | ||
Line 1,078: | Line 1,101: | ||
! Description | ! Description | ||
|- | |- | ||
| 0x0 || 0x2 || | | 0x0 || 0x2 || [[#SecurityMode|SecurityMode]] (overwritten by [[#CreateNetwork]]/[[#CreateNetworkPrivate]] and [[#Connect]]/[[#ConnectPrivate]], the value used internally by these cmds must be 1-3) | ||
|- | |- | ||
| 0x2 || 0x2 || | | 0x2 || 0x2 || PassphraseSize (must be 0x10-0x40) | ||
|- | |- | ||
| 0x4 || 0x40 || | | 0x4 || 0x40 || Passphrase (used with key derivation) | ||
|} | |} | ||
Line 1,101: | Line 1,124: | ||
! Description | ! Description | ||
|- | |- | ||
| 0x0 || 0x10 || | | 0x0 || 0x10 || ServerRandom (used with the same key derivation as [[#SecurityConfig]]) | ||
|- | |- | ||
| 0x10 || 0x10 || | | 0x10 || 0x10 || [[#SessionId|SessionId]] | ||
|} | |||
= SessionId = | |||
This is "nn::ldn::SessionId". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size | |||
! Description | |||
|- | |||
| 0x0 || 0x10 || Random | |||
|} | |} | ||
Line 1,117: | Line 1,152: | ||
! Description | ! Description | ||
|- | |- | ||
| 0x0 || | | 0x0 || 0x21 || UserName (NUL-terminated string for the user nickname) | ||
|- | |- | ||
| | | 0x21 || 0xF || Reserved (cleared to zero during the copy) | ||
|} | |} | ||
Line 1,135: | Line 1,170: | ||
| 0x4 || 0x6 || [[#MacAddress|MacAddress]] | | 0x4 || 0x6 || [[#MacAddress|MacAddress]] | ||
|- | |- | ||
| 0xA || 0x2 || | | 0xA || 0x2 || Reserved | ||
|} | |} | ||
Line 1,146: | Line 1,181: | ||
! Description | ! Description | ||
|- | |- | ||
| 0 || | | 0 || AlwaysAccept | ||
|- | |- | ||
| 1 || | | 1 || AlwaysReject | ||
|- | |- | ||
| 2 || | | 2 || BlackList (addresses in the [[#AddAcceptFilterEntry|list]] are not allowed) | ||
|- | |- | ||
| 3 || | | 3 || WhiteList (only addresses in the [[#AddAcceptFilterEntry|list]] are allowed) | ||
|} | |} | ||
Line 1,173: | Line 1,208: | ||
| 0x4 || 0x6 || [[#MacAddress|MacAddress]] | | 0x4 || 0x6 || [[#MacAddress|MacAddress]] | ||
|- | |- | ||
| 0xA || 0x1 || | | 0xA || 0x1 || NodeId | ||
|- | |- | ||
| 0xB || 0x1 || IsConnected | | 0xB || 0x1 || IsConnected | ||
|- | |- | ||
| 0xC || | | 0xC || 0x21 || UserName (first 0x21-bytes of [[#UserConfig]]) | ||
|- | |- | ||
| | | 0x2D || 0x1 || Reserved | ||
|- | |- | ||
| 0x2E || 0x2 || | | 0x2E || 0x2 || LocalCommunicationVersion | ||
|- | |- | ||
| 0x30 || 0x10 || Reserved | | 0x30 || 0x10 || Reserved | ||
Line 1,194: | Line 1,229: | ||
This must be <=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]]. | This must be <=0x1, besides this validation ConnectOption is ignored by [[#Connect]]/[[#ConnectPrivate]]. | ||
= DisconnectReason = | |||
This is "nn::ldn::DisconnectReason". | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| -1 || Unknown | |||
|- | |||
| 0 || None | |||
|- | |||
| 1 || DisconnectedByUser | |||
|- | |||
| 2 || DisconnectedBySystem | |||
|- | |||
| 3 || DestroyedByUser | |||
|- | |||
| 4 || DestroyedBySystem | |||
|- | |||
| 5 || Rejected | |||
|- | |||
| 6 || SignalLost | |||
|} | |||
= OperationMode = | = OperationMode = | ||
Line 1,207: | Line 1,267: | ||
! Description | ! Description | ||
|- | |- | ||
| 0 || | | 0 || Stable | ||
|- | |- | ||
| 1 || | | 1 || HighSpeed | ||
|} | |} | ||
Line 1,313: | Line 1,373: | ||
** All string characters which were already written are summed same way as above. Then: <code>return character_lookup_table[sum % 0x2B];</code> (If the length passed to this function is 0, this will instead just return character_lookup_table[0]) | ** All string characters which were already written are summed same way as above. Then: <code>return character_lookup_table[sum % 0x2B];</code> (If the length passed to this function is 0, this will instead just return character_lookup_table[0]) | ||
*** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W]. | *** character_lookup_table contains 0x2B entries: [V-A][k-a][5-0][Z-W]. | ||
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): | 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): |