From ce08f34ed54b9e5af9a8d1d6cd780df7207c1dbb Mon Sep 17 00:00:00 2001 From: shinyquagsire23 Date: Sun, 10 Sep 2017 22:22:10 -0600 Subject: Finish with STWI_send_* --- src/librfu.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/librfu.c b/src/librfu.c index 5cbe9eb49..dfb2f7221 100644 --- a/src/librfu.c +++ b/src/librfu.c @@ -37,12 +37,18 @@ enum RFU_UNK2F, RFU_DISCONNECT, RFU_TEST_MODE, - RFU_UNK32, - RFU_UNK33, - RFU_UNK34, + RFU_CPR_START, + RFU_CPR_POLLING, + RFU_CPR_END, RFU_UNK35, RFU_UNK36, - RFU_RESUME_RETRANSMIT_AND_CHANGE + RFU_RESUME_RETRANSMIT_AND_CHANGE, + RFU_UNK38, + RFU_UNK39, + RFU_UNK3A, + RFU_UNK3B, + RFU_UNK3C, + RFU_STOP_MODE, //3D }; struct RfuPacket8 @@ -555,3 +561,48 @@ void STWI_send_TestModeREQ(u8 unk0, u8 unk1) STWI_start_Command(); } } + +void STWI_send_CPR_StartREQ(u16 unk0, u16 unk1, u8 unk2) +{ + u32 *packetData; + u32 arg1; + + if (!STWI_init(RFU_CPR_START)) + { + gRfuState->txParams = 2; + + arg1 = unk1 | (unk0 << 16); + packetData = gRfuState->txPacket->rfuPacket32.data; + packetData[0] = arg1; + packetData[1] = unk2; + + STWI_start_Command(); + } +} + +void STWI_send_CPR_PollingREQ() +{ + if (!STWI_init(RFU_CPR_POLLING)) + { + gRfuState->txParams = 0; + STWI_start_Command(); + } +} + +void STWI_send_CPR_EndREQ() +{ + if (!STWI_init(RFU_CPR_END)) + { + gRfuState->txParams = 0; + STWI_start_Command(); + } +} + +void STWI_send_StopModeREQ() +{ + if (!STWI_init(RFU_STOP_MODE)) + { + gRfuState->txParams = 0; + STWI_start_Command(); + } +} -- cgit v1.2.3