mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-14 03:16:40 +10:00
Fixed charging status indicator reporting incorrect current values
This commit is contained in:
@@ -123,13 +123,13 @@ namespace WPinternals
|
||||
return (UInt32)((Response[0] << 24) | (Response[1] << 16) | (Response[2] << 8) | Response[3]) + 1;
|
||||
}
|
||||
|
||||
public uint? ReadCurrentChargeCurrent()
|
||||
public int? ReadCurrentChargeCurrent()
|
||||
{
|
||||
byte[] Response = ReadParam("CS");
|
||||
if ((Response == null) || (Response.Length != 8)) return null;
|
||||
|
||||
// This value is in big endian and needs to be XOR'd with 0xFFFFFFFF
|
||||
return ((UInt32)((Response[4] << 24) | (Response[5] << 16) | (Response[6] << 8) | Response[7]) ^ 0xFFFFFFFF) + 1;
|
||||
return (Int32)(((Response[4] << 24) | (Response[5] << 16) | (Response[6] << 8) | Response[7]) ^ 0xFFFFFFFF) + 1;
|
||||
}
|
||||
|
||||
public UefiSecurityStatusResponse ReadSecurityStatus()
|
||||
|
||||
@@ -189,7 +189,13 @@ namespace WPinternals
|
||||
eMMC = Manufacturer + " " + MemSizeDouble.ToString() + " GB";
|
||||
SamsungWarningVisible = (MID == 0x0015);
|
||||
|
||||
ChargingStatus = CurrentModel.ReadCurrentChargeLevel() + "% - " + CurrentModel.ReadCurrentChargeCurrent() + " mA";
|
||||
int chargecurrent = CurrentModel.ReadCurrentChargeCurrent().Value;
|
||||
|
||||
if (chargecurrent < 0)
|
||||
ChargingStatus = CurrentModel.ReadCurrentChargeLevel() + "% - " + ((-1) * CurrentModel.ReadCurrentChargeCurrent()) + " mA (discharging)";
|
||||
else
|
||||
ChargingStatus = CurrentModel.ReadCurrentChargeLevel() + "% - " + CurrentModel.ReadCurrentChargeCurrent() + " mA (charging)";
|
||||
|
||||
LogFile.Log("Charging status: " + ChargingStatus);
|
||||
|
||||
PhoneInfo Info = CurrentModel.ReadPhoneInfo(true);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_LastSelectedProfileId>G:\Projects\Misc\WPinternals\WPinternals.Core\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
<_LastSelectedProfileId>G:\Projects\Misc\WPinternals\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="App.xaml">
|
||||
@@ -98,7 +98,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Test|AnyCPU'">
|
||||
<StartArguments>-test</StartArguments>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user