Pebble App Framework
v7.1.1
How It Works
CLI
Device API
Phone API
C Coverage
TS Coverage
GitHub
Theme
Pebble App Framework: Device API
Toggle main menu visibility
Loading...
Searching...
No Matches
phone_level.h
Go to the documentation of this file.
1
14
#pragma once
15
#include <stdint.h>
16
17
// PHONE_NO_LEVEL and WIRE_NO_PLUGIN are generated from the phone's cap table, so the two sides
18
// cannot drift
19
#include "
wire/wire_caps.g.h
"
20
25
33
static
inline
int
phone_level_read
(int32_t sent)
34
{
35
if
(sent ==
WIRE_NO_PLUGIN
)
36
{
37
return
WIRE_NO_PLUGIN
;
38
}
39
40
if
(sent < 0)
41
{
42
return
PHONE_NO_LEVEL
;
43
}
44
45
return
sent > 100 ? 100 : (int)sent;
46
}
47
phone_level_read
static int phone_level_read(int32_t sent)
Reads one level off the wire.
Definition
phone_level.h:33
wire_caps.g.h
Strip caps and marker values shared by the phone and the watch.
WIRE_NO_PLUGIN
#define WIRE_NO_PLUGIN
Sent in place of a plugin reading while nothing on the phone serves it.
Definition
wire_caps.g.h:32
PHONE_NO_LEVEL
#define PHONE_NO_LEVEL
The phone's battery level for no reading.
Definition
wire_caps.g.h:31
src
c
core
wire
phone_level.h
Generated by
1.18.0