Added type Uuid and use it where needed. Renamed the c field in NcmPlaceHolderId to uuid. Removed PACKED from WebWifiPageArg/WebWifiReturnValue.

This commit is contained in:
yellows8 2019-12-03 23:31:01 -05:00
parent afe030f08b
commit c4bc7b24a0
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43
6 changed files with 10 additions and 8 deletions

View File

@ -47,15 +47,15 @@ typedef struct {
u32 unk_x0; ///< Official sw sets this to 0 with appletStorageWrite, separately from the rest of the config struct. u32 unk_x0; ///< Official sw sets this to 0 with appletStorageWrite, separately from the rest of the config struct.
char conntest_url[0x100]; ///< Connection-test URL. char conntest_url[0x100]; ///< Connection-test URL.
char initial_url[0x400]; ///< Initial URL navigated to by the applet. char initial_url[0x400]; ///< Initial URL navigated to by the applet.
u128 uuid; ///< NIFM Network UUID. Only used by the applet when conntest_url is set. Uuid uuid; ///< NIFM Network UUID. Only used by the applet when conntest_url is set.
u32 rev; ///< Input value for nifm cmd SetRequirementByRevision. Only used by the applet when conntest_url is set. u32 rev; ///< Input value for nifm cmd SetRequirementByRevision. Only used by the applet when conntest_url is set.
} PACKED WebWifiPageArg; } WebWifiPageArg;
/// Struct for the WebWifi applet output storage. /// Struct for the WebWifi applet output storage.
typedef struct { typedef struct {
u32 unk_x0; ///< Unknown. u32 unk_x0; ///< Unknown.
Result res; ///< Result Result res; ///< Result
} PACKED WebWifiReturnValue; } WebWifiReturnValue;
/// Config for WebWifi. /// Config for WebWifi.
typedef struct { typedef struct {
@ -243,7 +243,7 @@ typedef enum {
* @param uuid NIFM Network UUID, for nifm cmd SetNetworkProfileId. Value 0 can be used. Only used by the applet when conntest_url is set. * @param uuid NIFM Network UUID, for nifm cmd SetNetworkProfileId. Value 0 can be used. Only used by the applet when conntest_url is set.
* @param rev Input value for nifm cmd SetRequirementByRevision. Value 0 can be used. Only used by the applet when conntest_url is set. * @param rev Input value for nifm cmd SetRequirementByRevision. Value 0 can be used. Only used by the applet when conntest_url is set.
*/ */
void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char* initial_url, u128 uuid, u32 rev); void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char* initial_url, Uuid uuid, u32 rev);
/** /**
* @brief Launches WifiWebAuthApplet with the specified config and waits for it to exit. * @brief Launches WifiWebAuthApplet with the specified config and waits for it to exit.

View File

@ -1347,7 +1347,7 @@ void appletNotifyRunning(bool *out);
* @note Only available with AppletType_*Application on [2.0.0+]. * @note Only available with AppletType_*Application on [2.0.0+].
* @param[out] out Output PseudoDeviceId. * @param[out] out Output PseudoDeviceId.
*/ */
Result appletGetPseudoDeviceId(u128 *out); Result appletGetPseudoDeviceId(Uuid *out);
/// Set media playback state. /// Set media playback state.
/// If state is set to true, screen dimming and auto sleep is disabled. /// If state is set to true, screen dimming and auto sleep is disabled.

View File

@ -65,7 +65,7 @@ typedef struct {
/// PlaceHolderId /// PlaceHolderId
typedef struct { typedef struct {
alignas(8) u8 c[0x10]; ///< Id alignas(8) Uuid uuid; ///< UUID
} NcmPlaceHolderId; } NcmPlaceHolderId;
/// ContentMetaKey /// ContentMetaKey

View File

@ -48,6 +48,8 @@ typedef u32 Result; ///< Function error code result type.
typedef void (*ThreadFunc)(void *); ///< Thread entrypoint function. typedef void (*ThreadFunc)(void *); ///< Thread entrypoint function.
typedef void (*VoidFn)(void); ///< Function without arguments nor return value. typedef void (*VoidFn)(void); ///< Function without arguments nor return value.
typedef struct { u8 uuid[0x10]; } Uuid; ///< Unique identifier.
/// Creates a bitmask from a bit number. /// Creates a bitmask from a bit number.
#ifndef BIT #ifndef BIT
#define BIT(n) (1U<<(n)) #define BIT(n) (1U<<(n))

View File

@ -52,7 +52,7 @@ static Result _webShow(AppletHolder *holder, AppletId id, u32 version, void* arg
return rc; return rc;
} }
void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char* initial_url, u128 uuid, u32 rev) { void webWifiCreate(WebWifiConfig* config, const char* conntest_url, const char* initial_url, Uuid uuid, u32 rev) {
memset(config, 0, sizeof(*config)); memset(config, 0, sizeof(*config));
if (conntest_url) strncpy(config->arg.conntest_url, conntest_url, sizeof(config->arg.conntest_url)-1); if (conntest_url) strncpy(config->arg.conntest_url, conntest_url, sizeof(config->arg.conntest_url)-1);

View File

@ -2005,7 +2005,7 @@ void appletNotifyRunning(bool *out) {
if (R_FAILED(rc)) fatalThrow(MAKERESULT(Module_Libnx, LibnxError_BadAppletNotifyRunning)); if (R_FAILED(rc)) fatalThrow(MAKERESULT(Module_Libnx, LibnxError_BadAppletNotifyRunning));
} }
Result appletGetPseudoDeviceId(u128 *out) { Result appletGetPseudoDeviceId(Uuid *out) {
if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication()) if (!serviceIsActive(&g_appletSrv) || !_appletIsApplication())
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (hosversionBefore(2,0,0)) if (hosversionBefore(2,0,0))