diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml new file mode 100644 index 0000000..ecac189 --- /dev/null +++ b/.github/workflows/generate.yml @@ -0,0 +1,39 @@ +name: generate files +on: + pull_request: + branches: [ '**' ] +env: + GOPRIVATE: github.com/DIMO-Network + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + golangci: + runs-on: ubuntu-latest + + name: lint + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.22 + + - name: Checkout code + uses: actions/checkout@v4 + + - name: go mod tidy + run: go mod tidy + + - name: go mod verify + run: go mod verify + + - name: generate + run: make generate + + - name: porcelain + shell: bash + run: | + dirty_files="$(git status --porcelain)" + if [[ `git status --porcelain` ]]; then + echo "The following files are dirty after running generators:" + echo "${dirty_files}" + exit 1 + fi \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 9c9a803..8ec8aa0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -56,3 +56,10 @@ issues: - path: convert-funcs_test\.go linters: - dupl + # Exclude some linters from running on tests files. + - path: _test\.go + linters: + - funlen + - errcheck + - dupl + - gosec diff --git a/README.md b/README.md index a6f0087..f5b0c9b 100644 --- a/README.md +++ b/README.md @@ -40,36 +40,27 @@ The Model generation is handled by packages in `internal/codegen`. They are resp ```yaml # vspecName: The name of the VSpec field in the VSS schema +# required - vspecName: DIMO.DefinitionID - - # isArray: Whether the field is an array or not - # if null then the value is inferred from the vspec definition - isArray: null - - # clickHouseType: The data type to use for ClickHouse Database. - #if empty then the type is inferred from the vspec definition - clickHouseType: "" - # goType: The data type to use for Golang struct. + # available types: [float64, string] # if empty then the type is inferred from the vspec definition goType: "" - # gqlType: The data type to use for GraphQL schema. - # if empty then the type is inferred from the vspec definition - gqlType: "" - # conversion: The mapping of the original data to the VSpec field conversion: # originalName: The name of the field in the original data + # required originalName: data.definitionID # originalType: The data type of the field in the original data originalType: string - # isArray: Whether the field is an array or not + # isArray: Whether the original field is an array or not isArray: false # requiredPrivileges: The list of privileges required to access the field + # required requiredPrivileges: - VEHICLE_NON_LOCATION_DATA ``` diff --git a/go.mod b/go.mod index f1d64fd..59ff67c 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,6 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/madflojo/testcerts v1.1.1 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mfridman/interpolate v0.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect diff --git a/go.sum b/go.sum index b6029cc..cc56c5c 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/madflojo/testcerts v1.1.1 h1:YsSHWV79nMNZK0mJtwXjKoYHjJEbLPFefR8TxmmWupY= -github.com/madflojo/testcerts v1.1.1/go.mod h1:MW8sh39gLnkKh4K0Nc55AyHEDl9l/FBLDUsQhpmkuo0= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= diff --git a/pkg/schema/load.go b/pkg/schema/load.go index 638977f..94ee656 100644 --- a/pkg/schema/load.go +++ b/pkg/schema/load.go @@ -37,15 +37,18 @@ func LoadSignalsCSV(r io.Reader) ([]*SignalInfo, error) { // LoadDefinitionFile loads the definitions from a definitions.yaml file. func LoadDefinitionFile(r io.Reader) (*Definitions, error) { decoder := yaml.NewDecoder(r) - var transInfos []*DefinitionInfo - err := decoder.Decode(&transInfos) + var defInfos []*DefinitionInfo + err := decoder.Decode(&defInfos) if err != nil { return nil, fmt.Errorf("failed to decode json: %w", err) } definitions := &Definitions{ FromName: map[string]*DefinitionInfo{}, } - for _, info := range transInfos { + for _, info := range defInfos { + if err := Validate(info); err != nil { + return nil, fmt.Errorf("error validating definitions: %w", err) + } definitions.FromName[info.VspecName] = info } diff --git a/pkg/schema/signal.go b/pkg/schema/signal.go index 40fca21..767fb9f 100644 --- a/pkg/schema/signal.go +++ b/pkg/schema/signal.go @@ -55,8 +55,6 @@ type ConversionInfo struct { // DefinitionInfo contains the definition information for a field. type DefinitionInfo struct { VspecName string `json:"vspecName" yaml:"vspecName"` - IsArray *bool `json:"isArray" yaml:"isArray"` - ClickHouseType string `json:"clickHouseType" yaml:"clickHouseType"` GoType string `json:"goType" yaml:"goType"` Conversions []*ConversionInfo `json:"conversions" yaml:"conversions"` RequiredPrivileges []string `json:"requiredPrivileges" yaml:"requiredPrivileges"` @@ -117,8 +115,8 @@ func NewSignalInfo(record []string) *SignalInfo { // MergeWithDefinition merges the signal with the definition information. func (s *SignalInfo) MergeWithDefinition(definition *DefinitionInfo) { - if definition.IsArray != nil { - s.IsArray = *definition.IsArray + if definition.GoType != "" { + s.BaseGoType = definition.GoType } if len(definition.Conversions) != 0 { s.Conversions = definition.Conversions @@ -133,9 +131,6 @@ func (s *SignalInfo) MergeWithDefinition(definition *DefinitionInfo) { // GOType returns the golang type of the signal. func (s *SignalInfo) GOType() string { - if s.IsArray { - return "[]" + s.BaseGoType - } return s.BaseGoType } diff --git a/pkg/schema/spec/definitions.yaml b/pkg/schema/spec/definitions.yaml index 56347d4..bad27fd 100755 --- a/pkg/schema/spec/definitions.yaml +++ b/pkg/schema/spec/definitions.yaml @@ -2,11 +2,6 @@ # vspecName: The name of the VSpec field in the VSS schema - vspecName: Vehicle.Chassis.Axle.Row1.Wheel.Left.Tire.Pressure - - # isArray: Whether the field is an array or not - # if null then the value is inferred from the vspec definition - isArray: null - # goType: The type to use for Golang struct. # if empty then the type is inferred from the vspec definition goType: "" @@ -26,9 +21,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Chassis.Axle.Row1.Wheel.Right.Tire.Pressure - isArray: null goType: "" - gqlType: "" conversions: - originalName: tires.frontRight originalType: float64 @@ -36,9 +29,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Chassis.Axle.Row2.Wheel.Left.Tire.Pressure - isArray: null goType: "" - gqlType: "" conversions: - originalName: tires.backLeft originalType: float64 @@ -46,9 +37,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Chassis.Axle.Row2.Wheel.Right.Tire.Pressure - isArray: null goType: "" - gqlType: "" conversions: - originalName: tires.backRight originalType: float64 @@ -56,9 +45,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.CurrentLocation.Altitude - isArray: null goType: "" - gqlType: "" conversions: - originalName: altitude originalType: float64 @@ -66,9 +53,7 @@ requiredPrivileges: - VEHICLE_ALL_TIME_LOCATION - vspecName: Vehicle.CurrentLocation.Latitude - isArray: null goType: "" - gqlType: "" conversions: - originalName: latitude originalType: float64 @@ -76,9 +61,7 @@ requiredPrivileges: - VEHICLE_ALL_TIME_LOCATION - vspecName: Vehicle.CurrentLocation.Longitude - isArray: null goType: "" - gqlType: "" conversions: - originalName: longitude originalType: float64 @@ -89,7 +72,6 @@ isArray: false clickHouseType: DateTime('UTC') goType: "float64" - gqlType: "" conversions: - originalName: timestamp originalType: string @@ -100,9 +82,7 @@ requiredPrivileges: - VEHICLE_ALL_TIME_LOCATION - vspecName: Vehicle.Exterior.AirTemperature - isArray: null goType: "" - gqlType: "" conversions: - originalName: ambientTemp originalType: float64 @@ -110,9 +90,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.LowVoltageBattery.CurrentVoltage - isArray: null goType: "" - gqlType: "" conversions: - originalName: batteryVoltage originalType: float64 @@ -120,9 +98,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.OBD.BarometricPressure - isArray: null goType: "" - gqlType: "" conversions: - originalName: barometricPressure originalType: float64 @@ -130,9 +106,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.OBD.EngineLoad - isArray: null goType: "" - gqlType: "" conversions: - originalName: engineLoad originalType: float64 @@ -140,9 +114,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.OBD.IntakeTemp - isArray: null goType: "" - gqlType: "" conversions: - originalName: intakeTemp originalType: float64 @@ -150,9 +122,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.OBD.RunTime - isArray: null goType: "" - gqlType: "" conversions: - originalName: runTime originalType: float64 @@ -160,9 +130,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.CombustionEngine.ECT - isArray: null goType: "" - gqlType: "" conversions: - originalName: coolantTemp originalType: float64 @@ -170,9 +138,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.CombustionEngine.EngineOilLevel - isArray: null goType: "" - gqlType: "" conversions: - originalName: oil originalType: float64 @@ -180,9 +146,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.CombustionEngine.Speed - isArray: null goType: "" - gqlType: "" conversions: - originalName: engineSpeed originalType: float64 @@ -190,9 +154,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.CombustionEngine.TPS - isArray: null goType: "" - gqlType: "" conversions: - originalName: throttlePosition originalType: float64 @@ -200,9 +162,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.FuelSystem.AbsoluteLevel - isArray: null goType: "" - gqlType: "" conversions: - originalName: fuelPercentRemaining originalType: float64 @@ -212,7 +172,6 @@ - vspecName: Vehicle.Powertrain.FuelSystem.SupportedFuelTypes isArray: false goType: "" - gqlType: "" conversions: - originalName: fuelType originalType: string @@ -220,9 +179,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.Range - isArray: null goType: "" - gqlType: "" conversions: - originalName: range originalType: float64 @@ -230,9 +187,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.TractionBattery.Charging.ChargeLimit - isArray: null goType: "" - gqlType: "" conversions: - originalName: chargeLimit originalType: float64 @@ -240,9 +195,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.TractionBattery.Charging.IsCharging - isArray: null goType: "" - gqlType: "" conversions: - originalName: charging originalType: bool @@ -250,9 +203,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.TractionBattery.CurrentPower - isArray: null goType: "" - gqlType: "" conversions: - originalName: charger.power originalType: float64 @@ -260,9 +211,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.TractionBattery.GrossCapacity - isArray: null goType: "" - gqlType: "" conversions: - originalName: batteryCapacity originalType: float64 @@ -270,9 +219,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.TractionBattery.StateOfCharge.Current - isArray: null goType: "" - gqlType: "" conversions: - originalName: soc originalType: float64 @@ -280,9 +227,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.Transmission.TravelledDistance - isArray: null goType: "" - gqlType: "" conversions: - originalName: odometer originalType: float64 @@ -290,9 +235,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.Type - isArray: null goType: "" - gqlType: "" conversions: - originalName: fuelType originalType: string @@ -300,9 +243,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Speed - isArray: null goType: "" - gqlType: "" conversions: - originalName: speed originalType: float64 @@ -310,9 +251,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.VehicleIdentification.Brand - isArray: null goType: "" - gqlType: "" conversions: - originalName: make originalType: string @@ -320,9 +259,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.VehicleIdentification.Model - isArray: null goType: "" - gqlType: "" conversions: - originalName: model originalType: string @@ -330,9 +267,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.VehicleIdentification.Year - isArray: null goType: "" - gqlType: "" conversions: - originalName: year originalType: float64 @@ -340,9 +275,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.Powertrain.CombustionEngine.MAF - isArray: null goType: "" - gqlType: "" conversions: - originalName: maf originalType: float64 @@ -350,9 +283,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.DIMO.Aftermarket.HDOP - isArray: null goType: "" - gqlType: "" conversions: - originalName: hdop originalType: float64 @@ -360,9 +291,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.DIMO.Aftermarket.NSAT - isArray: null goType: "" - gqlType: "" conversions: - originalName: nsat originalType: float64 @@ -370,9 +299,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.DIMO.Aftermarket.WPAState - isArray: null goType: "" - gqlType: "" conversions: - originalName: wpa_state originalType: string @@ -380,9 +307,7 @@ requiredPrivileges: - VEHICLE_NON_LOCATION_DATA - vspecName: Vehicle.DIMO.Aftermarket.SSID - isArray: null goType: "" - gqlType: "" conversions: - originalName: ssid originalType: string diff --git a/pkg/schema/validation.go b/pkg/schema/validation.go new file mode 100644 index 0000000..09b06a0 --- /dev/null +++ b/pkg/schema/validation.go @@ -0,0 +1,57 @@ +package schema + +import ( + "fmt" + "slices" +) + +var ( + goTypes = []string{"float64", "string"} + + // privileges are defined on chain and copied here for validation. + privileges = []string{"VEHICLE_NON_LOCATION_DATA", "VEHICLE_COMMANDS", "VEHICLE_CURRENT_LOCATION", "VEHICLE_ALL_TIME_LOCATION", "VEHICLE_VIN_CREDENTIAL"} +) + +// ErrInvalid is an error for invalid definitions. +type ErrInvalid struct { + Property string + Name string + Reason string +} + +func (e ErrInvalid) Error() string { + return fmt.Sprintf("signal '%s' property '%s' %s", e.Property, e.Name, e.Reason) +} + +// Validate checks if the definition is valid. +func Validate(d *DefinitionInfo) error { + if d == nil { + return ErrInvalid{Property: "", Name: "", Reason: "is nil"} + } + if d.VspecName == "" { + return ErrInvalid{Property: "vspecName", Name: d.VspecName, Reason: "is empty"} + } + if d.GoType != "" && !slices.Contains(goTypes, d.GoType) { + return ErrInvalid{Property: "goType", Name: d.GoType, Reason: fmt.Sprintf("must be one of %v", goTypes)} + } + if len(d.Conversions) == 0 { + return ErrInvalid{Property: "conversions", Name: d.VspecName, Reason: "at least one conversion is required"} + } + for _, conv := range d.Conversions { + if conv == nil { + return ErrInvalid{Property: "conversion", Name: d.VspecName, Reason: "is nil"} + } + if conv.OriginalName == "" { + return ErrInvalid{Property: "originalName", Name: d.VspecName, Reason: "is empty"} + } + } + if len(d.RequiredPrivileges) == 0 { + return ErrInvalid{Property: "requiredPrivileges", Name: d.VspecName, Reason: "at least one privilege is required"} + } + for _, priv := range d.RequiredPrivileges { + if !slices.Contains(privileges, priv) { + return ErrInvalid{Property: "requiredPrivileges", Name: d.VspecName, Reason: fmt.Sprintf("must be one of %v", privileges)} + } + } + return nil +} diff --git a/pkg/schema/validation_test.go b/pkg/schema/validation_test.go new file mode 100644 index 0000000..2bbffa3 --- /dev/null +++ b/pkg/schema/validation_test.go @@ -0,0 +1,132 @@ +package schema + +import "testing" + +func TestValidate(t *testing.T) { + tests := []struct { + name string + d *DefinitionInfo + expected error + }{ + { + name: "Valid Definition", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "float64", + Conversions: []*ConversionInfo{{OriginalName: "OriginalName"}}, + RequiredPrivileges: []string{"VEHICLE_NON_LOCATION_DATA"}, + }, + expected: nil, + }, + { + name: "Nil Definition", + d: nil, + expected: ErrInvalid{ + Property: "", + Name: "", + Reason: "is nil", + }, + }, + { + name: "Empty VspecName", + d: &DefinitionInfo{ + VspecName: "", + }, + expected: ErrInvalid{ + Property: "vspecName", + Name: "", + Reason: "is empty", + }, + }, + { + name: "Invalid GoType", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "int", + }, + expected: ErrInvalid{ + Property: "goType", + Name: "int", + Reason: "must be one of [float64 string]", + }, + }, + { + name: "No Conversions", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "float64", + }, + expected: ErrInvalid{ + Property: "conversions", + Name: "Vehicle", + Reason: "at least one conversion is required", + }, + }, + { + name: "Nil Conversion", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "float64", + Conversions: []*ConversionInfo{ + nil, + }, + }, + expected: ErrInvalid{ + Property: "conversion", + Name: "Vehicle", + Reason: "is nil", + }, + }, + { + name: "Empty OriginalName", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "float64", + Conversions: []*ConversionInfo{ + {OriginalName: ""}, + }, + }, + expected: ErrInvalid{ + Property: "originalName", + Name: "Vehicle", + Reason: "is empty", + }, + }, + { + name: "No RequiredPrivileges", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "float64", + Conversions: []*ConversionInfo{{OriginalName: "OriginalName"}}, + }, + expected: ErrInvalid{ + Property: "requiredPrivileges", + Name: "Vehicle", + Reason: "at least one privilege is required", + }, + }, + { + name: "Invalid RequiredPrivilege", + d: &DefinitionInfo{ + VspecName: "Vehicle", + GoType: "float64", + Conversions: []*ConversionInfo{{OriginalName: "OriginalName"}}, + RequiredPrivileges: []string{"INVALID_PRIVILEGE"}, + }, + expected: ErrInvalid{ + Property: "requiredPrivileges", + Name: "Vehicle", + Reason: "must be one of [VEHICLE_NON_LOCATION_DATA VEHICLE_COMMANDS VEHICLE_CURRENT_LOCATION VEHICLE_ALL_TIME_LOCATION VEHICLE_VIN_CREDENTIAL]", + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + result := Validate(test.d) + if result != test.expected { + t.Errorf("Unexpected result. Expected: %v, Got: %v", test.expected, result) + } + }) + } +} diff --git a/vehicle-structs.go b/vehicle-structs.go deleted file mode 100644 index 54b14d4..0000000 --- a/vehicle-structs.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by "model-garage" DO NOT EDIT. -package vspec - -const ( - // FieldChassisAxleRow1WheelLeftTirePressure Tire pressure in kilo-Pascal. - FieldChassisAxleRow1WheelLeftTirePressure = "chassisAxleRow1WheelLeftTirePressure" - // FieldChassisAxleRow1WheelRightTirePressure Tire pressure in kilo-Pascal. - FieldChassisAxleRow1WheelRightTirePressure = "chassisAxleRow1WheelRightTirePressure" - // FieldChassisAxleRow2WheelLeftTirePressure Tire pressure in kilo-Pascal. - FieldChassisAxleRow2WheelLeftTirePressure = "chassisAxleRow2WheelLeftTirePressure" - // FieldChassisAxleRow2WheelRightTirePressure Tire pressure in kilo-Pascal. - FieldChassisAxleRow2WheelRightTirePressure = "chassisAxleRow2WheelRightTirePressure" - // FieldCurrentLocationAltitude Current altitude relative to WGS 84 reference ellipsoid, as measured at the position of GNSS receiver antenna. - FieldCurrentLocationAltitude = "currentLocationAltitude" - // FieldCurrentLocationLatitude Current latitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna. - FieldCurrentLocationLatitude = "currentLocationLatitude" - // FieldCurrentLocationLongitude Current longitude of vehicle in WGS 84 geodetic coordinates, as measured at the position of GNSS receiver antenna. - FieldCurrentLocationLongitude = "currentLocationLongitude" - // FieldCurrentLocationTimestamp Timestamp from GNSS system for current location, formatted according to ISO 8601 with UTC time zone. - FieldCurrentLocationTimestamp = "currentLocationTimestamp" - // FieldDIMOAftermarketHDOP Horizontal dilution of precision of GPS - FieldDIMOAftermarketHDOP = "dIMOAftermarketHDOP" - // FieldDIMOAftermarketNSAT Number of sync satellites for GPS - FieldDIMOAftermarketNSAT = "dIMOAftermarketNSAT" - // FieldDIMOAftermarketSSID Service Set Ientifier for the wifi. - FieldDIMOAftermarketSSID = "dIMOAftermarketSSID" - // FieldDIMOAftermarketWPAState Indicate the current wpa state for the devices wifi - FieldDIMOAftermarketWPAState = "dIMOAftermarketWPAState" - // FieldExteriorAirTemperature Air temperature outside the vehicle. - FieldExteriorAirTemperature = "exteriorAirTemperature" - // FieldLowVoltageBatteryCurrentVoltage Current Voltage of the low voltage battery. - FieldLowVoltageBatteryCurrentVoltage = "lowVoltageBatteryCurrentVoltage" - // FieldOBDBarometricPressure PID 33 - Barometric pressure - FieldOBDBarometricPressure = "oBDBarometricPressure" - // FieldOBDEngineLoad PID 04 - Engine load in percent - 0 = no load, 100 = full load - FieldOBDEngineLoad = "oBDEngineLoad" - // FieldOBDIntakeTemp PID 0F - Intake temperature - FieldOBDIntakeTemp = "oBDIntakeTemp" - // FieldOBDRunTime PID 1F - Engine run time - FieldOBDRunTime = "oBDRunTime" - // FieldPowertrainCombustionEngineECT Engine coolant temperature. - FieldPowertrainCombustionEngineECT = "powertrainCombustionEngineECT" - // FieldPowertrainCombustionEngineEngineOilLevel Engine oil level. - FieldPowertrainCombustionEngineEngineOilLevel = "powertrainCombustionEngineEngineOilLevel" - // FieldPowertrainCombustionEngineMAF Grams of air drawn into engine per second. - FieldPowertrainCombustionEngineMAF = "powertrainCombustionEngineMAF" - // FieldPowertrainCombustionEngineSpeed Engine speed measured as rotations per minute. - FieldPowertrainCombustionEngineSpeed = "powertrainCombustionEngineSpeed" - // FieldPowertrainCombustionEngineTPS Current throttle position. - FieldPowertrainCombustionEngineTPS = "powertrainCombustionEngineTPS" - // FieldPowertrainFuelSystemAbsoluteLevel Current available fuel in the fuel tank expressed in liters. - FieldPowertrainFuelSystemAbsoluteLevel = "powertrainFuelSystemAbsoluteLevel" - // FieldPowertrainFuelSystemSupportedFuelTypes High level information of fuel types supported - FieldPowertrainFuelSystemSupportedFuelTypes = "powertrainFuelSystemSupportedFuelTypes" - // FieldPowertrainRange Remaining range in meters using all energy sources available in the vehicle. - FieldPowertrainRange = "powertrainRange" - // FieldPowertrainTractionBatteryChargingChargeLimit Target charge limit (state of charge) for battery. - FieldPowertrainTractionBatteryChargingChargeLimit = "powertrainTractionBatteryChargingChargeLimit" - // FieldPowertrainTractionBatteryChargingIsCharging True if charging is ongoing. Charging is considered to be ongoing if energy is flowing from charger to vehicle. - FieldPowertrainTractionBatteryChargingIsCharging = "powertrainTractionBatteryChargingIsCharging" - // FieldPowertrainTractionBatteryCurrentPower Current electrical energy flowing in/out of battery. Positive = Energy flowing in to battery, e.g. during charging. Negative = Energy flowing out of battery, e.g. during driving. - FieldPowertrainTractionBatteryCurrentPower = "powertrainTractionBatteryCurrentPower" - // FieldPowertrainTractionBatteryGrossCapacity Gross capacity of the battery. - FieldPowertrainTractionBatteryGrossCapacity = "powertrainTractionBatteryGrossCapacity" - // FieldPowertrainTractionBatteryStateOfChargeCurrent Physical state of charge of the high voltage battery, relative to net capacity. This is not necessarily the state of charge being displayed to the customer. - FieldPowertrainTractionBatteryStateOfChargeCurrent = "powertrainTractionBatteryStateOfChargeCurrent" - // FieldPowertrainTransmissionTravelledDistance Odometer reading, total distance travelled during the lifetime of the transmission. - FieldPowertrainTransmissionTravelledDistance = "powertrainTransmissionTravelledDistance" - // FieldPowertrainType Defines the powertrain type of the vehicle. - FieldPowertrainType = "powertrainType" - // FieldSpeed Vehicle speed. - FieldSpeed = "speed" - // FieldVehicleIdentificationBrand Vehicle brand or manufacturer. - FieldVehicleIdentificationBrand = "vehicleIdentificationBrand" - // FieldVehicleIdentificationModel Vehicle model. - FieldVehicleIdentificationModel = "vehicleIdentificationModel" - // FieldVehicleIdentificationYear Model year of the vehicle. - FieldVehicleIdentificationYear = "vehicleIdentificationYear" -)