3DSident/services/am.c
Joel16 cf84991672 Merge GUI and Console in one branch
- Cleaned up a bunch of functions
- Now builds with the latest toolchain.
- GUI uses Citro2D.
2018-07-31 13:59:17 -05:00

30 lines
539 B
C

#include "am.h"
static Handle amHandle;
Result amGetServiceHandle(void)
{
return srvGetServiceHandle(&amHandle, "am:net");
}
Result amCloseServiceHandle(void)
{
return svcCloseHandle(amHandle);
}
Result amNetGetDeviceCert(u8 const * buffer)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x818, 1, 2); // 0x08180042
cmdbuf[1] = 0x180;
cmdbuf[2] = (0x180 << 4) | 0xC;
cmdbuf[3] = (u32)buffer;
if(R_FAILED(ret = svcSendSyncRequest(amHandle)))
return ret;
return (Result)cmdbuf[1];
}