]> Chaos Git - corbenik/ctrulib.git/commitdiff
Disabled the debug prints for network-connecting and implemented udsEjectClient().
authoryellows8 <yellows8@users.noreply.github.com>
Wed, 6 Apr 2016 04:48:08 +0000 (00:48 -0400)
committeryellows8 <yellows8@users.noreply.github.com>
Wed, 6 Apr 2016 04:48:08 +0000 (00:48 -0400)
libctru/include/3ds/services/uds.h
libctru/source/services/uds.c

index 7fcae7ede9db2750422b43db5e3d4213a8fb888b..0e16f7df05e9f8ca3fe693fd22b5d148b1073eac 100644 (file)
@@ -270,3 +270,9 @@ Result udsDestroyNetwork(void);
  */
 Result udsDisconnectNetwork(void);
 
+/**
+ * @brief This can be used by the host to force-disconnect client(s).
+ * @param NetworkNodeID Target NetworkNodeID. UDS_BROADCAST_NETWORKNODEID can be used to disconnect all clients.
+ */
+Result udsEjectClient(u16 NetworkNodeID);
+
index 1bfddc4763015246d8cdd67136fcc87f5383ad13..02c564c79ebd770b5286b282d6973d97eb854608 100644 (file)
@@ -262,10 +262,10 @@ Result udsCreateNetwork(udsNetworkStruct *network, void* passphrase, size_t pass
 Result udsConnectNetwork(udsNetworkStruct *network, void* passphrase, size_t passphrase_size, udsBindContext *context, u16 recv_NetworkNodeID, udsConnectionType connection_type)
 {
        Result ret=0;
-       printf("connecting...\n");//Removing these prints caused connecting to fail.
+       //printf("connecting...\n");//Removing these prints caused connecting to fail.
        ret = udsipc_ConnectToNetwork(network, passphrase, passphrase_size, connection_type);
        if(R_FAILED(ret))return ret;
-       printf("bind...\n");
+       //printf("bind...\n");
        ret = udsBind(context, recv_NetworkNodeID);
 
        if(R_FAILED(ret))udsDisconnectNetwork();
@@ -308,6 +308,19 @@ static Result udsipc_Shutdown(void)
        return cmdbuf[1];
 }
 
+Result udsEjectClient(u16 NetworkNodeID)
+{
+       u32* cmdbuf=getThreadCommandBuffer();
+
+       cmdbuf[0]=IPC_MakeHeader(0x5,1,0); // 0x50040
+       cmdbuf[1]=NetworkNodeID;
+
+       Result ret=0;
+       if(R_FAILED(ret=svcSendSyncRequest(__uds_servhandle)))return ret;
+
+       return cmdbuf[1];
+}
+
 Result udsDestroyNetwork(void)
 {
        u32* cmdbuf=getThreadCommandBuffer();