libctru v2.5.0
Loading...
Searching...
No Matches
frd.h
Go to the documentation of this file.
1/**
2 * @file frd.h
3 * @brief Friend Services
4 */
5#pragma once
6#include <3ds/mii.h>
7
8#define FRIEND_COMMENT_LEN 16+1 ///< 16-character NULL-terminated UTF-16 comment
9#define FRIEND_GAME_MODE_DESCRIPTION_LEN 127+1 ///< 127-character NULL-terminated UTF-16 game mode description
10
11#define NASC_INGAMESN_LEN 11+1 ///< 11-character NULL-terminated UTF-16 in-game nickname
12#define NASC_KEYHASH_LEN 8+1 ///< 8-character NULL-terminated ASCII NASC `keyhash` value
13#define NASC_SVC_LEN 4+1 ///< 4-character NULL-terminated ASCII NASC `svc` value
14
15#define FRIEND_LIST_SIZE 100 ///< 100 (maximum number of friends)
16
17#define NFS_TYPESTR_LEN 2+1 ///< 2-character NULL-terminated ASCII NFS (Nintendo Friend Server) type string
18
19typedef u16 FriendComment[FRIEND_COMMENT_LEN];
20typedef u16 FriendGameModeDescription[FRIEND_GAME_MODE_DESCRIPTION_LEN];
21
22typedef u16 ScrambledFriendCode[6];
23
24typedef char NfsTypeStr[NFS_TYPESTR_LEN];
25
26#pragma pack(push, 1)
27
28/// Friend key data
29typedef struct
30{
31 u32 principalId;
32 u32 padding;
33 u64 localFriendCode;
34} FriendKey;
35
36/// Game key data
37typedef struct
38{
39 u64 titleId;
40 u16 version;
41 u8 reserved[6];
42} GameKey;
43
44/// Base profile data
45typedef struct
46{
47 u8 region; ///< The region code for the hardware.
48 u8 country; ///< Country code.
49 u8 area; ///< Area code.
50 u8 language; ///< Language code.
51 u8 platform; ///< Platform code.
52 u8 padding[3];
53} Profile;
54
55/// Friend profile data
56typedef struct
57{
58 Profile profile; ///< Base profile data of this friend.
59 GameKey favoriteGame; ///< Favorite game of this friend.
60 u32 ncPrincipalId; ///< NC PrincipalID of this friend.
61 FriendComment personalMessage; ///< Personal message (comment) of this friend.
62 u8 pad[2];
63 s64 lastOnlineTimestamp; ///< NEX timestamp of when this friend was last seen online.
65
66/// Base presence data
67typedef struct
68{
69 u32 joinAvailabilityFlag;
70 u32 matchmakeSystemType;
71 u32 joinGameId;
72 u32 joinGameMode;
73 u32 ownerPrincipalId;
74 u32 joinGroupId;
75 u8 applicationArg[20];
76} Presence;
77
78/// Current user's presence data
79typedef struct
80{
81 Presence presence; ///< The actual presence data.
82 FriendGameModeDescription gameModeDescription; ///< The game mode description of the current user.
84
85/// Friend presence data
86typedef struct
87{
88 Presence presence; ///< The actual presence data.
89 bool isPresenceLoaded; ///< Whether or not the presence data for this user has been loaded from the server.
90 bool hasSentInvitation; ///< Whether or not this friend has sent the current user an invitation.
91 bool found; ///< Whether or not this friend was found.
92 u8 pad;
94
95/// Friend Mii data
96typedef struct
97{
98 bool profanityFlag; ///< Whether or not the Mii contains profanity.
99 u8 characterSet; ///< The character set for text data.
100 bool dirtyFlag; ///< Whether or not the Mii is marked as "dirty" (needs to be uploaded to the server).
101 u8 pad;
102 MiiData mii; ///< The actual Mii data.
103} FriendMii;
104
105/// Friend playing game structure
106typedef struct
107{
108 GameKey game; ///< Game key of the game.
109 FriendGameModeDescription gameModeDescription;
111
112/// Friend info structure
113typedef struct
114{
115 FriendKey friendKey; ///< FriendKey of this friend.
116 s64 addedTimestamp; ///< NEX timestamp of when this friend was added to the current user's friend list.
117 u8 relationship; ///< The type of the relationship with this friend.
118 u8 pad[7];
119 FriendProfile friendProfile; ///< Friend profile data of this friend.
120 MiiScreenName screenName; ///< The screen name of this friend.
121 u8 characterSet; ///< The character set used for the text parts of the data of this friend.
122 u8 pad2;
123 FriendMii mii; ///< The Mii of this friend.
124} FriendInfo;
125
126/// Friend Notification Event structure
127typedef struct
128{
129 u8 type; ///< Type of event.
130 u8 padding[7];
131 FriendKey sender; ///< Friend key of friend who caused this notification event to be sent.
133
134/// Game Authentication Data structure
135typedef struct
136{
137 u32 nascResult; ///< NASC result code for the LOGIN operation.
138 u32 httpStatusCode; ///< HTTP status code for the NASC LOGIN operation.
139 char serverAddress[0x20]; ///< Address of the game server.
140 u16 serverPort; ///< Port of the game server.
141 u8 pad[6];
142 char authToken[0x100]; ///< Game server authentication token.
143 u64 serverTime; ///< NEX timestamp for current server time.
145
146/// Service Locator Data strcture
147typedef struct
148{
149 u32 nascResult; ///< NASC result code for the SVCLOC operation.
150 u32 httpStatusCode; ///< HTTP status code for the NASC LOGIN operation.
151 char serviceHost[0x80]; ///< Host address of the target service.
152 char serviceToken[0x100]; ///< Token for the target service.
153 u8 statusData; ///< `statusdata` value from the NASC response data.
154 u8 padding[7];
155 u64 serverTime; ///< NEX timestamp for current server time.
157
158/// Encrypted inner Approach Context structure
159typedef struct
160{
161 FriendProfile friendProfile;
162 bool hasMii;
163 bool profanityFlag;
164 u8 characterSet;
165 u8 wrappedMii[0x70];
166 MiiScreenName screenName;
167 u8 reserved[0x10F];
169
170/// Encrypted Approach Context structure
171typedef struct
172{
173 u8 unknown0;
174 u8 unknown1;
175 u8 unknown2;
176 u8 unknown3;
177 struct {
178 u32 principalId;
179 u64 friendCode;
180 } CTR_PACKED nonce;
181 ApproachContext encryptedPayload;
182 u8 ccmMac[16];
184
185/// Decrypted Approach Context structure
186typedef struct
187{
188 u8 unknown0;
189 u8 unknown1;
190 u8 unknown2;
191 u8 unknown3;
192 bool hasMii; ///< Whether or not this friend has a Mii.
193 bool profanityFlag;
194 u8 characterSet; ///< Character set for text data.
195 u8 pad;
196 FriendKey friendKey; ///< Friend key of this friend.
197 FriendProfile friendProfile; ///< Friend profile of this friend.
198 FriendMii mii; ///< Mii data of this friend.
199 MiiScreenName screenName; ///< UTF-16 screen name of this friend.
200 u8 reserved[0x12A];
202
203#pragma pack(pop)
204
205/// Enum for character set
206typedef enum
207{
208 CHARSET_JPN_USA_EUR = 0, ///< Character set for JPN, USA, and EUR(+AUS).
209 CHARSET_CHN, ///< Character set for CHN.
210 CHARSET_KOR, ///< Character set for KOR.
211 CHARSET_TWN, ///< Character set for TWN.
213
214/// Enum for NASC Result
215typedef enum
216{
217 NASC_SUCCESS = 001,
218 NASC_SERVER_UNDER_MAINTENANCE = 101,
219 NASC_DEVICE_BANNED = 102,
220 NASC_INVALID_PRODUCT_CODE = 107,
221 NASC_INVALID_REQUEST_PARAM = 109,
222 NASC_SERVER_NO_LONGER_AVAILABLE = 110,
223 NASC_INVALID_SVC = 112,
224 NASC_INVALID_FPD_VERSION = 119,
225 NASC_INVALID_TITLE_VERSION = 120,
226 NASC_INVALID_DEVICE_CERTIFICATE = 121,
227 NASC_INVALID_PID_HMAC = 122,
228 NASC_BANNED_ROM_ID = 123,
229 NASC_INVALID_GAME_ID = 125,
230 NASC_INVALID_KEY_HASH = 127,
231} NASCResult;
232
233/// Enum for NASC Server Environment
234typedef enum
235{
236 NASC_PRODUCTION = 0,
237 NASC_TESTING,
238 NASC_DEVELOPMENT
240
241/// Enum for notification event types
242typedef enum
243{
244 USER_WENT_ONLINE = 1, ///< Self went online
245 USER_WENT_OFFLINE, ///< Self went offline
246 FRIEND_WENT_ONLINE, ///< Friend Went Online
247 FRIEND_UPDATED_PRESENCE, ///< Friend Presence changed (with matching GameJoinID)
248 FRIEND_UPDATED_MII, ///< Friend Mii changed
249 FRIEND_UPDATED_PROFILE, ///< Friend Profile changed
250 FRIEND_WENT_OFFLINE, ///< Friend went offline
251 FRIEND_REGISTERED_USER, ///< Friend registered self as friend
252 FRIEND_SENT_JOINABLE_INVITATION, ///< Friend sent invitation (with matching GameJoinID)
253 FRIEND_CHANGED_GAME_MODE_DESCRIPTION = 145, ///< Friend changed game mode description
254 FRIEND_CHANGED_FAVORITE_GAME = 146, ///< Friend changed favorite game
255 FRIEND_CHANGED_COMMENT = 147, ///< Friend changed comment
256 FRIEND_CHANGED_ANY_PRESENCE = 148, ///< Friend Presence changed (with nonmatching GameJoinID)
257 FRIEND_SENT_ANY_INVITATION = 149, ///< Friend sent invitiation (with nonmatching GameJoinID)
259
260/// Enum for notification event mask
261typedef enum
262{
263 MASK_USER_WENT_ONLINE = BIT(USER_WENT_ONLINE - 1),
264 MASK_USER_WENT_OFFLINE = BIT(USER_WENT_OFFLINE - 1),
265 MASK_FRIEND_WENT_ONLINE = BIT(FRIEND_WENT_ONLINE - 1),
266 MASK_FRIEND_UPDATED_PRESENCE = BIT(FRIEND_UPDATED_PRESENCE - 1),
267 MASK_FRIEND_UPDATED_MII = BIT(FRIEND_UPDATED_MII - 1),
268 MASK_FRIEND_UPDATED_PROFILE = BIT(FRIEND_UPDATED_PROFILE - 1),
269 MASK_FRIEND_WENT_OFFLINE = BIT(FRIEND_WENT_OFFLINE - 1),
270 MASK_FRIEND_REGISTERED_USER = BIT(FRIEND_REGISTERED_USER - 1),
271 MASK_FRIEND_SENT_JOINABLE_INVITATION = BIT(FRIEND_SENT_JOINABLE_INVITATION - 1),
272 // values >= 145 are not exposed to sessions.
274
275/// Enum for friend relationship type
276typedef enum
277{
278 RELATIONSHIP_INCOMPLETE = 0, ///< Provisionally registered friend.
279 RELATIONSHIP_COMPLETE, ///< Fully registered friend.
280 RELATIONSHIP_NOT_FOUND, ///< Friend not registered at all.
281 RELATIONSHIP_DELETED, ///< Relationship was deleted.
282 RELATIONSHIP_LOCAL, ///< Provisionally registered friend (but this relationship has not been sent to the server yet).
284
285/// Enum for friend attributes according to relationship type
286typedef enum
287{
288 FRIEND_ATTRIBUTE_EVER_REGISTERED = BIT(0), ///< Whether or not the current user has ever been in a friend relationship with the friend. This is set when the relationship type is either incomplete, complete, local, or deleted.
289 FRIEND_ATTRIBUTE_REGISTRATION_COMPLETE = BIT(1) ///< Whether or not the current user has been fully registered by this friend. Set only when the relationship type is complete.
291
292/// Enum for NAT mapping type
293typedef enum
294{
295 NAT_MAPPING_UNKNOWN = 0,
296 NAT_MAPPING_ENDPOINT_INDEPENDENT,
297 NAT_MAPPING_ENDPOINT_DEPENDENT
299
300/// Enum for NAT filtering type
301typedef enum
302{
303 NAT_FILTERING_UNKNOWN = 0,
304 NAT_FILTERING_PORT_INDEPENDENT,
305 NAT_FILTERING_PORT_DEPENDENT
307
308/**
309 * @brief Initializes friend services.
310 * @param forceUser Whether or not to force using the user service frd:u instead of the default (admin service frd:a).
311 */
312Result frdInit(bool forceUser);
313
314/// Exits friend services.
315void frdExit(void);
316
317/// Get the friend user/admin service handle.
319
320/**
321 * @brief Gets the login status of the current user.
322 * @param state Pointer to write the current user's login status to.
323 */
325
326/**
327 * @brief Gets the online status of the current user.
328 * @param state Pointer to write the current user's online status to.
329 */
330Result FRD_IsOnline(bool *state);
331
332/**
333 * @brief Log in to Nintendo's friend server.
334 * @param event Event to signal when Login is done.
335 */
337
338/// Logs out of Nintendo's friend server.
340
341/**
342 * @brief Gets the current user's friend key.
343 * @param key Pointer to write the current user's friend key to.
344 */
346
347/**
348 * @brief Gets the current user's privacy information.
349 * @param isPublicMode Determines whether friends are notified of the current user's online status.
350 * @param isShowGameName Determines whether friends are notified of the application that the current user is running.
351 * @param isShowPlayedGame Determiens whether to display the current user's game history.
352 */
353Result FRD_GetMyPreference(bool *isPublicMode, bool *isShowGameName, bool *isShowPlayedGame);
354
355/**
356 * @brief Gets the current user's profile information.
357 * @param profile Pointer to write the current user's profile information to.
358 */
360
361/**
362 * @brief Gets the current user's presence information.
363 * @param presence Pointer to write the current user's presence information to.
364 */
366
367/**
368 * @brief Gets the current user's screen name.
369 * @param name Pointer to write the current user's screen name to.
370 * @param max_size Max size of the screen name.
371 */
372Result FRD_GetMyScreenName(MiiScreenName *name);
373
374/**
375 * @brief Gets the current user's Mii data.
376 * @param mii Pointer to write the current user's mii data to.
377 */
379
380/**
381 * @brief Gets the ID of the current local account.
382 * @param localAccountId Pointer to write the current local account ID to.\
383 */
385
386/**
387 * @brief Gets the current user's playing game.
388 * @param titleId Pointer to write the current user's playing game to.
389 */
391
392/**
393 * @brief Gets the current user's favourite game.
394 * @param titleId Pointer to write the title ID of current user's favourite game to.
395 */
397
398/**
399 * @brief Gets the NcPrincipalId for the current user.
400 * @param ncPrincipalId Pointer to output the NcPrincipalId to.
401 */
403
404/**
405 * @brief Gets the current user's comment on their friend profile.
406 * @param comment Pointer to write the current user's comment to.
407 * @param max_size Max size of the comment.
408 */
409Result FRD_GetMyComment(FriendComment *comment);
410
411/**
412 * @brief Gets the current friend account's NEX password.
413 * @param password Pointer to write the NEX password to.
414 * @param max_size Max size of the output buffer. Must not exceed 0x800.
415 */
416Result FRD_GetMyPassword(char *password, u32 bufsize);
417
418/**
419 * @brief Gets the current user's friend key list.
420 * @param friendKeyList Pointer to write the friend key list to.
421 * @param num Stores the number of friend keys obtained.
422 * @param offset The index of the friend key to start with.
423 * @param size Size of the friend key list. (FRIEND_LIST_SIZE)
424 */
425Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 size);
426
427/**
428 * @brief Gets friend presence data for the current user's friends.
429 * @param friendPresences Pointer to write the friend presence data to.
430 * @param friendKeyList The friend keys of the friends to get presence data for.
431 * @param count The number of input friend keys.
432 */
433Result FRD_GetFriendPresence(FriendPresence *friendPresences, const FriendKey *friendKeyList, u32 count);
434
435/**
436 * @brief Gets screen names for the current user's friends.
437 * @param screenNames Pointer to write the UTF-16 screen names to.
438 * @param screenNamesLen Number of UTF-16 characters `screenNames` can hold. (max: 0x800)
439 * @param characterSets Pointer to write the character sets for the screen names to.
440 * @param characterSetsLen Size of buffer to output character sets to.
441 * @param friendKeyList The friend keys for the friends to get screen names for.
442 * @param count The number of input friend keys.
443 * @param maskNonAscii Whether or not to replace all non-ASCII characters with question marks ('?') if the given character set doesn't match that of the corresponding friend's Mii data.
444 * @param profanityFlag Setting this to true replaces the screen names with all question marks ('?') if profanityFlag is also set in the corresponding friend's Mii data.
445 */
446Result FRD_GetMiiScreenName(MiiScreenName *screenNames, u32 screenNamesLen, u8 *characterSets, u32 characterSetsLen, const FriendKey *friendKeyList, u32 count, bool maskNonAscii, bool profanityFlag);
447
448/**
449 * @brief Gets the current user's friends' Mii data.
450 * @param miiList Pointer to write Mii data to.
451 * @param friendKeyList Pointer to input friend keys.
452 * @param count Number of input friend keys.
453 */
454Result FRD_GetFriendMii(FriendMii *miiList, const FriendKey *friendKeyList, u32 count);
455
456/**
457 * @brief Get the current user's friends' profile data.
458 * @param profile Pointer to write profile data to.
459 * @param friendKeyList Pointer to input friend keys.
460 * @param count Number of input friend keys.
461 */
462Result FRD_GetFriendProfile(Profile *profiles, const FriendKey *friendKeyList, u32 count);
463
464/**
465 * @brief Get the relationship type for the current user's friends.
466 * @param relationships Pointer to output relationship types to.
467 * @param friendKeyList Pointer to input friend keys to query relationship types for.
468 * @param count Number of input friend keys.
469 */
470Result FRD_GetFriendRelationship(u8 *relationships, const FriendKey *friendKeyList, u32 count);
471
472/**
473 * @brief Get attributes for the current user's friends.
474 * @param attributes Pointer to output the attributes to.
475 * @param friendKeyList Pointer to input friend keys to query attributes for.
476 * @param count Number of input friend keys.
477 */
478Result FRD_GetFriendAttributeFlags(u32 *attributes, const FriendKey *friendKeyList, u32 count);
479
480/**
481 * @brief Get the current user's friends' playing game.
482 * @param playingGames Pointer to write playing game data to.
483 * @param friendKeyList Pointer to friend keys.
484 * @param count Number of input friend keys.
485 */
486Result FRD_GetFriendPlayingGame(FriendPlayingGame *playingGames, const FriendKey *friendKeyList, u32 count);
487
488/**
489 * @brief Get the current user's friends' favourite games.
490 * @param favoriteGames Pointer to write game key data to.
491 * @param friendKeyList Pointer to friend keys.
492 * @param count Number of friend keys.
493 */
494Result FRD_GetFriendFavoriteGame(GameKey *favoriteGames, const FriendKey *friendKeyList, u32 count);
495
496/**
497 * @brief Get info about the current user's friends.
498 * @param infos Pointer to output friend info data to.
499 * @param friendKeyList Pointer to input friend keys.
500 * @param count Number of input friend keys.
501 * @param maskNonAscii Whether or not to replace all non-ASCII characters with question marks ('?') if the given character set doesn't match that of the corresponding friend's Mii data.
502 * @param profanityFlag Setting this to true replaces the screen names with all question marks ('?') if profanityFlag is also set in the corresponding friend's Mii data.
503 */
504Result FRD_GetFriendInfo(FriendInfo *infos, const FriendKey *friendKeyList, u32 count, bool maskNonAscii, bool profanityFlag);
505
506/**
507 * @brief Gets whether a friend code is included in the current user's friend list.
508 * @param friendCode The friend code to check for.
509 * @param isFromList Pointer to write whether or not the given friend code was found in the current user's friends list.
510 */
511Result FRD_IsInFriendList(u64 friendCode, bool *isFromList);
512
513/**
514 * @brief Unscrambles a scrambled friend code.
515 * @param unscrambled Pointer to output the unscrambled friend codes to.
516 * @param scrambled Pointer to the input scrambled friend codes.
517 * @param count Number of input scrambled codes.
518 */
519Result FRD_UnscrambleLocalFriendCode(u64 *unscrambled, ScrambledFriendCode *scrambled, u32 count);
520
521/**
522 * @brief Updates the game mode description string.
523 * @param desc Pointer to the UTF-8 game mode description to use.
524 */
525Result FRD_UpdateGameModeDescription(FriendGameModeDescription *desc);
526
527/**
528 * @brief Updates the current user's presence data and game mode description.
529 * @param presence The new presence data to use.
530 * @param desc The new game mode description to use.
531 */
532Result FRD_UpdateMyPresence(Presence *presence, FriendGameModeDescription *desc);
533
534/**
535 * @brief Sends an invitation to the current user's friends.
536 * @param friendKeyList The friend keys to send an invitation to.
537 * @param count The number of input friend keys.
538 */
539Result FRD_SendInvitation(const FriendKey *friendKeyList, u32 count);
540
541/**
542 * @brief Registers the event handle that will be signaled to inform the session of various status changes.
543 * @param event The event handle to register for notification signaling.
544 */
546
547/**
548 * @brief Sets the notification mask for the event notification system.
549 * @param mask The notifications to subscribe to for the event notification system.
550 */
552
553/**
554 * @brief Get Latest Event Notification
555 * @param event Pointer to write recieved notification event struct to.
556 * @param count Number of events
557 * @param recievedNotifCount Number of notification reccieved.
558 */
559Result FRD_GetEventNotification(NotificationEvent *event, u32 count, u32 *recievedNotifCount);
560
561/**
562 * @brief Get the result of the last internal operation.
563 */
565
566/**
567 * @brief Returns the friend code using the given principal ID.
568 * @param principalId The principal ID being used.
569 * @param friendCode Pointer to write the friend code to.
570 */
571Result FRD_PrincipalIdToFriendCode(u32 principalId, u64 *friendCode);
572
573/**
574 * @brief Returns the principal ID using the given friend code.
575 * @param friendCode The friend code being used.
576 * @param principalId Pointer to write the principal ID to.
577 */
578Result FRD_FriendCodeToPrincipalId(u64 friendCode, u32 *principalId);
579
580/**
581 * @brief Checks if the friend code is valid.
582 * @param friendCode The friend code being used.
583 * @param isValid Pointer to write the validity of the friend code to.
584 */
585Result FRD_IsValidFriendCode(u64 friendCode, bool *isValid);
586
587/**
588 * @brief Get a support error code (XXX-YYYY) for the given result code.
589 * @param errorCode Pointer to write the support error code to.
590 * @param res The result code to convert.
591 */
593
594/**
595 * @brief Requests game server authentication.
596 * @param serverId The ID of the NEX server to request authentication for.
597 * @param ingamesn The UTF-16 nickname to use in game.
598 * @param ingamesnSize Buffer size of the input ingamesn buffer. (max: FRIEND_INGAMESN_LEN * 2)
599 * @param majorSdkVersion The major SDK version.
600 * @param minorSdkVersion The minor SDK version.
601 * @param completionEvent The event handle to signal once the operation has completed.
602 */
603Result FRD_RequestGameAuthentication(u32 serverId, u16 *ingamesn, u32 ingamesnSize, u8 majorSdkVersion, u8 minorSdkVersion, Handle completionEvent);
604
605/**
606 * @brief Get game server authentication data requested using FRD_RequestGameAuthentication.
607 * @param data Pointer to write game server authentication data to.
608 */
610
611/**
612 * @brief Request service locator info for a given NEX server.
613 * @param keyhash The `keyhash` value to use for the NASC request.
614 * @param svc The svc `value` to use for the NASC request.
615 * @param majorSdkVersion The major SDK version.
616 * @param minorSdkVersion The minor SDK version.
617 * @param completionEvent The event handle to signal once the operation has completed.
618 * @param serverId
619 */
620Result FRD_RequestServiceLocator(u32 serverId, char *keyhash, char *svc, u8 majorSdkVersion, u8 minorSdkVersion, Handle completionEvent);
621
622/**
623 * @brief Get service locator data requested using FRD_RequestServiceLocator.
624 * @param data Pointer to write the service locator data to.
625 */
627
628/**
629 * @brief Starts an internal task to determine the NAT properties of the current internet connection.
630 * @param completionEvent The event handle to signal once the task has completed.
631 */
633
634/**
635 * @brief Returns NAT properties for the current internet connection.
636 * @param natMappingType Pointer to write the NAT mapping type of the connection to.
637 * @param natFilteringType Pointer to write the NAT filtering type of the connection to.
638 */
639Result FRD_GetNatProperties(u32 *natMappingType, u32 *natFilteringType);
640
641/**
642 * @brief Returns the difference (in nanoseconds) between server time and device time. This difference is calculated every time the system logs into friend services.
643 * @param diffMs The pointer to write the time difference (in nanoseconds) to.
644 */
646
647/**
648 * @brief Configures the current session to allow or disallow running the friends service in sleep mode (half-awake mode).
649 * @param allow Whether or not to enable half-awake mode.
650 */
652
653/**
654 * @brief Gets the server environment configuration for the current user.
655 * @param nascEnvironment Pointer to write the NASC server environment type to.
656 * @param nfsType Pointer to write the NFS (Nintendo Friend Server) type to.
657 * @param nfsNo Pointer to write the NFS (Nintendo Friend Server) number to.
658 */
659Result FRD_GetServerTypes(u8 *nascEnvironment, u8 *nfsType, u8 *nfsNo);
660
661/**
662 * @brief Gets the comment (personal) message of the current user's friends.
663 * @param comments Pointer to write the friend comment data to.
664 * @param commentsLen Number of UTF-16 characters `screenNames` can hold. (max: 0xC00)
665 * @param friendKeyList Pointer to input friend keys.
666 * @param count Number of input friend keys.
667 */
668Result FRD_GetFriendComment(FriendComment *comments, u32 commentsLen, const FriendKey *friendKeyList, u32 count);
669
670/**
671 * @brief Sets the Friend API to use a specific SDK version.
672 * @param sdkVer The SDK version needed to be used.
673 */
675
676/**
677 * @brief Gets the current user's encrypted approach context.
678 * @param ctx Pointer to write the encrypted approach context data to.
679 */
681
682/**
683 * @brief Adds a friend using their encrypted approach context.
684 * @param unkbuf Pointer to unknown (and unused) data.
685 * @param unkbufSize Size of unknown (and unused) data. (max: 0x600)
686 * @param ctx Pointer to encrypted approach context data.
687 * @param completionEvent The event handle to signal when this action is completed.
688 */
689Result FRD_AddFriendWithApproach(u8 *unkbuf, u32 unkbufSize, EncryptedApproachContext *ctx, Handle completionEvent);
690
691/**
692 * @brief Decrypts an encrypted approach context.
693 * @param decryptedContext Pointer to write the decrypted approach context data to.
694 * @param encryptedContext Pointer to input encrypted approach context.
695 * @param maskNonAscii Whether or not to replace all non-ASCII characters with question marks ('?') if the given character set doesn't match that of the corresponding friend's Mii data.
696 * @param characterSet The character set to use for text conversions.
697 */
698Result FRD_DecryptApproachContext(DecryptedApproachContext *decryptedContext, EncryptedApproachContext *encryptedContext, bool maskNonAscii, u8 characterSet);
699
700/**
701 * @brief Gets extended NAT properties. This is the same as FRD_GetNatProperties, with this version also returning the NAT Mapping Port Increment.
702 * @param natMappingType Pointer to write the NAT mapping type of the connection to.
703 * @param natFilteringType Pointer to write the NAT filtering type of the connection to.
704 * @param natMappingPortIncrement Pointer to write the NAT mapping port increment to.
705 */
706Result FRD_GetExtendedNatProperties(u32 *natMappingType, u32 *natFilteringType, u32 *natMappingPortIncrement);
707
708/**
709 * @brief Creates a new local friends account.
710 * @param localAccountId The local account ID to use.
711 * @param nascEnvironment The NASC environment to create this account in.
712 * @param nfsType The NFS (Nintendo Friend Server) type this account should use.
713 * @param nfsNo The NFS (Nintendo Friend Server) number this account should use.
714 */
715Result FRDA_CreateLocalAccount(u8 localAccountId, u8 nascEnvironment, u8 nfsType, u8 nfsNo);
716
717/**
718 * @brief Deletes a local friends account.
719 * @param localAccountId The ID of the local account to delete.
720 */
722
723/**
724 * @brief Loads a local friends account.
725 * @param localAccountId The ID of the local account to load.
726 */
728
729/**
730 * @brief Unloads the currently active local account.
731 */
733
734/**
735 * @brief Saves all data of the friends module.
736 */
738
739/**
740 * @brief Adds a friend online ("Internet" option).
741 * @param event Event signaled when friend is registered.
742 * @param principalId PrincipalId of the friend to add.
743 */
745
746/**
747 * @brief Adds a friend offline ("Local" option).
748 * @param friendKey Pointer to the friend key of the friend to add.
749 * @param mii Pointer to the Mii of the friend to add.
750 * @param friendProfile Pointer to the friend profile of the friend to add.
751 * @param screenName Pointer to the UTF-16 screen name of the friend to add.
752 * @param profanityFlag Setting this to true will cause calls that return the screen name to replace it with question marks ('?') when profanityFlag is true in those calls.
753 * @param characterSet The character set to use for text data of the friend.
754 */
755Result FRDA_AddFriendOffline(FriendKey *friendKey, FriendMii *mii, FriendProfile *friendProfile, MiiScreenName *screenName, bool profanityFlag, u8 characterSet);
756
757/**
758 * @brief Updates a friend's display name.
759 * @param friendKey Pointer to friend key of the friend to update the screen name of.
760 * @param screenName Pointer to the new screen name to use.
761 * @param characterSet The character set of the new screen name.
762 */
763Result FRDA_UpdateMiiScreenName(FriendKey *friendKey, MiiScreenName *screenName, u8 characterSet);
764
765/**
766 * @brief Remove a friend.
767 * @param principalId PrinipalId of the friend code to remove.
768 * @param localFriendCode LocalFriendCode of the friend code to remove.
769 */
770Result FRDA_RemoveFriend(u32 principalId, u64 localFriendCode);
771
772/**
773 * @brief Updates the game being played by the current user.
774 * @param playingGame Pointer to game key of the game being played.
775 */
777
778/**
779 * @brief Updates the current user's friend list preferences.
780 * @param isPublicMode Whether or not the online status should be public.
781 * @param isShowGameMode Whether or not the currently played game is shown.
782 * @param isShowPlayedMode Whether or not the play history is shown.
783 */
784Result FRDA_UpdatePreference(bool isPublicMode, bool isShowGameMode, bool isShowPlayedMode);
785
786/**
787 * @brief Updates the current user's Mii.
788 * @param mii Pointer to the new Mii data to use.
789 * @param screenName Pointer to new screen name associated with the new Mii.
790 * @param profanityFlag Setting this to true will cause calls that return the screen name to replace it with question marks ('?') when profanityFlag is true in those calls.
791 * @param characterSet The character set to use for the screen name.
792 */
793Result FRDA_UpdateMii(FriendMii *mii, MiiScreenName *screenName, bool profanityFlag, u8 characterSet);
794
795/**
796 * @brief Updates the current user's favorite game.
797 * @param favoriteGame Pointer to the game key of the new favorite game.
798 */
800
801/**
802 * @brief Sets the NcPrincipalId of the current user.
803 * @param ncPrincipalId The new NcPrincipalId.
804 */
806
807/**
808 * @brief Updates the current user's comment (personal message).
809 * @param comment Pointer to the new comment (personal message).
810 */
811Result FRDA_UpdateComment(FriendComment *comment);
812
813/**
814 * @brief Increments the move count in the current local account's save data.
815 */
void errorCode(errorConf *err, int error)
Sets error code to display.
Result FRD_GetMyPassword(char *password, u32 bufsize)
Gets the current friend account's NEX password.
Result FRD_GetExtendedNatProperties(u32 *natMappingType, u32 *natFilteringType, u32 *natMappingPortIncrement)
Gets extended NAT properties.
Result FRD_AddFriendWithApproach(u8 *unkbuf, u32 unkbufSize, EncryptedApproachContext *ctx, Handle completionEvent)
Adds a friend using their encrypted approach context.
#define FRIEND_GAME_MODE_DESCRIPTION_LEN
127-character NULL-terminated UTF-16 game mode description
Definition frd.h:9
Result FRD_GetFriendMii(FriendMii *miiList, const FriendKey *friendKeyList, u32 count)
Gets the current user's friends' Mii data.
Result FRD_GetMyPreference(bool *isPublicMode, bool *isShowGameName, bool *isShowPlayedGame)
Gets the current user's privacy information.
Result FRDA_UpdatePlayingGame(GameKey *playingGame)
Updates the game being played by the current user.
Handle * frdGetSessionHandle(void)
Get the friend user/admin service handle.
Result FRD_GetMyPresence(MyPresence *presence)
Gets the current user's presence information.
Result FRDA_SetNcPrincipalId(u32 ncPrincipalId)
Sets the NcPrincipalId of the current user.
#define NFS_TYPESTR_LEN
2-character NULL-terminated ASCII NFS (Nintendo Friend Server) type string
Definition frd.h:17
Result FRDA_UpdateComment(FriendComment *comment)
Updates the current user's comment (personal message).
Result FRD_GetMyScreenName(MiiScreenName *name)
Gets the current user's screen name.
Result FRD_GetFriendPresence(FriendPresence *friendPresences, const FriendKey *friendKeyList, u32 count)
Gets friend presence data for the current user's friends.
Result FRD_GetFriendComment(FriendComment *comments, u32 commentsLen, const FriendKey *friendKeyList, u32 count)
Gets the comment (personal) message of the current user's friends.
Result FRD_GetMyFavoriteGame(GameKey *favoriteGame)
Gets the current user's favourite game.
Result FRD_GetMyNcPrincipalId(u32 *ncPrincipalId)
Gets the NcPrincipalId for the current user.
Result FRD_RequestServiceLocator(u32 serverId, char *keyhash, char *svc, u8 majorSdkVersion, u8 minorSdkVersion, Handle completionEvent)
Request service locator info for a given NEX server.
Result FRD_GetNatProperties(u32 *natMappingType, u32 *natFilteringType)
Returns NAT properties for the current internet connection.
NASCEnvironment
Enum for NASC Server Environment.
Definition frd.h:235
Result FRD_GetMyProfile(Profile *profile)
Gets the current user's profile information.
Result FRDA_DeleteLocalAccount(u8 localAccountId)
Deletes a local friends account.
Result FRD_IsOnline(bool *state)
Gets the online status of the current user.
Result FRDA_UpdateFavoriteGame(GameKey *favoriteGame)
Updates the current user's favorite game.
FriendAttributes
Enum for friend attributes according to relationship type.
Definition frd.h:287
@ FRIEND_ATTRIBUTE_EVER_REGISTERED
Whether or not the current user has ever been in a friend relationship with the friend....
Definition frd.h:288
@ FRIEND_ATTRIBUTE_REGISTRATION_COMPLETE
Whether or not the current user has been fully registered by this friend. Set only when the relations...
Definition frd.h:289
NASCResult
Enum for NASC Result.
Definition frd.h:216
void frdExit(void)
Exits friend services.
Result FRD_AttachToEventNotification(Handle event)
Registers the event handle that will be signaled to inform the session of various status changes.
Result FRDA_RemoveFriend(u32 principalId, u64 localFriendCode)
Remove a friend.
FriendNotificationMask
Enum for notification event mask.
Definition frd.h:262
Result FRDA_UpdatePreference(bool isPublicMode, bool isShowGameMode, bool isShowPlayedMode)
Updates the current user's friend list preferences.
Result FRD_GetServerTypes(u8 *nascEnvironment, u8 *nfsType, u8 *nfsNo)
Gets the server environment configuration for the current user.
Result FRD_IsValidFriendCode(u64 friendCode, bool *isValid)
Checks if the friend code is valid.
Result FRD_UpdateMyPresence(Presence *presence, FriendGameModeDescription *desc)
Updates the current user's presence data and game mode description.
NatMappingType
Enum for NAT mapping type.
Definition frd.h:294
Result FRD_GetFriendPlayingGame(FriendPlayingGame *playingGames, const FriendKey *friendKeyList, u32 count)
Get the current user's friends' playing game.
Result FRD_SetNotificationMask(FriendNotificationMask mask)
Sets the notification mask for the event notification system.
NatFilteringType
Enum for NAT filtering type.
Definition frd.h:302
Result FRD_GetServiceLocatorData(ServiceLocatorData *data)
Get service locator data requested using FRD_RequestServiceLocator.
Result FRD_GetFriendFavoriteGame(GameKey *favoriteGames, const FriendKey *friendKeyList, u32 count)
Get the current user's friends' favourite games.
Result FRDA_UpdateMii(FriendMii *mii, MiiScreenName *screenName, bool profanityFlag, u8 characterSet)
Updates the current user's Mii.
Result FRD_GetFriendInfo(FriendInfo *infos, const FriendKey *friendKeyList, u32 count, bool maskNonAscii, bool profanityFlag)
Get info about the current user's friends.
Result FRD_HasLoggedIn(bool *state)
Gets the login status of the current user.
Result FRD_DetectNatProperties(Handle completionEvent)
Starts an internal task to determine the NAT properties of the current internet connection.
Result FRD_SetClientSdkVersion(u32 sdkVer)
Sets the Friend API to use a specific SDK version.
Result FRD_GetFriendProfile(Profile *profiles, const FriendKey *friendKeyList, u32 count)
Get the current user's friends' profile data.
Result FRD_GetMyPlayingGame(GameKey *playingGame)
Gets the current user's playing game.
Result FRD_GetMyLocalAccountId(u8 *localAccountId)
Gets the ID of the current local account.
Result FRD_PrincipalIdToFriendCode(u32 principalId, u64 *friendCode)
Returns the friend code using the given principal ID.
Result FRD_GetMiiScreenName(MiiScreenName *screenNames, u32 screenNamesLen, u8 *characterSets, u32 characterSetsLen, const FriendKey *friendKeyList, u32 count, bool maskNonAscii, bool profanityFlag)
Gets screen names for the current user's friends.
Result FRD_SendInvitation(const FriendKey *friendKeyList, u32 count)
Sends an invitation to the current user's friends.
Result FRD_GetEventNotification(NotificationEvent *event, u32 count, u32 *recievedNotifCount)
Get Latest Event Notification.
CharacterSet
Enum for character set.
Definition frd.h:207
@ CHARSET_KOR
Character set for KOR.
Definition frd.h:210
@ CHARSET_TWN
Character set for TWN.
Definition frd.h:211
@ CHARSET_JPN_USA_EUR
Character set for JPN, USA, and EUR(+AUS).
Definition frd.h:208
@ CHARSET_CHN
Character set for CHN.
Definition frd.h:209
Result FRDA_IncrementMoveCount()
Increments the move count in the current local account's save data.
#define FRIEND_COMMENT_LEN
16-character NULL-terminated UTF-16 comment
Definition frd.h:8
Result FRDA_AddFriendOnline(Handle event, u32 principalId)
Adds a friend online ("Internet" option).
Result FRD_GetMyMii(FriendMii *mii)
Gets the current user's Mii data.
Result FRD_UpdateGameModeDescription(FriendGameModeDescription *desc)
Updates the game mode description string.
Result FRD_IsInFriendList(u64 friendCode, bool *isFromList)
Gets whether a friend code is included in the current user's friend list.
Result FRD_GetMyFriendKey(FriendKey *key)
Gets the current user's friend key.
Result FRD_Login(Handle event)
Log in to Nintendo's friend server.
Result FRD_GetMyApproachContext(EncryptedApproachContext *ctx)
Gets the current user's encrypted approach context.
Result FRD_ResultToErrorCode(u32 *errorCode, Result res)
Get a support error code (XXX-YYYY) for the given result code.
Result FRD_GetFriendKeyList(FriendKey *friendKeyList, u32 *num, u32 offset, u32 size)
Gets the current user's friend key list.
Result FRD_Logout(void)
Logs out of Nintendo's friend server.
Result frdInit(bool forceUser)
Initializes friend services.
Result FRD_RequestGameAuthentication(u32 serverId, u16 *ingamesn, u32 ingamesnSize, u8 majorSdkVersion, u8 minorSdkVersion, Handle completionEvent)
Requests game server authentication.
Result FRD_GetFriendAttributeFlags(u32 *attributes, const FriendKey *friendKeyList, u32 count)
Get attributes for the current user's friends.
Result FRD_AllowHalfAwake(bool allow)
Configures the current session to allow or disallow running the friends service in sleep mode (half-a...
Result FRD_GetServerTimeDifference(u64 *diff)
Returns the difference (in nanoseconds) between server time and device time.
Result FRD_GetLastResponseResult()
Get the result of the last internal operation.
Result FRDA_UpdateMiiScreenName(FriendKey *friendKey, MiiScreenName *screenName, u8 characterSet)
Updates a friend's display name.
Result FRD_GetFriendRelationship(u8 *relationships, const FriendKey *friendKeyList, u32 count)
Get the relationship type for the current user's friends.
FriendNotificationTypes
Enum for notification event types.
Definition frd.h:243
@ FRIEND_CHANGED_COMMENT
Friend changed comment.
Definition frd.h:255
@ FRIEND_SENT_ANY_INVITATION
Friend sent invitiation (with nonmatching GameJoinID)
Definition frd.h:257
@ FRIEND_CHANGED_ANY_PRESENCE
Friend Presence changed (with nonmatching GameJoinID)
Definition frd.h:256
@ FRIEND_REGISTERED_USER
Friend registered self as friend.
Definition frd.h:251
@ FRIEND_UPDATED_PROFILE
Friend Profile changed.
Definition frd.h:249
@ FRIEND_CHANGED_GAME_MODE_DESCRIPTION
Friend changed game mode description.
Definition frd.h:253
@ FRIEND_WENT_OFFLINE
Friend went offline.
Definition frd.h:250
@ USER_WENT_ONLINE
Self went online.
Definition frd.h:244
@ USER_WENT_OFFLINE
Self went offline.
Definition frd.h:245
@ FRIEND_CHANGED_FAVORITE_GAME
Friend changed favorite game.
Definition frd.h:254
@ FRIEND_WENT_ONLINE
Friend Went Online.
Definition frd.h:246
@ FRIEND_UPDATED_MII
Friend Mii changed.
Definition frd.h:248
@ FRIEND_UPDATED_PRESENCE
Friend Presence changed (with matching GameJoinID)
Definition frd.h:247
@ FRIEND_SENT_JOINABLE_INVITATION
Friend sent invitation (with matching GameJoinID)
Definition frd.h:252
Result FRDA_UnloadLocalAccount()
Unloads the currently active local account.
Result FRD_FriendCodeToPrincipalId(u64 friendCode, u32 *principalId)
Returns the principal ID using the given friend code.
Result FRDA_AddFriendOffline(FriendKey *friendKey, FriendMii *mii, FriendProfile *friendProfile, MiiScreenName *screenName, bool profanityFlag, u8 characterSet)
Adds a friend offline ("Local" option).
Result FRD_GetGameAuthenticationData(GameAuthenticationData *data)
Get game server authentication data requested using FRD_RequestGameAuthentication.
Result FRD_UnscrambleLocalFriendCode(u64 *unscrambled, ScrambledFriendCode *scrambled, u32 count)
Unscrambles a scrambled friend code.
Result FRD_DecryptApproachContext(DecryptedApproachContext *decryptedContext, EncryptedApproachContext *encryptedContext, bool maskNonAscii, u8 characterSet)
Decrypts an encrypted approach context.
Result FRDA_Save()
Saves all data of the friends module.
Result FRDA_CreateLocalAccount(u8 localAccountId, u8 nascEnvironment, u8 nfsType, u8 nfsNo)
Creates a new local friends account.
Result FRD_GetMyComment(FriendComment *comment)
Gets the current user's comment on their friend profile.
RelationshipType
Enum for friend relationship type.
Definition frd.h:277
@ RELATIONSHIP_INCOMPLETE
Provisionally registered friend.
Definition frd.h:278
@ RELATIONSHIP_DELETED
Relationship was deleted.
Definition frd.h:281
@ RELATIONSHIP_LOCAL
Provisionally registered friend (but this relationship has not been sent to the server yet).
Definition frd.h:282
@ RELATIONSHIP_NOT_FOUND
Friend not registered at all.
Definition frd.h:280
@ RELATIONSHIP_COMPLETE
Fully registered friend.
Definition frd.h:279
Result FRDA_LoadLocalAccount(u8 localAccountId)
Loads a local friends account.
Shared Mii struct.
Encrypted inner Approach Context structure.
Definition frd.h:160
Decrypted Approach Context structure.
Definition frd.h:187
bool hasMii
Whether or not this friend has a Mii.
Definition frd.h:192
FriendProfile friendProfile
Friend profile of this friend.
Definition frd.h:197
u8 characterSet
Character set for text data.
Definition frd.h:194
MiiScreenName screenName
UTF-16 screen name of this friend.
Definition frd.h:199
FriendKey friendKey
Friend key of this friend.
Definition frd.h:196
FriendMii mii
Mii data of this friend.
Definition frd.h:198
Encrypted Approach Context structure.
Definition frd.h:172
Friend info structure.
Definition frd.h:114
s64 addedTimestamp
NEX timestamp of when this friend was added to the current user's friend list.
Definition frd.h:116
MiiScreenName screenName
The screen name of this friend.
Definition frd.h:120
FriendKey friendKey
FriendKey of this friend.
Definition frd.h:115
u8 characterSet
The character set used for the text parts of the data of this friend.
Definition frd.h:121
u8 relationship
The type of the relationship with this friend.
Definition frd.h:117
FriendProfile friendProfile
Friend profile data of this friend.
Definition frd.h:119
FriendMii mii
The Mii of this friend.
Definition frd.h:123
Friend key data.
Definition frd.h:30
Friend Mii data.
Definition frd.h:97
u8 characterSet
The character set for text data.
Definition frd.h:99
bool dirtyFlag
Whether or not the Mii is marked as "dirty" (needs to be uploaded to the server).
Definition frd.h:100
MiiData mii
The actual Mii data.
Definition frd.h:102
bool profanityFlag
Whether or not the Mii contains profanity.
Definition frd.h:98
Friend playing game structure.
Definition frd.h:107
GameKey game
Game key of the game.
Definition frd.h:108
Friend presence data.
Definition frd.h:87
Presence presence
The actual presence data.
Definition frd.h:88
bool hasSentInvitation
Whether or not this friend has sent the current user an invitation.
Definition frd.h:90
bool isPresenceLoaded
Whether or not the presence data for this user has been loaded from the server.
Definition frd.h:89
bool found
Whether or not this friend was found.
Definition frd.h:91
Friend profile data.
Definition frd.h:57
Profile profile
Base profile data of this friend.
Definition frd.h:58
GameKey favoriteGame
Favorite game of this friend.
Definition frd.h:59
s64 lastOnlineTimestamp
NEX timestamp of when this friend was last seen online.
Definition frd.h:63
FriendComment personalMessage
Personal message (comment) of this friend.
Definition frd.h:61
u32 ncPrincipalId
NC PrincipalID of this friend.
Definition frd.h:60
Game Authentication Data structure.
Definition frd.h:136
u32 nascResult
NASC result code for the LOGIN operation.
Definition frd.h:137
u16 serverPort
Port of the game server.
Definition frd.h:140
u64 serverTime
NEX timestamp for current server time.
Definition frd.h:143
u32 httpStatusCode
HTTP status code for the NASC LOGIN operation.
Definition frd.h:138
Game key data.
Definition frd.h:38
Shared Base Mii struct.
Definition mii.h:17
Current user's presence data.
Definition frd.h:80
FriendGameModeDescription gameModeDescription
The game mode description of the current user.
Definition frd.h:82
Presence presence
The actual presence data.
Definition frd.h:81
Friend Notification Event structure.
Definition frd.h:128
u8 type
Type of event.
Definition frd.h:129
FriendKey sender
Friend key of friend who caused this notification event to be sent.
Definition frd.h:131
Base presence data.
Definition frd.h:68
Base profile data.
Definition frd.h:46
u8 country
Country code.
Definition frd.h:48
u8 region
The region code for the hardware.
Definition frd.h:47
u8 platform
Platform code.
Definition frd.h:51
u8 area
Area code.
Definition frd.h:49
u8 language
Language code.
Definition frd.h:50
Service Locator Data strcture.
Definition frd.h:148
u8 statusData
statusdata value from the NASC response data.
Definition frd.h:153
u64 serverTime
NEX timestamp for current server time.
Definition frd.h:155
u32 httpStatusCode
HTTP status code for the NASC LOGIN operation.
Definition frd.h:150
u32 nascResult
NASC result code for the SVCLOC operation.
Definition frd.h:149
int64_t s64
64-bit signed integer
Definition types.h:29
#define BIT(n)
Creates a bitmask from a bit number.
Definition types.h:47
uint64_t u64
64-bit unsigned integer
Definition types.h:24
#define CTR_PACKED
Packs a struct (and other types?) so it won't include padding bytes.
Definition types.h:52
uint8_t u8
would be nice if newlib had this already
Definition types.h:21
u32 Handle
Resource handle.
Definition types.h:41
s32 Result
Function result.
Definition types.h:42
uint16_t u16
16-bit unsigned integer
Definition types.h:22
uint32_t u32
32-bit unsigned integer
Definition types.h:23