From 0c1e656a2bed5b02cf7a51fb24bca5cb71a88318 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Fri, 8 Apr 2016 01:20:21 -0400 Subject: [PATCH] Switched 'input8' for udsSendTo() to 'netflags'. Minor other changes. --- libctru/include/3ds/services/uds.h | 20 ++++++++++---------- libctru/source/services/uds.c | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libctru/include/3ds/services/uds.h b/libctru/include/3ds/services/uds.h index b0db512..9c519f9 100644 --- a/libctru/include/3ds/services/uds.h +++ b/libctru/include/3ds/services/uds.h @@ -13,8 +13,8 @@ /// NetworkNodeID for the host(the first node). #define UDS_HOST_NETWORKNODEID 0x1 -/// Default value that can be used for udsSendTo() input8. -#define UDS_SEND_INPUT8_DEFAULT 0xF3 +/// Default value that can be used for udsSendTo() netflags. +#define UDS_SEND_NETFLAGS_DEFAULT 0xF3 /// Node info struct. typedef struct { @@ -237,11 +237,11 @@ Result udsBind(udsBindContext *bindcontext, u16 NetworkNodeID, bool spectator); Result udsUnbind(udsBindContext *bindcontext); /** - * @brief Waits for the bind event to occur, or checks if the event was signalled. This event is signalled every time new data is available via udsPullPacket(). - * @return Always true. However if wait=false, this will return false if the event wasn't signalled. + * @brief Waits for the bind event to occur, or checks if the event was signaled. This event is signaled every time new data is available via udsPullPacket(). + * @return Always true. However if wait=false, this will return false if the event wasn't signaled. * @param bindcontext The bind context. * @param nextEvent Whether to discard the current event and wait for the next event. - * @param wait When true this will not return until the event is signalled. When false this checks if the event was signalled without waiting for it. + * @param wait When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it. */ bool udsWaitDataAvailable(const udsBindContext *bindcontext, bool nextEvent, bool wait); @@ -258,12 +258,12 @@ Result udsPullPacket(const udsBindContext *bindcontext, void *buf, size_t size, /** * @brief Sends data over the network. * @param dst_NetworkNodeID Destination NetworkNodeID. - * @param input8 UDS_SEND_INPUT8_DEFAULT can be used for this. It's unknown what this field is actually for. + * @param netflags UDS_SEND_NETFLAGS_DEFAULT can be used for this. This field is sent in the data frame NWM-module header. * @param flags Send flags, see the UDS_SENDFLAG enum values. * @param buf Input send buffer. * @param size Size of the buffer. */ -Result udsSendTo(u16 dst_NetworkNodeID, u8 input8, u8 flags, const void *buf, size_t size); +Result udsSendTo(u16 dst_NetworkNodeID, u8 netflags, u8 flags, const void *buf, size_t size); /** * @brief Gets the wifi channel currently being used. @@ -334,10 +334,10 @@ Result udsSetNewConnectionsBlocked(bool block, bool clients, bool spectators); Result udsGetConnectionStatus(udsConnectionStatus *output); /** - * @brief Waits for the ConnectionStatus event to occur, or checks if the event was signalled. This event is signalled when the data from udsGetConnectionStatus() was updated internally. - * @return Always true. However if wait=false, this will return false if the event wasn't signalled. + * @brief Waits for the ConnectionStatus event to occur, or checks if the event was signaled. This event is signaled when the data from udsGetConnectionStatus() was updated internally. + * @return Always true. However if wait=false, this will return false if the event wasn't signaled. * @param nextEvent Whether to discard the current event and wait for the next event. - * @param wait When true this will not return until the event is signalled. When false this checks if the event was signalled without waiting for it. + * @param wait When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it. */ bool udsWaitConnectionStatusEvent(bool nextEvent, bool wait); diff --git a/libctru/source/services/uds.c b/libctru/source/services/uds.c index 0c5e85a..6278905 100644 --- a/libctru/source/services/uds.c +++ b/libctru/source/services/uds.c @@ -863,7 +863,7 @@ Result udsPullPacket(const udsBindContext *bindcontext, void *buf, size_t size, return ret; } -Result udsSendTo(u16 dst_NetworkNodeID, u8 input8, u8 flags, const void *buf, size_t size) +Result udsSendTo(u16 dst_NetworkNodeID, u8 netflags, u8 flags, const void *buf, size_t size) { u32* cmdbuf=getThreadCommandBuffer(); @@ -872,7 +872,7 @@ Result udsSendTo(u16 dst_NetworkNodeID, u8 input8, u8 flags, const void *buf, si cmdbuf[0]=IPC_MakeHeader(0x17,6,2); // 0x170182 cmdbuf[1]=0x1;//Unused cmdbuf[2]=dst_NetworkNodeID; - cmdbuf[3]=input8; + cmdbuf[3]=netflags; cmdbuf[4]=aligned_size>>2; cmdbuf[5]=size; cmdbuf[6]=flags;