Lines Matching refs:fd
34 void BatteryDump::DumpBatteryHelp(int32_t fd)
36 dprintf(fd, "Usage:\n");
37 dprintf(fd, " -h: dump help\n");
38 dprintf(fd, " -i: dump battery info\n");
40 dprintf(fd, " -u: unplug battery charging state\n");
41 dprintf(fd, " -r: reset battery state\n");
42 dprintf(fd, " --capacity <capacity>: set battery capacity, the capacity range [0, 100]\n");
43 dprintf(fd, " --uevent <uevent>: set battery uevent\n");
47 void BatteryDump::DumpCurrentTime(int32_t fd)
57 dprintf(fd, "Current time: %04d-%02d-%02d %02d:%02d:%02d.%03d\n", timeinfo->tm_year + 1900, timeinfo->tm_mon + 1,
62 bool BatteryDump::GetBatteryInfo(int32_t fd, sptr<BatteryService> &service, const std::vector<std::u16string> &args)
68 DumpCurrentTime(fd);
70 dprintf(fd, "capacity: %u \n", capacity);
72 dprintf(fd, "batteryLevel: %u \n", batteryLevel);
74 dprintf(fd, "chargingStatus: %u \n", chargingStatus);
76 dprintf(fd, "healthState: %u \n", healthState);
78 dprintf(fd, "pluggedType: %u \n", pluggedType);
80 dprintf(fd, "voltage: %d \n", voltage);
82 dprintf(fd, "present: %d \n", present);
84 dprintf(fd, "technology: %s \n", technology.c_str());
86 dprintf(fd, "nowCurrent: %d \n", nowCurrent);
88 dprintf(fd, "currentAverage: %d \n", currentAverage);
90 dprintf(fd, "totalEnergy: %d \n", totalEnergy);
92 dprintf(fd, "remainingEnergy: %d \n", remainEnergy);
94 dprintf(fd, "remainingChargeTime: %ld \n", remainingChargeTime);
96 dprintf(fd, "temperature: %d \n", temperature);
98 dprintf(fd, "chargeType: %u \n", chargeType);
102 bool BatteryDump::MockUnplugged(int32_t fd, sptr<BatteryService>& service, const std::vector<std::u16string>& args)
110 dprintf(fd, "unplugged battery charging state \n");
112 dprintf(fd, "[Failed] User version is not support \n");
117 bool BatteryDump::Reset(int32_t fd, sptr<BatteryService>& service, const std::vector<std::u16string>& args)
125 dprintf(fd, "reset battery state \n");
127 dprintf(fd, "[Failed] User version is not support \n");
132 bool BatteryDump::MockCapacity(int32_t fd, sptr<BatteryService> &service, const std::vector<std::u16string> &args)
146 dprintf(fd, "capacity out of range\n");
150 dprintf(fd, "battery capacity %d \n", capacity);
152 dprintf(fd, "[Failed] User version is not support \n");
157 bool BatteryDump::MockUevent(int32_t fd, sptr<BatteryService> &service, const std::vector<std::u16string> &args)
166 dprintf(fd, "battery uevent %s \n", uevent.c_str());
168 dprintf(fd, "[Failed] User version is not support \n");