2016-10-16 20:00:34 +00:00
|
|
|
#include "am.h"
|
2016-11-28 07:45:57 +00:00
|
|
|
|
2017-07-05 20:22:25 +00:00
|
|
|
static Handle amHandle;
|
2016-10-16 20:00:34 +00:00
|
|
|
|
2017-09-15 16:16:13 +00:00
|
|
|
Result amGetServiceHandle(void)
|
|
|
|
{
|
|
|
|
return srvGetServiceHandle(&amHandle, "am:net");
|
|
|
|
}
|
|
|
|
|
|
|
|
Result amCloseServiceHandle(void)
|
|
|
|
{
|
|
|
|
return svcCloseHandle(amHandle);
|
|
|
|
}
|
|
|
|
|
2016-11-28 07:45:57 +00:00
|
|
|
Result amNetGetDeviceCert(u8 const * buffer)
|
2016-10-16 20:00:34 +00:00
|
|
|
{
|
|
|
|
Result ret = 0;
|
|
|
|
u32 *cmdbuf = getThreadCommandBuffer();
|
|
|
|
|
2017-07-12 06:02:17 +00:00
|
|
|
cmdbuf[0] = IPC_MakeHeader(0x818, 1, 2); // 0x08180042
|
2016-10-16 20:00:34 +00:00
|
|
|
cmdbuf[1] = 0x180;
|
|
|
|
cmdbuf[2] = (0x180 << 4) | 0xC;
|
|
|
|
cmdbuf[3] = (u32)buffer;
|
|
|
|
|
2017-07-05 20:22:25 +00:00
|
|
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle)))
|
|
|
|
return ret;
|
2016-10-16 20:00:34 +00:00
|
|
|
|
|
|
|
return (Result)cmdbuf[1];
|
|
|
|
}
|