mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
parent
7223994aa6
commit
deab92d486
@ -72,3 +72,39 @@ Result setsysGetColorSetId(ColorSetId* out);
|
|||||||
* @param serial Pointer to output the serial to. (The buffer size needs to be at least 0x19 bytes)
|
* @param serial Pointer to output the serial to. (The buffer size needs to be at least 0x19 bytes)
|
||||||
*/
|
*/
|
||||||
Result setsysGetSerialNumber(char *serial);
|
Result setsysGetSerialNumber(char *serial);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the lockscreen status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetLockScreenFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the console information upload status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetConsoleInformationUploadFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the automatic application download status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetAutomaticApplicationDownloadFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the NFC status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetNfcEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the wireless LAN status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetWirelessLanEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the bluetooth status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetBluetoothEnableFlag(bool *out);
|
||||||
|
@ -384,3 +384,201 @@ Result setsysGetSerialNumber(char *serial) {
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysGetLockScreenFlag(bool *out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 7;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
*out = resp->flag;
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetConsoleInformationUploadFlag(bool *out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 25;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
*out = resp->flag;
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetAutomaticApplicationDownloadFlag(bool *out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 27;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
*out = resp->flag;
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetNfcEnableFlag(bool *out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 69;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
*out = resp->flag;
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetWirelessLanEnableFlag(bool *out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 73;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
*out = resp->flag;
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetBluetoothEnableFlag(bool *out) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 88;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
*out = resp->flag;
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user