Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an initial implementation of
nn::uds
, which can be used for communicating with nearby 3DS devices locally using local Wi-Fi. Not every function has been added on this PR due to either it being a low level function (such as makingIoctlv
calls directly) or missing research. I would like suggestions as to whether the headers are well organized or how to improve them, these have also been organized in a way for future-proofing ann::dlp
implementation in the future, due to header dependencies.Technical details
nn::uds
is essentially a C++ wrapper around the/dev/udscntrl
IOSU, which only exposes the needed functionality for hosting a network. A lot of the concepts and structures are the same as on the 3DS implementation, to the extent where most theIoctlv
commands share the same value as the IPC command IDs on the 3DS. For this reason, most of the research and documentation has been inherited from libctru and 3dbrew.Not everything has been imported though. For example, the broadcast flag on
SendTo
from the 3DS hasn't been included here due to lack of testing, and the fact thatReceive(From)
does include aflag
argument, whereas on the 3DS doesn't, and thus creating uncertainty as to whether this flag works on here too.The
Initialize
function takes a "work memory" buffer (I chose that name based on similar cases on other Wii U libraries), similar to the 3DS "shared memory". It has been observed on various games that the size of0x14000
was used when allocating this work memory, so I put that as recommendation. If there is a better way to handle this, please let me know!It should be noted that the Wii U version of UDS only allows hosting networks, you cannot connect to other networks.
Research note: It is unknown whether the
/dev/udscntrl
IOSU exposes the functionality to connect to networks, and while it may be possible given the similarities on the command IDs, that is considered out of scope.Testing
This PR has been tested successfully against the 3DS example of UDS, the source code for this (rushed up) test can be found here: https://github.com/DaniElectra/uds-wiiu-test