os: add function to get link level

This commit is contained in:
infinicore 2015-06-23 15:49:16 +00:00
parent 66b2e4548e
commit ec64beffbd
2 changed files with 23 additions and 0 deletions

View File

@ -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();

View File

@ -149,3 +149,9 @@ const char* osStrError(u32 error) {
return "Unknown.";
}
}
//---------------------------------------------------------------------------------
u8 osGetWifiStrength(void) {
//---------------------------------------------------------------------------------
return *((u8*)0x1FF81066);
}