]> Chaos Git - corbenik/ctrulib.git/commitdiff
os: add function to get link level
authorinfinicore <infinicore@cock.li>
Tue, 23 Jun 2015 15:49:16 +0000 (15:49 +0000)
committerinfinicore <infinicore@cock.li>
Tue, 23 Jun 2015 19:13:30 +0000 (19:13 +0000)
libctru/include/3ds/os.h
libctru/source/os.c

index 446677d3a53613ab82d3c7008f6df903fbe6fdb1..7a4f952e0fa7057f535c518578a6bc62d0f7d8b2 100644 (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();
index 090eb952c62cbd74d9305a78f759313e686cc9fd..9c07d9464c614394dbd29877b30af51e0dbd6ae7 100644 (file)
@@ -149,3 +149,9 @@ const char* osStrError(u32 error) {
                return "Unknown.";
        }
 }
+
+//---------------------------------------------------------------------------------
+u8 osGetWifiStrength(void) {
+//---------------------------------------------------------------------------------
+       return *((u8*)0x1FF81066);
+}