Skip to content

Commit

Permalink
Add Battery/Charger and Miscellaneous tabs (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
masagrator authored Nov 5, 2022
1 parent 31e7d8f commit 7498929
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 169 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Monitor Your hardware in real time!
This is an overlay homebrew dedicated to Nintendo Switch.
You need to have installed Tesla environment to use it.

Tool contains three modes to choose, each one is explained [here](https://github.com/masagrator/Status-Monitor-Overlay/blob/master/docs/modes.md).
Tool contains five modes to choose, each one is explained [here](https://github.com/masagrator/Status-Monitor-Overlay/blob/master/docs/modes.md).

You can exit from selected mode by pressing and holding Left Stick + Right Stick. To exit from main menu press B.

Expand All @@ -23,6 +23,11 @@ If it's not working in dock, you need to first start Status Monitor, then put Ni
- SoC, PCB & Skin temperatures (Skin temperature not supported by FWs <5.0.0)
- Fan Rotation Level
- PFPS and FPS (with help of [NX-FPS](https://github.com/masagrator/NX-FPS), more info in repo. Not installing it results in not showing FPS counters on overlay)
- Battery temperature, raw charge, age, and average voltage
- Charger type, max voltage, and max current
- DSP usage
- NVDEC clock rate
- Network type + Wi-fi password

# Planned:
- Add Graph mode
Expand Down
27 changes: 26 additions & 1 deletion docs/modes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Modes

Status Monitor Overlay from 0.5 release contains three modes to choose from Main Menu
Status Monitor Overlay from 0.7 release contains five modes to choose from Main Menu

# Full

Expand Down Expand Up @@ -61,6 +61,31 @@ If game is not launched, it will show always 254.0 value.

Mode available only with SaltyNX installed.

# Battery

| Category | Format | Explanation |
|----------|-------------------|--------------------------------------------------------------------------|
| Battery Temperature | %.2f | Battery temperature in Celsius |
| Battery Raw Charge | %.2f | Raw battery charged capacity in percent |
| Battery Voltage (45s avg) | %.2f | Battery average voltage in mV |
| Charger Type | %u | Connected charger type, more in Battery.hpp "BatteryChargeInfoFieldsChargerType" |

Shows only if charger type is other than 0:
| Category | Format | Explanation |
|----------|-------------------|--------------------------------------------------------------------------|
| Charger Max Voltage | %u | Charger and external device voltage limit in mV |
| Charger Max Current | %u | Charger and external device current limit in mA |

# Miscellaneous

| Category | Format | Explanation |
|----------|-------------------|--------------------------------------------------------------------------|
| DSP Usage | %u | In percent |
| NVDEC clock rate | %.2f | NVDEC frequency in MHz |
| Network Type | %s | It shows if Switch is connected to internet, and if it's using Ethernet or Wi-Fi |

If Network Type is "Wi-Fi", you can press Y to show password. Since max password length is 64 characters, it may show in up to 3 lines.

# Additional info

> What is Skin temperature (tskin)?
Expand Down
41 changes: 41 additions & 0 deletions include/Misc.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
typedef struct {
u8 ssid_len; ///< NifmSfWirelessSettingData::ssid_len
char ssid[0x21]; ///< NifmSfWirelessSettingData::ssid
u8 unk_x22; ///< NifmSfWirelessSettingData::unk_x21
u8 pad; ///< Padding
u32 unk_x24; ///< NifmSfWirelessSettingData::unk_x22
u32 unk_x28; ///< NifmSfWirelessSettingData::unk_x23
u8 passphrase_len; ///< Passphrase length
u8 passphrase[0x41]; ///< NifmSfWirelessSettingData::passphrase
u8 pad2[0x2]; ///< Padding
} NifmWirelessSettingData_new;

/// NetworkProfileData. Converted from/to \ref NifmSfNetworkProfileData.
typedef struct {
Uuid uuid; ///< NifmSfNetworkProfileData::uuid
char network_name[0x40]; ///< NifmSfNetworkProfileData::network_name
u32 unk_x50; ///< NifmSfNetworkProfileData::unk_x112
u32 unk_x54; ///< NifmSfNetworkProfileData::unk_x113
u8 unk_x58; ///< NifmSfNetworkProfileData::unk_x114
u8 unk_x59; ///< NifmSfNetworkProfileData::unk_x115
u8 pad[2]; ///< Padding
NifmWirelessSettingData_new wireless_setting_data; ///< \ref NifmWirelessSettingData
NifmIpSettingData ip_setting_data; ///< \ref NifmIpSettingData
} NifmNetworkProfileData_new;

Result getNvChannelClockRate(NvChannel *channel, u32 module_id, u32 *clock_rate) {
struct nvhost_clk_rate_args {
uint32_t rate;
uint32_t moduleid;
} args = {
.rate = 0,
.moduleid = module_id,
};

u32 id = hosversionBefore(8,0,0) ? _NV_IOWR(0, 0x14, args) : _NV_IOWR(0, 0x23, args);
Result rc = nvIoctl(channel->fd, id, &args);
if (R_SUCCEEDED(rc) && clock_rate)
*clock_rate = args.rate;

return rc;
}
52 changes: 0 additions & 52 deletions include/service_guard.h

This file was deleted.

Loading

0 comments on commit 7498929

Please sign in to comment.