Reads the phone's battery level as the phone sends it. More...
Go to the source code of this file.
Functions | |
| static int | phone_level_read (int32_t sent) |
| Reads one level off the wire. | |
Reads the phone's battery level as the phone sends it.
The phone sends PHONE_BATTERY as a whole percent, -1 when it has no reading yet, or -2 while no plugin on the phone serves the battery. The number comes off a phone, so it is not trusted: any other negative is no reading and anything past 100 is full, which keeps a battery readout or a bar from drawing past either end.
The sender on the other side is ts/plugin-sources/phone.ts, through the phone battery feature.