-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparse_phonelab.go
39 lines (33 loc) · 1.12 KB
/
parse_phonelab.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package phonelab
// These fields are included in every PhoneLab log
type PLLog struct {
Timestamp uint64 `json:"timestamp"`
UptimeNanos uint64 `json:"uptimeNanos"`
LogFormat string `json:"LogFormat"`
}
type BatteryProps struct {
ChargerAcOnline bool `json:"chargerAcOnline"`
ChargerUsbOnline bool `json:"chargerUsbOnline"`
ChargerWirelessOnline bool `json:"chargerWirelessOnline"`
Status int `json:"Status"`
Health int `json:"Health"`
Present bool `json:"Present"`
Level int `json:"Level"`
Voltage int `json:"Voltage"`
Temperature int `json:"Temperature"`
Technology string `json:"Technology"`
}
type PLPowerBatteryLog struct {
PLLog
Action string `json:"Action"`
Scale int `json:"Scale"`
BatteryProperties BatteryProps `json:"BatteryProperties"`
}
type PLPowerBatteryProps struct {
}
func (p *PLPowerBatteryProps) New() interface{} {
return &PLPowerBatteryLog{}
}
func NewPLPowerBatteryParser() Parser {
return NewJSONParser(&PLPowerBatteryProps{})
}