From 570c8346792d2873f4af331781a8228b833d2f03 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Thu, 7 Apr 2016 13:06:23 -0400 Subject: [PATCH] Updated udsConnectionStatus and networkstruct. Removed total_nodes from udsNetworkScanInfo since that's stored in the networkstruct. --- libctru/include/3ds/services/uds.h | 16 +++++++++++----- libctru/source/services/uds.c | 8 -------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/libctru/include/3ds/services/uds.h b/libctru/include/3ds/services/uds.h index 70a20cd..c5cac2f 100644 --- a/libctru/include/3ds/services/uds.h +++ b/libctru/include/3ds/services/uds.h @@ -30,10 +30,15 @@ typedef struct { /// Connection status struct. typedef struct { u32 status; - u32 unk_x4[0x28>>2]; - u8 val_x2c; + u32 unk_x4; + u16 cur_NetworkNodeID;//"u16 NetworkNodeID for this device." + u16 unk_xa; + u32 unk_xc[0x20>>2]; + + u8 total_nodes; u8 max_nodes; - u8 unk_x2e[2]; + u8 node_bitmask;//"This is a bitmask of NetworkNodeIDs: bit0 for NetworkNodeID 0x1(host), bit1 for NetworkNodeID 0x2(first original client), and so on." + u8 unk_x2f;//"Padding maybe? Normally 0. " } udsConnectionStatus; /// Network struct stored as big-endian. @@ -54,8 +59,10 @@ typedef struct { u8 unk_x15; u16 attributes;//See the UDSNETATTR enum values below. - u8 unk_x18[5]; + u32 networkID; + + u8 total_nodes; u8 max_nodes; u8 unk_x1e; u8 unk_x1f; @@ -111,7 +118,6 @@ typedef struct { typedef struct { nwmBeaconDataReplyEntry datareply_entry; udsNetworkStruct network; - u32 total_nodes;//Total number of nodes actually connected to the network, including the host. udsNodeInfo nodes[UDS_MAXNODES]; } udsNetworkScanInfo; diff --git a/libctru/source/services/uds.c b/libctru/source/services/uds.c index 95743ea..7190995 100644 --- a/libctru/source/services/uds.c +++ b/libctru/source/services/uds.c @@ -612,7 +612,6 @@ static Result usd_parsebeacon(u8 *buf, u32 size, udsNetworkScanInfo *networkscan u8 *tags_data[3] = {0}; u32 tags_sizes[3] = {0}; int tagindex; - u32 pos; u8 tmp_tagdata[0xfe*2]; @@ -708,13 +707,6 @@ static Result usd_parsebeacon(u8 *buf, u32 size, udsNetworkScanInfo *networkscan ret = udsipc_DecryptBeaconData(&networkscan->network, tmp_tagdata, &tmp_tagdata[0xfe], networkscan->nodes); if(R_FAILED(ret))return ret; - for(pos=0; posnodes[pos]))break; - - networkscan->total_nodes++; - } - return 0; }