| 9 | #include "SMCBatteryManager.hpp" |
| 10 | |
| 11 | SMC_RESULT ACID::readAccess() { |
| 12 | IOSimpleLockLock(BatteryManager::getShared()->stateLock); |
| 13 | auto extConnected = BatteryManager::getShared()->externalPowerConnected(); |
| 14 | IOSimpleLockUnlock(BatteryManager::getShared()->stateLock); |
| 15 | if (extConnected) { |
| 16 | // Have some dummy value here for now, because ACPI has no means of getting adapter info |
| 17 | // like power, voltage, serial number through only 2 pins - Vcc and GND. |
| 18 | data[0] = 0xba; |
| 19 | data[1] = 0xbe; |
| 20 | data[2] = 0x3c; |
| 21 | data[3] = 0x45; |
| 22 | data[4] = 0xc0; |
| 23 | data[5] = 0x03; |
| 24 | data[6] = 0x10; |
| 25 | data[7] = 0x43; |
| 26 | } else { |
| 27 | memset(data, 0, size); |
| 28 | } |
| 29 | return SmcSuccess; |
| 30 | } |
| 31 | |
| 32 | SMC_RESULT ACIN::readAccess() { |
| 33 | bool *ptr = reinterpret_cast<bool *>(data); |
nothing calls this directly
no test coverage detected