1# Property Configuration Files 2 3Each JSON file in this folder is a property configuration file for reference 4Vehicle HAL. They contain VehiclePropConfig information along with initial 5value information. 6 7## JSON schema 8 9Each JSON file must be in a schema like the following example: 10(The comment starting with "//" is for documentation only and must be removed 11from the actual JSON file. The "comment" field is used for comment in the 12actual JSON file and will be ignored by the parser) 13 14``` 15{ 16 // (number) The version for the JSON schema. 17 "apiVersion": 1, 18 // (non-empty array of objects) The property configuration list. 19 // 20 // Each object is a configuration for one property. 21 "properties": [ 22 { 23 // (number/string) The ID for the property. 24 // This value is defined in a string value 25 // which represents a constant value, see the "JSON Number-type 26 // Field Values" section for detail. 27 "property": "VehicleProperty::INFO_FUEL_CAPACITY", 28 // (optional, number/string) The access mode for the property. 29 // If specified, this overwrite the default access mode specified in 30 // VehicleProperty.aidl. Must be specified for vendor properties. 31 "access": "VehiclePropertyAccess::READ", 32 // (optional, number/string) The change mode for the property. 33 // If specified, this overwrite the default change mode specified in 34 // VehicleProperty.aidl. Must be specified for vendor properties. 35 "changeMode": "VehiclePropertyChangeMode::STATIC", 36 // (optional, string) The config string. 37 "configString": "blahblah", 38 // (optional, array of number/string) The config array. 39 "configArray": [1, 2, "Constants::HVAC_ALL"], 40 // (optional, object) The default value for the property. 41 // If not specified, the property will be shown as unavailable 42 // until its value is set. 43 "defaultValue": { 44 // (optional, array of int number/string) Int values. 45 "int32Values": [1, 2, "Constants::HVAC_ALL"], 46 // (optional, array of int number/string) Long values. 47 "int64Values": [1, 2], 48 // (optional, array of float number/string) Float values. 49 "floatValues": [1.1, 2.2], 50 // (optional, string) String value. 51 "stringValue": "test" 52 }, 53 // (optional, number/string) The minimum sample rate in HZ. 54 // Only work for VehiclePropertyChangeMode::CONTINUOUS property. 55 // Must be specified for continuous property. 56 "minSampleRate": 1, 57 // (optional, number/string) The maximum sample rate in HZ. 58 // Only work for VehiclePropertyChangeMode::CONTINUOUS property. 59 // Must be specified for continuous property. 60 "maxSampleRate": 10, 61 // (optional, array of objects) The area configs. 62 "areas:" [ 63 { 64 // (number/string) The area ID. 65 "areaId": "Constants::DOOR_1_LEFT", 66 // (optional number/string) The minimum int value. 67 "minInt32Value": 1, 68 // (optional number/string) The maximum int value. 69 "maxInt32Value": 10, 70 // (optional number/string) The minimum long value. 71 "minInt64Value": 1, 72 // (optional number/string) The maximum long value. 73 "maxInt64Value": 10, 74 // (optional number/string) The minimum float value. 75 "minFloatValue": 1, 76 // (optional number/string) The maximum float value. 77 "maxFloatValue": 10, 78 // (optional object) The default value for this area. 79 // Uses the same format as the "defaultValue" field for 80 // property object. If specified, this overwrite the global 81 // defaultValue. 82 "defaultValue": { 83 "int32Values": [1, 2, "Constants::HVAC_ALL"], 84 "int64Values": [1, 2], 85 "floatValues": [1.1, 2.2], 86 "stringValue": "test" 87 } 88 } 89 ] 90 } 91 ] 92} 93``` 94 95## JSON Number-type Field Values 96 97For number type field values, they can either be defined as a numeric number, 98e.g., `{"minInt32Value": 1}` or be defined as a string which represents a 99defined constant value, e.g., 100`{"property": "VehicleProperty::INFO_FUEL_CAPACITY"}`. 101 102For constant values, they must be a string in the format of `XXX::XXX`, where 103the field before `::` is the constant type, and the field after `::` is the 104variable name. 105 106We support the following constant types: 107 108* VehiclePropertyAccess 109 110* VehiclePropertyChangeMode 111 112* VehicleGear 113 114* VehicleAreaWindow 115 116* VehicleOilLevel 117 118* VehicleUnit 119 120* VehicleSeatOccupancyState 121 122* VehicleHvacFanDirection 123 124* VehicleApPowerStateReport 125 126* VehicleTurnSignal 127 128* VehicleVendorPermission 129 130* EvsServiceType 131 132* EvsServiceState 133 134* EvConnectorType 135 136* VehicleProperty 137 138* GsrComplianceRequirementType 139 140* VehicleIgnitionState 141 142* FuelType 143 144* AutomaticEmergencyBrakingState 145 146* ForwardCollisionWarningState 147 148* BlindSpotWarningState 149 150* LaneDepartureWarningState 151 152* LaneKeepAssistState 153 154* LaneCenteringAssistCommand 155 156* LaneCenteringAssistState 157 158* ErrorState 159 160* WindshieldWipersState 161 162* WindshieldWipersSwitch 163 164* Constants 165 166Every constant type except "Constants" corresponds to a enum defined in Vehicle 167HAL interfac. E.g. "VehicleProperty" corresponds to the enums defined in 168"VehicleProperty.aidl". 169 170"Constants" type refers to the constant variables defined in the paresr. 171Specifically, the "CONSTANTS_BY_NAME" map defined in "JsonConfigLoader.cpp". 172