[TABLE=full]
[TR]
[TD][/TD]
[/TR]
[/TABLE]
PostBufferAsync
Takes an input u32
Size and an input u64
Buffer. Returns an output u32
UrbId.
The output urbId can then be used while parsing the output of
#GetUrbReport, after waiting for the CompletionEvent to be signalled.
The buffer address must be 0x1000-byte aligned. The input size doesn't matter. It helps to use svcSetMemoryAttribute to turn off caching on the buffer.
Used for data-transfer with input/output endpoints.
The user-process must flush dcache for the buffer before using this command.
When sending data where size is larger than wMaxPacketSize, it will automatically send multiple USB packets where last packet size = {remaining size}. Every {wMaxPacketSize}-bytes is a different packet. This only occurs in some cases.
When size is ~0x1000000(exact size unknown), Switch-side silently hangs, while host-side will timeout(no traffic on USB bus indicating failure).
For receiving data, if size is less than {actual received USB packet size} the rest of the packet will be discarded. Later PostBufferAsync cmd(s) will only return data from new packets, not the remainder of the earlier packet(s).