wut  v1.5.0
Wii U Toolchain
cdc.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include <coreinit/ios.h>
4 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef struct CCRCDCMacAddress CCRCDCMacAddress;
17 typedef struct CCRCDCWpsArgs CCRCDCWpsArgs;
18 typedef struct CCRCDCSysMessage CCRCDCSysMessage;
19 typedef struct CCRCDCEepromData CCRCDCEepromData;
21 typedef struct CCRCDCUicConfig CCRCDCUicConfig;
22 typedef struct CCRCDCFWInfo CCRCDCFWInfo;
24 typedef struct CCRCDCDrhState CCRCDCDrhState;
25 typedef struct CCRCDCDrcState CCRCDCDrcState;
26 typedef uint8_t CCRCDCDestination;
27 typedef uint32_t CCRCDCWpsStatusType;
28 typedef uint8_t CCRCDCWakeState;
29 typedef uint8_t CCRCDCUicConfigId;
30 
32 {
37 
38 typedef enum CCRCDCWpsStatusEnum
39 {
44 
45 typedef enum CCRCDCDrcStateEnum
46 {
56 
57 typedef enum CCRCDCWakeStateEnum
58 {
64 
66 {
112 
113 typedef enum CCRCDCExt
114 {
123 
124 typedef enum CCRCDCDrhStateEnum
125 {
134 
135 struct WUT_PACKED CCRCDCMacAddress
136 {
139  uint8_t address[6];
140 };
141 WUT_CHECK_OFFSET(CCRCDCMacAddress, 0x0, device);
142 WUT_CHECK_OFFSET(CCRCDCMacAddress, 0x1, address);
143 WUT_CHECK_SIZE(CCRCDCMacAddress, 0x7);
144 
145 struct WUT_PACKED CCRCDCWpsArgs
146 {
148  uint8_t hasArgs;
150  char pin[8];
152  uint16_t timeout;
153  // \c CCR_CDC_DESTINATION_DRC0 or \c CCR_CDC_DESTINATION_DRC1 depending on where the device should be paired to
155 };
156 WUT_CHECK_OFFSET(CCRCDCWpsArgs, 0x0, hasArgs);
157 WUT_CHECK_OFFSET(CCRCDCWpsArgs, 0x1, pin);
158 WUT_CHECK_OFFSET(CCRCDCWpsArgs, 0x9, timeout);
159 WUT_CHECK_OFFSET(CCRCDCWpsArgs, 0xb, pairDestination);
160 WUT_CHECK_SIZE(CCRCDCWpsArgs, 0xc);
161 
162 struct WUT_PACKED CCRCDCSysMessage
163 {
164  uint16_t message;
166  uint16_t timeout;
167 };
168 WUT_CHECK_OFFSET(CCRCDCSysMessage, 0x0, message);
169 WUT_CHECK_OFFSET(CCRCDCSysMessage, 0x2, timeout);
170 WUT_CHECK_SIZE(CCRCDCSysMessage, 0x4);
171 
172 struct WUT_PACKED CCRCDCEepromData
173 {
174  uint32_t version;
175  WUT_UNKNOWN_BYTES(0x300);
176 };
177 WUT_CHECK_OFFSET(CCRCDCEepromData, 0x0, version);
178 WUT_CHECK_SIZE(CCRCDCEepromData, 0x304);
179 
180 struct WUT_PACKED CCRCDCWowlWakeDrcArg
181 {
182  WUT_PADDING_BYTES(0x6);
185 };
186 WUT_CHECK_OFFSET(CCRCDCWowlWakeDrcArg, 0x6, state);
187 WUT_CHECK_SIZE(CCRCDCWowlWakeDrcArg, 0x7);
188 
190 {
194  uint8_t size;
196  uint8_t data[0x100];
197 };
198 WUT_CHECK_SIZE(CCRCDCUicConfig, 0x102);
199 WUT_CHECK_OFFSET(CCRCDCUicConfig, 0x00, configId);
200 WUT_CHECK_OFFSET(CCRCDCUicConfig, 0x01, size);
201 WUT_CHECK_OFFSET(CCRCDCUicConfig, 0x02, data);
202 
204 {
205  uint32_t imageSize;
206  uint32_t blockSize;
207  uint32_t imageVersion;
210  uint32_t updateProgress;
211 };
212 WUT_CHECK_OFFSET(CCRCDCFWInfo, 0x00, imageSize);
213 WUT_CHECK_OFFSET(CCRCDCFWInfo, 0x04, blockSize);
214 WUT_CHECK_OFFSET(CCRCDCFWInfo, 0x08, imageVersion);
215 WUT_CHECK_OFFSET(CCRCDCFWInfo, 0x0C, sequencePerSession);
216 WUT_CHECK_OFFSET(CCRCDCFWInfo, 0x10, updateProgress);
217 WUT_CHECK_SIZE(CCRCDCFWInfo, 0x14);
218 
220 {
221  uint32_t runningVersion;
222  uint32_t activeVersion;
223 };
224 WUT_CHECK_OFFSET(CCRCDCSoftwareVersion, 0x0, runningVersion);
225 WUT_CHECK_OFFSET(CCRCDCSoftwareVersion, 0x4, activeVersion);
226 WUT_CHECK_SIZE(CCRCDCSoftwareVersion, 0x8);
227 
230  uint8_t state;
231 };
232 WUT_CHECK_OFFSET(CCRCDCDrcState, 0x0, state);
233 WUT_CHECK_SIZE(CCRCDCDrcState, 0x1);
234 
237  uint8_t state;
238 };
239 WUT_CHECK_OFFSET(CCRCDCDrhState, 0x0, state);
240 WUT_CHECK_SIZE(CCRCDCDrhState, 0x1);
241 
252 int32_t
253 CCRCDCCommand(uint8_t unk,
254  uint8_t fragment,
255  CCRCDCDestination dest,
256  uint8_t flags0,
257  uint8_t flags1,
258  uint8_t service,
259  uint8_t method,
260  void *payload,
261  uint32_t payloadSize,
262  void *reply,
263  uint32_t replySize);
264 
275 int32_t
277 
278 int32_t
280 
294 int32_t
296  CCRCDCMacAddress *mac);
297 
307 int32_t
308 CCRCDCGetMultiDrc(uint8_t *numDrcs);
309 
319 int32_t
320 CCRCDCSetMultiDrc(uint8_t numDrcs);
321 
335 int32_t
337  CCRCDCDrcState *state);
338 
352 int32_t
354  CCRCDCDrcState *state);
355 
362 int32_t
370 int32_t
372 
379 int32_t
381 
391 int32_t
393 
404 int32_t
406 
413 int32_t
415 
429 int32_t
431  CCRCDCSysMessage *message);
432 
446 int32_t
448  CCRCDCEepromData *eeprom);
449 
463 int32_t
465  CCRCDCEepromData *eeprom,
466  IOSAsyncCallbackFn callback,
467  void* arg);
468 
480 int32_t
482 
490 int32_t
492 
503 int32_t
505 
518 int32_t
520  CCRCDCUicConfig *config);
521 
534 uint16_t
535 CCRCDCCalcCRC16(void *data,
536  uint32_t dataSize);
537 
550 int32_t
552  CCRCDCFWInfo *outInfo);
553 
566 int32_t
568  CCRCDCSoftwareVersion *outVersion);
569 
589 int32_t
591  const char *path,
592  IOSAsyncCallbackFn callback,
593  void *userContext);
594 
604 int32_t
606 
616 int32_t
618 
634 int32_t
636  CCRCDCExt ext,
637  uint32_t *outId);
638 
639 #ifdef __cplusplus
640 }
641 #endif
642 
void(* IOSAsyncCallbackFn)(IOSError, void *)
Definition: ios.h:87
uint8_t state
Must be one of CCRCDCDrcStateEnum.
Definition: cdc.h:230
uint32_t sequencePerSession
Definition: cdc.h:208
uint8_t data[0x100]
Configuration data.
Definition: cdc.h:196
uint16_t message
Definition: cdc.h:164
uint16_t timeout
Timeout in seconds.
Definition: cdc.h:152
uint8_t hasArgs
Should be set to 1.
Definition: cdc.h:148
uint32_t imageSize
Definition: cdc.h:205
uint32_t blockSize
Definition: cdc.h:206
CCRCDCDestination device
The device this mac address belongs to.
Definition: cdc.h:138
uint32_t imageVersion
Definition: cdc.h:207
uint32_t version
Definition: cdc.h:174
CCRCDCUicConfigId configId
Configuration ID (see CCRCDCUicConfigIdEnum)
Definition: cdc.h:192
uint32_t activeVersion
Definition: cdc.h:222
CCRCDCWakeState state
Must be one of CCRCDCWakeStateEnum.
Definition: cdc.h:182
uint8_t size
Size of the configuration data (must match the size described in CCRCDCUicConfigIdEnum)
Definition: cdc.h:194
uint32_t runningVersion
Definition: cdc.h:221
uint32_t updateProgress
Progress from 0-100.
Definition: cdc.h:210
CCRCDCDestination pairDestination
Definition: cdc.h:154
int32_t CCRCDCDevicePing(CCRCDCDestination dest)
Send a ping to the specified destination.
CCRCDCDestinationEnum
Definition: cdc.h:32
int32_t CCRCDCPerClearUicConfig(CCRCDCDestination dest)
This doesn't seem to be implemented on the latest DRC/DRH firmware, and always returns an error.
int32_t CCRCDCSoftwareGetExtId(CCRCDCDestination dest, CCRCDCExt ext, uint32_t *outId)
Get an ext id from the specified destination.
int32_t CCRCDCWpsStatus(CCRCDCWpsStatusType *status)
Get the WPS status.
int32_t CCRCDCSetStationId(CCRCDCMacAddress *id)
int32_t CCRCDCSoftwareAbort(CCRCDCDestination dest)
Abort a software update.
int32_t CCRCDCGetMacAddress(CCRCDCDestination dest, CCRCDCMacAddress *mac)
Gets the mac address of the specified destination.
uint8_t CCRCDCDestination
Definition: cdc.h:26
int32_t CCRCDCSysGetDrhState(CCRCDCDrhState *state)
Gets the Drh State.
int32_t CCRCDCSysGetDrcState(CCRCDCDestination dest, CCRCDCDrcState *state)
Gets the state of the specified DRC.
CCRCDCWakeStateEnum
Definition: cdc.h:58
int32_t CCRCDCWowlWakeDrc(CCRCDCWowlWakeDrcArg *arg)
Wake on Wireless LAN (power on) the DRC(s).
int32_t CCRCDCSoftwareUpdate(CCRCDCDestination dest, const char *path, IOSAsyncCallbackFn callback, void *userContext)
Perform a software update.
int32_t CCRCDCPerGetUicEepromEx(CCRCDCDestination dest, CCRCDCEepromData *eeprom, IOSAsyncCallbackFn callback, void *arg)
Read the Eeprom of the specified device (async version).
int32_t CCRCDCCommand(uint8_t unk, uint8_t fragment, CCRCDCDestination dest, uint8_t flags0, uint8_t flags1, uint8_t service, uint8_t method, void *payload, uint32_t payloadSize, void *reply, uint32_t replySize)
Send a command directly to the specified destination.
int32_t CCRCDCGetFWInfo(CCRCDCDestination dest, CCRCDCFWInfo *outInfo)
Get the firmware info during a pending update.
CCRCDCDrcStateEnum
Definition: cdc.h:46
int32_t CCRCDCGetMultiDrc(uint8_t *numDrcs)
Gets the amount of DRCs which can be connected to the system.
int32_t CCRCDCSetMultiDrc(uint8_t numDrcs)
Sets the amount of DRCs which can be connected to the system.
CCRCDCWpsStatusEnum
Definition: cdc.h:39
uint8_t CCRCDCWakeState
Definition: cdc.h:28
int32_t CCRCDCWpsStart(void)
Start WPS (WiFi Protected Setup) on the DRH.
uint32_t CCRCDCWpsStatusType
Definition: cdc.h:27
int32_t CCRCDCSoftwareGetVersion(CCRCDCDestination dest, CCRCDCSoftwareVersion *outVersion)
Get software version information.
CCRCDCDrhStateEnum
Definition: cdc.h:125
int32_t CCRCDCPerGetUicEeprom(CCRCDCDestination dest, CCRCDCEepromData *eeprom)
Read the Eeprom of the specified device.
uint8_t CCRCDCUicConfigId
Definition: cdc.h:29
int32_t CCRCDCSoftwareActivate(CCRCDCDestination dest)
Activate a performed software update.
int32_t CCRCDCWpsStop(void)
Stop WPS.
int32_t CCRCDCSysDrcDisplayMessage(CCRCDCDestination dest, CCRCDCSysMessage *message)
Display a message on the specified DRC.
int32_t CCRCDCSysSetDrcState(CCRCDCDestination dest, CCRCDCDrcState *state)
Sets the state of the specified DRC.
CCRCDCExt
Definition: cdc.h:114
uint16_t CCRCDCCalcCRC16(void *data, uint32_t dataSize)
Calculate a CRC16 used for DRC UIC EEPROM values.
int32_t CCRCDCSysSetDrhState(CCRCDCDrhState *state)
Sets the Drh State.
int32_t CCRCDCPerSetUicConfig(CCRCDCDestination dest, CCRCDCUicConfig *config)
Set a configuration value in the DRC UIC EEPROM.
int32_t CCRCDCWpsStartEx(CCRCDCWpsArgs *args)
Start WPS (WiFi Protected Setup) on the DRH.
int32_t CCRCDCSysConsoleShutdownInd(CCRCDCDestination dest)
Notify the specified device that the console is about to shut down, and the device should shut down a...
CCRCDCUicConfigIdEnum
Definition: cdc.h:66
@ CCR_CDC_DESTINATION_DRC0
Definition: cdc.h:34
@ CCR_CDC_DESTINATION_DRH
Definition: cdc.h:33
@ CCR_CDC_DESTINATION_DRC1
Definition: cdc.h:35
@ CCR_CDC_WAKE_STATE_BACKGROUND
Connect in CCR_CDC_DRC_STATE_BACKGROUND state.
Definition: cdc.h:62
@ CCR_CDC_WAKE_STATE_ACTIVE
Power on normally.
Definition: cdc.h:60
@ CCR_CDC_DRC_STATE_BACKGROUND
Definition: cdc.h:51
@ CCR_CDC_DRC_STATE_UNK12
Definition: cdc.h:53
@ CCR_CDC_DRC_STATE_UPDATE
Definition: cdc.h:49
@ CCR_CDC_DRC_STATE_UNK1
Definition: cdc.h:48
@ CCR_CDC_DRC_STATE_UNK15
Definition: cdc.h:54
@ CCR_CDC_DRC_STATE_DISCONNECT
Definition: cdc.h:52
@ CCR_CDC_DRC_STATE_UNK3
Definition: cdc.h:50
@ CCR_CDC_DRC_STATE_ACTIVE
Definition: cdc.h:47
@ CCR_CDC_WPS_STATUS_SEARCHING
Definition: cdc.h:41
@ CCR_CDC_WPS_STATUS_PAIRED
Definition: cdc.h:40
@ CCR_CDC_WPS_STATUS_PAIRING
Definition: cdc.h:42
@ CCR_CDC_SYS_DRH_STATE_UNK1
Definition: cdc.h:127
@ CCR_CDC_SYS_DRH_STATE_ECO
Definition: cdc.h:130
@ CCR_CDC_SYS_DRH_STATE_UNK2
Definition: cdc.h:128
@ CCR_CDC_SYS_DRH_STATE_CAFE
Definition: cdc.h:132
@ CCR_CDC_SYS_DRH_STATE_UNK7F
Definition: cdc.h:131
@ CCR_CDC_SYS_DRH_STATE_UNK0
Definition: cdc.h:126
@ CCR_CDC_SYS_DRH_STATE_UNK3
Definition: cdc.h:129
@ CCR_CDC_EXT_LANGUAGE
Language data.
Definition: cdc.h:116
@ CCR_CDC_EXT_UNK4
Definition: cdc.h:121
@ CCR_CDC_EXT_UNK3
Definition: cdc.h:120
@ CCR_CDC_EXT_UNK2
Definition: cdc.h:119
@ CCR_CDC_EXT_RC_DATABASE
Remote Control Database.
Definition: cdc.h:118
@ CCR_CDC_UIC_CONFIG_ID_UNK18
EEPROM offset 0x295, Size 0x3.
Definition: cdc.h:98
@ CCR_CDC_UIC_CONFIG_ID_UNK0
EEPROM offset 0x200, Size 0x3.
Definition: cdc.h:68
@ CCR_CDC_UIC_CONFIG_ID_UNK12
EEPROM offset 0x268, Size 0x6.
Definition: cdc.h:86
@ CCR_CDC_UIC_CONFIG_ID_UNK9
EEPROM offset 0x256, Size 0x6.
Definition: cdc.h:80
@ CCR_CDC_UIC_CONFIG_ID_UNK23
EEPROM offset 0x2A4, Size 0x3.
Definition: cdc.h:108
@ CCR_CDC_UIC_CONFIG_ID_UNK14
EEPROM offset 0x274, Size 0x3.
Definition: cdc.h:90
@ CCR_CDC_UIC_CONFIG_ID_UNK7
EEPROM offset 0x203, Size 0x3.
Definition: cdc.h:76
@ CCR_CDC_UIC_CONFIG_ID_UNK19
EEPROM offset 0x298, Size 0x3.
Definition: cdc.h:100
@ CCR_CDC_UIC_CONFIG_ID_UNK8
EEPROM offset 0x206, Size 0x3.
Definition: cdc.h:78
@ CCR_CDC_UIC_CONFIG_ID_UNK3
EEPROM offset 0x213, Size 0xE.
Definition: cdc.h:72
@ CCR_CDC_UIC_CONFIG_ID_UNK21
EEPROM offset 0x29E, Size 0x3.
Definition: cdc.h:104
@ CCR_CDC_UIC_CONFIG_ID_UNK22
EEPROM offset 0x2A1, Size 0x3.
Definition: cdc.h:106
@ CCR_CDC_UIC_CONFIG_ID_UNK20
EEPROM offset 0x29B, Size 0x3.
Definition: cdc.h:102
@ CCR_CDC_UIC_CONFIG_ID_UNK17
EEPROM offset 0x25C, Size 0x6.
Definition: cdc.h:96
@ CCR_CDC_UIC_CONFIG_ID_UNK10
EEPROM offset 0x289, Size 0xC.
Definition: cdc.h:82
@ CCR_CDC_UIC_CONFIG_ID_UNK16
EEPROM offset 0x286, Size 0x3.
Definition: cdc.h:94
@ CCR_CDC_UIC_CONFIG_ID_UNK5
EEPROM offset 0x244, Size 0x12.
Definition: cdc.h:74
@ CCR_CDC_UIC_CONFIG_ID_UNK24
EEPROM offset 0x2A7, Size 0x4.
Definition: cdc.h:110
@ CCR_CDC_UIC_CONFIG_ID_UNK15
EEPROM offset 0x277, Size 0xF.
Definition: cdc.h:92
@ CCR_CDC_UIC_CONFIG_ID_UNK11
EEPROM offset 0x262, Size 0x6.
Definition: cdc.h:84
@ CCR_CDC_UIC_CONFIG_ID_UNK2
EEPROM offset 0x20D, Size 0x6.
Definition: cdc.h:70
@ CCR_CDC_UIC_CONFIG_ID_UNK13
EEPROM offset 0x26E, Size 0x6.
Definition: cdc.h:88