MCPcopy Create free account
hub / github.com/devkitPro/libctru / nfcReadAppData

Function nfcReadAppData

libctru/source/services/nfc.c:362–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362Result nfcReadAppData(void *buf, size_t size)
363{
364 u32* cmdbuf=getThreadCommandBuffer();
365 u32 saved_threadstorage[2];
366
367 cmdbuf[0]=IPC_MakeHeader(0x15,1,0); // 0x150040
368 cmdbuf[1]=size;
369
370 u32 * staticbufs = getThreadStaticBuffers();
371 saved_threadstorage[0] = staticbufs[0];
372 saved_threadstorage[1] = staticbufs[1];
373
374 staticbufs[0] = IPC_Desc_StaticBuffer(size,0);
375 staticbufs[1] = (u32)buf;
376
377 Result ret=0;
378 ret=svcSendSyncRequest(nfcHandle);
379
380 staticbufs[0] = saved_threadstorage[0];
381 staticbufs[1] = saved_threadstorage[1];
382
383 if(R_FAILED(ret))return ret;
384
385 ret = cmdbuf[1];
386
387 return ret;
388}
389
390Result nfcWriteAppData(const void *buf, size_t size, NFC_TagInfo *taginfo)
391{

Callers

nothing calls this directly

Calls 4

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
getThreadStaticBuffersFunction · 0.85
IPC_Desc_StaticBufferFunction · 0.85

Tested by

no test coverage detected