Added code for getting the session handles for am, fs, and srv. Updated ACU_WaitInternetConnection() so that it waits for outval!=0 instead of outval==1, this fixes new3ds support for this func.

This commit is contained in:
yellows8 2015-05-26 13:49:37 -04:00
parent 79e2efdc0c
commit f631036063
7 changed files with 23 additions and 1 deletions

View File

@ -16,6 +16,7 @@ typedef struct
Result amInit(); Result amInit();
Result amExit(); Result amExit();
Handle *amGetSessionHandle();
/* AM_GetTitleCount() /* AM_GetTitleCount()
About: Gets the number of titles for a given mediatype About: Gets the number of titles for a given mediatype

View File

@ -129,6 +129,7 @@ typedef struct
Result fsInit(void); Result fsInit(void);
Result fsExit(void); Result fsExit(void);
Handle *fsGetSessionHandle();
FS_path FS_makePath(FS_pathType type, const char *path); FS_path FS_makePath(FS_pathType type, const char *path);

View File

@ -2,6 +2,7 @@
Result srvInit(); Result srvInit();
Result srvExit(); Result srvExit();
Handle *srvGetSessionHandle();
Result srvRegisterClient(); Result srvRegisterClient();
Result srvGetServiceHandle(Handle* out, const char* name); Result srvGetServiceHandle(Handle* out, const char* name);
Result srvRegisterService(Handle* out, const char* name, int maxSessions); Result srvRegisterService(Handle* out, const char* name, int maxSessions);

View File

@ -91,7 +91,7 @@ Result ACU_WaitInternetConnection()
while(1) while(1)
{ {
ret = ACU_GetWifiStatus(&servhandle, &outval); ret = ACU_GetWifiStatus(&servhandle, &outval);
if(ret==0 && outval==1)break; if(ret==0 && outval!=0)break;
} }
svcCloseHandle(servhandle); svcCloseHandle(servhandle);

View File

@ -21,6 +21,11 @@ Result amExit()
return svcCloseHandle(amHandle); return svcCloseHandle(amHandle);
} }
Handle *amGetSessionHandle()
{
return &amHandle;
}
Result AM_GetTitleCount(u8 mediatype, u32 *count) Result AM_GetTitleCount(u8 mediatype, u32 *count)
{ {
Result ret = 0; Result ret = 0;

View File

@ -69,6 +69,15 @@ fsExit(void)
return svcCloseHandle(fsuHandle); return svcCloseHandle(fsuHandle);
} }
/*! Gets the fsuser service session handle.
*
* @returns Handle
*/
Handle *fsGetSessionHandle()
{
return &fsuHandle;
}
/*! Initialize FS service handle /*! Initialize FS service handle
* *
* If @a handle is NULL, this initializes @ref fsuHandle. * If @a handle is NULL, this initializes @ref fsuHandle.

View File

@ -97,6 +97,11 @@ Result srvExit()
return 0; return 0;
} }
Handle *srvGetSessionHandle()
{
return &g_srv_handle;
}
Result srvRegisterClient() Result srvRegisterClient()
{ {
Result rc = 0; Result rc = 0;