eldade / UIDeviceListener

Obtain power information (battery health, charger details) for iOS without any private APIs.
GNU General Public License v3.0
240 stars 38 forks source link

Why did my test results there are no "battery data" #2

Closed sxs2473 closed 8 years ago

sxs2473 commented 8 years ago

I want to get the BatterySerialNumber, how should I get this value. thanks. ^_^ { AbsoluteCapacity = 2614; AdapterDetails = { AdapterVoltage = 5000; Amperage = 2100; Description = "usb host"; FamilyCode = "-536854528"; PMUConfiguration = 1960; Watts = 10; }; AdapterInfo = 16384; Amperage = 2100; AppleChargeRateLimitIndex = 0; AppleRawAdapterDetails = ( { AdapterVoltage = 5000; Amperage = 2100; Description = "usb host"; FamilyCode = "-536854528"; PMUConfiguration = 1960; Watts = 10; } ); AppleRawBrickIDVoltages = ( ( 39, 39 ) ); AppleRawCurrentCapacity = 2511; AppleRawExternalConnected = 1; AppleRawMaxCapacity = 2732; AtCriticalLevel = 0; AtWarnLevel = 0; BatteryInstalled = 1; BatteryKey = "0003-default"; BestAdapterIndex = 0; BootBBCapacity = 2253; BootCapacityEstimate = 86; BootVoltage = 4090; CFBundleIdentifier = "com.apple.driver.AppleARMPlatform"; ChargerConfiguration = 1800; ChargerData = { ChargerAlert = 0; ChargerStatus = 164; ChargingCurrent = 180; ChargingVoltage = 134; NotChargingReason = 0; UpdateTime = 1465352987; }; CurrentCapacity = 2604; CycleCount = 302; DesignCapacity = 2855; ExternalChargeCapable = 1; ExternalConnected = 1; FullyCharged = 0; IOClass = AppleARMPMUCharger; IOFunctionParent8C000000 = <>; IOGeneralInterest = "IOCommand is not serializable"; IOMatchCategory = IODefaultMatchCategory; IONameMatch = charger; IONameMatched = charger; IOPowerManagement = { CapabilityFlags = 32832; CurrentPowerState = 2; DevicePowerState = 2; MaxPowerState = 2; }; IOProbeScore = 1000; IOProviderClass = IOService; InstantAmperage = 543; IsCharging = 1; Location = 0; Manufacturer = F; MaxCapacity = 2800; Model = "0003-F"; NominalChargeCapacity = 2739; PresentDOD = 1293; Temperature = 3080; TimeRemaining = 0; UpdateTime = 1465352987; Voltage = 4321; "built-in" = 1; }

eldade commented 8 years ago

Unfortunately the serial number is only included in this dictionary on iOS 7, not on any later versions. The only way I know to get the battery serial is by directly calling IOKit.