mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 18:42:15 +02:00
Add more set:sys Get*/Set* functions
These are just some simple IPCs really.
This commit is contained in:
parent
a5381e43c0
commit
ed4e8c58dc
@ -79,32 +79,188 @@ Result setsysGetSerialNumber(char *serial);
|
|||||||
*/
|
*/
|
||||||
Result setsysGetLockScreenFlag(bool *out);
|
Result setsysGetLockScreenFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the lockscreen status.
|
||||||
|
* @param flag Whether to enable the lockscreen flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetLockScreenFlag(bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the console information upload status.
|
* @brief Gets the console information upload status.
|
||||||
* @param out Pointer to output the status to.
|
* @param out Pointer to output the status to.
|
||||||
*/
|
*/
|
||||||
Result setsysGetConsoleInformationUploadFlag(bool *out);
|
Result setsysGetConsoleInformationUploadFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the console information upload status.
|
||||||
|
* @param flag Whether to enable the console information upload flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetConsoleInformationUploadFlag(bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the automatic application download status.
|
* @brief Gets the automatic application download status.
|
||||||
* @param out Pointer to output the status to.
|
* @param out Pointer to output the status to.
|
||||||
*/
|
*/
|
||||||
Result setsysGetAutomaticApplicationDownloadFlag(bool *out);
|
Result setsysGetAutomaticApplicationDownloadFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the automatic application download status.
|
||||||
|
* @param flag Whether to enable the automatic application download flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetAutomaticApplicationDownloadFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the quest flag status (Determines if the deivce is a kiosk unit).
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetQuestFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the quest flag status.
|
||||||
|
* @param flag Whether to enable the kiosk device flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetQuestFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the USB 30 status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetUsb30EnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the USB 30 status.
|
||||||
|
* @param flag Whether to enable the USB 30 flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetUsb30EnableFlag(bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the NFC status.
|
* @brief Gets the NFC status.
|
||||||
* @param out Pointer to output the status to.
|
* @param out Pointer to output the status to.
|
||||||
*/
|
*/
|
||||||
Result setsysGetNfcEnableFlag(bool *out);
|
Result setsysGetNfcEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the NFC status.
|
||||||
|
* @param flag Whether to enable the NFC flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetNfcEnableFlag(bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the wireless LAN status.
|
* @brief Gets the wireless LAN status.
|
||||||
* @param out Pointer to output the status to.
|
* @param out Pointer to output the status to.
|
||||||
*/
|
*/
|
||||||
Result setsysGetWirelessLanEnableFlag(bool *out);
|
Result setsysGetWirelessLanEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the wireless LAN status.
|
||||||
|
* @param flag Whether to enable the wireless LAN flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetWirelessLanEnableFlag(bool flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the bluetooth status.
|
* @brief Gets the bluetooth status.
|
||||||
* @param out Pointer to output the status to.
|
* @param out Pointer to output the status to.
|
||||||
*/
|
*/
|
||||||
Result setsysGetBluetoothEnableFlag(bool *out);
|
Result setsysGetBluetoothEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the Bluetooth status.
|
||||||
|
* @param flag Whether to enable the bluetooth flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetBluetoothEnableFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the auto update status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetAutoUpdateEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the auto update status.
|
||||||
|
* @param flag Whether to enable the auto update flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetAutoUpdateEnableFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the battery percentage status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetBatteryPercentageFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the battery percentage status.
|
||||||
|
* @param flag Whether to enable the battery percentage flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetBatteryPercentageFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the external RTC status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetExternalRtcResetFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the external RTC status.
|
||||||
|
* @param flag Whether to enable the external RTC flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetExternalRtcResetFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the USB full key status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetUsbFullKeyEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the USB full key status.
|
||||||
|
* @param flag Whether to enable the USB full key flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetUsbFullKeyEnableFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the bluetooth AFH status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetBluetoothAfhEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the bluetooth AFH status.
|
||||||
|
* @param flag Whether to enable the bluetooth AFH flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetBluetoothAfhEnableFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the bluetooth boost status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetBluetoothBoostEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the bluetooth boost status.
|
||||||
|
* @param flag Whether to enable the bluetooth boost flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetBluetoothBoostEnableFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the repair process status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetInRepairProcessEnableFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the repair process status.
|
||||||
|
* @param flag Whether to enable the repair process flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetInRepairProcessEnableFlag(bool flag);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the headphone volume update status.
|
||||||
|
* @param out Pointer to output the status to.
|
||||||
|
*/
|
||||||
|
Result setsysGetHeadphoneVolumeUpdateFlag(bool *out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets the headphone volume update status.
|
||||||
|
* @param flag Whether to enable the headphone volume update flag.
|
||||||
|
*/
|
||||||
|
Result setsysSetHeadphoneVolumeUpdateFlag(bool flag);
|
||||||
|
@ -418,6 +418,40 @@ Result setsysGetLockScreenFlag(bool *out) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysSetLockScreenFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 8;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result setsysGetConsoleInformationUploadFlag(bool *out) {
|
Result setsysGetConsoleInformationUploadFlag(bool *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -451,6 +485,40 @@ Result setsysGetConsoleInformationUploadFlag(bool *out) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysSetConsoleInformationUploadFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 26;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result setsysGetAutomaticApplicationDownloadFlag(bool *out) {
|
Result setsysGetAutomaticApplicationDownloadFlag(bool *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -484,6 +552,174 @@ Result setsysGetAutomaticApplicationDownloadFlag(bool *out) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysSetAutomaticApplicationDownloadFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 28;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetQuestFlag(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 = 47;
|
||||||
|
|
||||||
|
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 setsysSetQuestFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 48;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetUsb30EnableFlag(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 = 65;
|
||||||
|
|
||||||
|
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 setsysSetUsb30EnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 66;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result setsysGetNfcEnableFlag(bool *out) {
|
Result setsysGetNfcEnableFlag(bool *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -517,6 +753,40 @@ Result setsysGetNfcEnableFlag(bool *out) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysSetNfcEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 70;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result setsysGetWirelessLanEnableFlag(bool *out) {
|
Result setsysGetWirelessLanEnableFlag(bool *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -550,6 +820,40 @@ Result setsysGetWirelessLanEnableFlag(bool *out) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysSetWirelessLanEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 74;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
Result setsysGetBluetoothEnableFlag(bool *out) {
|
Result setsysGetBluetoothEnableFlag(bool *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
@ -582,3 +886,573 @@ Result setsysGetBluetoothEnableFlag(bool *out) {
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result setsysSetBluetoothEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 89;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetAutoUpdateEnableFlag(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 = 95;
|
||||||
|
|
||||||
|
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 setsysSetAutoUpdateEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 96;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetBatteryPercentageFlag(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 = 99;
|
||||||
|
|
||||||
|
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 setsysSetBatteryPercentageFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 100;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetExternalRtcResetFlag(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 = 101;
|
||||||
|
|
||||||
|
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 setsysSetExternalRtcResetFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 102;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetUsbFullKeyEnableFlag(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 = 103;
|
||||||
|
|
||||||
|
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 setsysSetUsbFullKeyEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 104;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetBluetoothAfhEnableFlag(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 = 111;
|
||||||
|
|
||||||
|
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 setsysSetBluetoothAfhEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 112;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetBluetoothBoostEnableFlag(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 = 113;
|
||||||
|
|
||||||
|
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 setsysSetBluetoothBoostEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 114;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetInRepairProcessEnableFlag(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 = 115;
|
||||||
|
|
||||||
|
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 setsysSetInRepairProcessEnableFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 116;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result setsysGetHeadphoneVolumeUpdateFlag(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 = 117;
|
||||||
|
|
||||||
|
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 setsysSetHeadphoneVolumeUpdateFlag(bool flag) {
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
u8 flag;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 118;
|
||||||
|
raw->flag = flag;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_setsysSrv);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
ipcParse(&r);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
} *resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user