Disabled the debug prints for network-connecting and implemented udsEjectClient().

This commit is contained in:
yellows8 2016-04-06 00:48:08 -04:00
parent 4393593e48
commit 6570ade097
2 changed files with 21 additions and 2 deletions

View 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);

View 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();