-
-
Notifications
You must be signed in to change notification settings - Fork 521
/
types_status.go
53 lines (44 loc) · 1.02 KB
/
types_status.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package vw
const ServiceOdometer = "0x0101010002"
type StatusResponse struct {
StoredVehicleDataResponse struct {
VIN string
VehicleData struct {
Data []ServiceDefinition
}
}
Error *Error
}
func (s *StatusResponse) ServiceByID(id string) *ServiceDefinition {
for _, d := range s.StoredVehicleDataResponse.VehicleData.Data {
if d.ID == id {
return &d
}
}
return nil
}
type ServiceDefinition struct {
ID string
Field []FieldDefinition
}
func (s *ServiceDefinition) FieldByID(id string) *FieldDefinition {
if s == nil {
return nil
}
for _, f := range s.Field {
if f.ID == id {
return &f
}
}
return nil
}
type FieldDefinition struct {
ID string // "0x0101010001",
TsCarSentUtc string // "2021-09-05T07:54:20Z",
TsCarSent string // "2021-09-05T07:54:19",
TsCarCaptured string // "2021-09-05T07:54:19",
TsTssReceivedUtc string // "2021-09-05T07:54:23Z",
MilCarCaptured int // 25009,
MilCarSent int // 25009,
Value string // "echo"
}