diff --git a/libctru/include/3ds/os.h b/libctru/include/3ds/os.h index 446677d..7a4f952 100644 --- a/libctru/include/3ds/os.h +++ b/libctru/include/3ds/os.h @@ -9,3 +9,20 @@ const char* osStrError(u32 error); u32 osGetFirmVersion(); u32 osGetKernelVersion(); u64 osGetTime(); + +/* @brief Returns the Wifi signal strength. + * + * Valid values are 0-3: + * - 0 means the singal strength is terrible or the 3DS is disconnected from + * all networks. + * - 1 means the signal strength is bad. + * - 2 means the signal strength is decent. + * - 3 means the signal strength is good. + * + * Values outside the range of 0-3 should never be returned. + * + * These values correspond with the number of wifi bars displayed by Home Menu. + * + * @return the Wifi signal strength + */ +u8 osGetWifiStrength(); diff --git a/libctru/source/os.c b/libctru/source/os.c index 090eb95..9c07d94 100644 --- a/libctru/source/os.c +++ b/libctru/source/os.c @@ -149,3 +149,9 @@ const char* osStrError(u32 error) { return "Unknown."; } } + +//--------------------------------------------------------------------------------- +u8 osGetWifiStrength(void) { +//--------------------------------------------------------------------------------- + return *((u8*)0x1FF81066); +}