]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added udsGetNodeInformation().
authoryellows8 <yellows8@users.noreply.github.com>
Wed, 6 Apr 2016 16:24:43 +0000 (12:24 -0400)
committeryellows8 <yellows8@users.noreply.github.com>
Wed, 6 Apr 2016 16:24:43 +0000 (12:24 -0400)
libctru/include/3ds/services/uds.h
libctru/source/services/uds.c

index 7220ed677cae466450696721ae224ca2646153dc..8f0de88cea75272fd6a1495dadbb6da37ef2c403 100644 (file)
@@ -291,3 +291,10 @@ Result udsUpdateNetworkAttribute(u16 bitmask, bool flag);
  */
 Result udsSetNewConnectionsBlocked(bool block, bool clients, bool spectators);
 
+/**
+ * @brief This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.
+ * @param NetworkNodeID Target NetworkNodeID.
+ * @param output Output NodeInfo struct.
+ */
+Result udsGetNodeInformation(u16 NetworkNodeID, udsNodeInfo *output);
+
index 81c2aaab24dfc843fc0619194ba908fa809aa408..1f76fc6cf888cef13d98eb83a4097b897ce57211 100644 (file)
@@ -371,6 +371,25 @@ Result udsDisconnectNetwork(void)
        return cmdbuf[1];
 }
 
+Result udsGetNodeInformation(u16 NetworkNodeID, udsNodeInfo *output)
+{
+       u32* cmdbuf=getThreadCommandBuffer();
+
+       cmdbuf[0]=IPC_MakeHeader(0xD,1,0); // 0xD0040
+       cmdbuf[1]=NetworkNodeID;
+
+       Result ret=0;
+       if(R_FAILED(ret=svcSendSyncRequest(__uds_servhandle)))return ret;
+       ret = cmdbuf[1];
+
+       if(R_SUCCEEDED(ret))
+       {
+               if(output)memcpy(output, &cmdbuf[2], sizeof(udsNodeInfo));
+       }
+
+       return ret;
+}
+
 Result udsScanBeacons(u8 *outbuf, u32 maxsize, udsNetworkScanInfo **networks, u32 *total_networks, u32 wlancommID, u8 id8, u8 *host_macaddress)
 {
        Result ret=0;