当前位置: 首页 > wzjs >正文

网站建设与营销wordpress精致主题

网站建设与营销,wordpress精致主题,二次开发简单吗,中国万网域名登录本文介绍ard11的 vhal 属性配置方法,后面vhal升级为aidl后,配置位置在其他位置,将另行介绍。 1. vhal属性配置文件DefaultConfig.h的位置 android11/hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h …

本文介绍ard11的 vhal 属性配置方法,后面vhal升级为aidl后,配置位置在其他位置,将另行介绍。

1. vhal属性配置文件DefaultConfig.h的位置

android11/hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h

195  const ConfigDeclaration kVehicleProperties[]{
196          {.config =
197                   {
198                           .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
199                           .access = VehiclePropertyAccess::READ,
200                           .changeMode = VehiclePropertyChangeMode::STATIC,
201                   },
202           .initialValue = {.floatValues = {15000.0f}}},
203 
.......

1.1 属性解析需要注意的数据结构

1.1.1 struct ConfigDeclaration

android11/hardware/interfaces/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
 

struct ConfigDeclaration {VehiclePropConfig config;//注意这里/* This value will be used as an initial value for the property. If this field is specified for* property that supports multiple areas then it will be used for all areas unless particular* area is overridden in initialAreaValue field. */VehiclePropValue::RawValue initialValue;///* Use initialAreaValues if it is necessary to specify different values per each area. */std::map<int32_t, VehiclePropValue::RawValue> initialAreaValues;
};

1.1.1.1 struct VehiclePropConfig

android11/hardware/interfaces/automotive/vehicle/2.0/types.hal

3512 struct VehiclePropConfig {
3513     /** Property identifier */
3514     int32_t prop;
3515
3516     /**
3517      * Defines if the property is read or write or both.
3518      */
3519     VehiclePropertyAccess access;
3520
3521     /**
3522      * Defines the change mode of the property.
3523      */
3524     VehiclePropertyChangeMode changeMode;
3525
3526     /**
3527      * Contains per-area configuration.
3528      */
3529     vec<VehicleAreaConfig> areaConfigs;
3530
3531     /** Contains additional configuration parameters */
3532     vec<int32_t> configArray;
3533
3534     /**
3535      * Some properties may require additional information passed over this
3536      * string. Most properties do not need to set this.
3537      */
3538     string configString;
3539
3540     /**
3541      * Min sample rate in Hz.
3542      * Must be defined for VehiclePropertyChangeMode::CONTINUOUS
3543      */
3544     float minSampleRate;
3545
3546     /**
3547      * Must be defined for VehiclePropertyChangeMode::CONTINUOUS
3548      * Max sample rate in Hz.
3549      */
3550     float maxSampleRate;
3551 };

1.1.1.2 struct VehiclePropValue

android11/hardware/interfaces/automotive/vehicle/2.0/types.hal

3553 /**
3554  * Encapsulates the property name and the associated value. It
3555  * is used across various API calls to set values, get values or to register for
3556  * events.
3557  */
3558 struct VehiclePropValue {
3559     /** Time is elapsed nanoseconds since boot */
3560     int64_t timestamp;
3561
3562     /**
3563      * Area type(s) for non-global property it must be one of the value from
3564      * VehicleArea* enums or 0 for global properties.
3565      */
3566     int32_t areaId;
3567
3568     /** Property identifier */
3569     int32_t prop;
3570
3571     /** Status of the property */
3572     VehiclePropertyStatus status;
3573
3574     /**
3575      * Contains value for a single property. Depending on property data type of
3576      * this property (VehiclePropetyType) one field of this structure must be filled in.
3577      */
3578     struct RawValue {
3579         /**
3580          * This is used for properties of types VehiclePropertyType#INT
3581          * and VehiclePropertyType#INT_VEC
3582          */
3583         vec<int32_t> int32Values;
3584
3585         /**
3586          * This is used for properties of types VehiclePropertyType#FLOAT
3587          * and VehiclePropertyType#FLOAT_VEC
3588          */
3589         vec<float> floatValues;
3590
3591         /** This is used for properties of type VehiclePropertyType#INT64 */
3592         vec<int64_t> int64Values;
3593
3594         /** This is used for properties of type VehiclePropertyType#BYTES */
3595         vec<uint8_t> bytes;
3596
3597         /** This is used for properties of type VehiclePropertyType#STRING */
3598         string stringValue;
3599     };
3600
3601     RawValue value;
3602 };

2. vhal常见的属性id

(1) 0x15600503--358614275(HVAC_TEMPERATURE_SET)

android11/packages/services/Car/car-lib/src/android/car/VehiclePropertyIds.java

359      @RequiresPermission(Car.PERMISSION_CONTROL_CAR_CLIMATE)
360      public static final int HVAC_TEMPERATURE_SET = 358614275;

android11/packages/services/Car/tests/vehiclehal_test/Android.mk

android11/packages/services/Car/tests/vehiclehal_test/assets/car_hvac_test.json

8     {
9         "timestamp": 1526063904959113984,
10         "areaId": 49,
11         "value": 28,
12         "prop": 358614275
13     },

hvac的控制代码

android11/frameworks/base/packages/CarSystemUI/src/com/android/systemui/car/hvac/

android11/frameworks/base/packages/CarSystemUI/src/com/android/systemui/car/hvac/HvacController.java

60      /**
61       * Callback for getting changes from {@link CarHvacManager} and setting the UI elements to
62       * match.
63       */
64      private final CarHvacEventCallback mHardwareCallback = new CarHvacEventCallback() {
65          @Override
66          public void onChangeEvent(final CarPropertyValue val) {
67              try {
68                  int areaId = val.getAreaId();
69                  int propertyId = val.getPropertyId();
70                  List<TemperatureView> temperatureViews = mTempComponents.get(
71                          new HvacKey(propertyId, areaId));
72                  if (temperatureViews != null && !temperatureViews.isEmpty()) {
73                      float value = (float) val.getValue();
74                      if (DEBUG) {
75                          Log.d(TAG, "onChangeEvent: " + areaId + ":" + propertyId + ":" + value);
76                      }
77                      for (TemperatureView tempView : temperatureViews) {
78                          tempView.setTemp(value);
79                      }
80                  } // else the data is not of interest
81              } catch (Exception e) {
82                  // catch all so we don't take down the sysui if a new data type is
83                  // introduced.
84                  Log.e(TAG, "Failed handling hvac change event", e);
85              }
86          }
87 
88          @Override
89          public void onErrorEvent(final int propertyId, final int zone) {
90              Log.d(TAG, "HVAC error event, propertyId: " + propertyId
91                      + " zone: " + zone);
92          }
93      };
94 
95      private final CarServiceProvider.CarServiceOnConnectedListener mCarServiceLifecycleListener =
96              car -> {
97                  try {
98                      mHvacManager = (CarHvacManager) car.getCarManager(Car.HVAC_SERVICE);
99                      mHvacManager.registerCallback(mHardwareCallback);
100                      initComponents();
101                  } catch (Exception e) {
102                      Log.e(TAG, "Failed to correctly connect to HVAC", e);
103                  }
104              };

(2) 0x11410a00--289475072(AP_POWER_STATE_REQ )

553      /**
554       * Property to control power state of application processor
555       *
556       * It is assumed that AP's power state is controller by separate power
557       * controller.
558       * The property is protected by the signature permission: android.car.permission.CAR_POWER.
559       */
560      @RequiresPermission(Car.PERMISSION_CAR_POWER)
561      public static final int AP_POWER_STATE_REQ = 289475072;
562      /**
563       * Property to report power state of application processor
564       *
565       * It is assumed that AP's power state is controller by separate power
566       * controller.
567       * The property is protected by the signature permission: android.car.permission.CAR_POWER.
568       */
569      @RequiresPermission(Car.PERMISSION_CAR_POWER)
570      public static final int AP_POWER_STATE_REPORT = 289475073;

(3) 0x11400a03--289409539(DISPLAY_BRIGHTNESS )

581      /**
582       * Property to represent brightness of the display. Some cars have single
583       * control for the brightness of all displays and this property is to share
584       * change in that control.
585       * The property is protected by the signature permission: android.car.permission.CAR_POWER.
586       */
587      @RequiresPermission(Car.PERMISSION_CAR_POWER)
588      public static final int DISPLAY_BRIGHTNESS = 289409539;

 

 


文章转载自:

http://lilEN8rx.gqksd.cn
http://5g8ho5op.gqksd.cn
http://J7w6WaK4.gqksd.cn
http://eSs0KZXq.gqksd.cn
http://WJnjDMbf.gqksd.cn
http://YeuveRHt.gqksd.cn
http://Ed9XgNpS.gqksd.cn
http://xWoPr7rE.gqksd.cn
http://2NvwUvtK.gqksd.cn
http://oblac5OH.gqksd.cn
http://eQOCvoPC.gqksd.cn
http://Z5TsZSv7.gqksd.cn
http://UFygvbS9.gqksd.cn
http://nTNSYYZM.gqksd.cn
http://iS47lvQ8.gqksd.cn
http://jpwG2mt6.gqksd.cn
http://6RZMEHu1.gqksd.cn
http://yDh8Efn6.gqksd.cn
http://7L3MWQ4c.gqksd.cn
http://4RqUnYRb.gqksd.cn
http://oMHqqfWi.gqksd.cn
http://3NFdFQyj.gqksd.cn
http://xx8uhXYY.gqksd.cn
http://esNlpnLY.gqksd.cn
http://a3VoAOXg.gqksd.cn
http://c2Y4kCeK.gqksd.cn
http://M0IawVoQ.gqksd.cn
http://TBwEEAuY.gqksd.cn
http://OGvOHx9G.gqksd.cn
http://PPpiXWXM.gqksd.cn
http://www.dtcms.com/wzjs/626058.html

相关文章:

  • 影视传媒公司网站模板安装免费下载app
  • 网站规划建设与管理维护教程温州网站设计服务商
  • 响应式网站是什么意思申请注册商标需要多少钱
  • 百度 医疗网站建设业之峰
  • 台山住房和城乡建设 网站用python做网页
  • 哈尔滨住房和城乡建设局网站首页广州比较好的网站建设
  • 大型网站团队人数企业信息查询系统官网湖北
  • 宜城营销型网站套餐logo在线制作免费生成器无水印
  • 英语网站开发wordpress 免费摄影主题
  • 兰州seo网站排名wordpress 背景颜色
  • 做网站数据库有哪些石家庄互联网公司有哪些
  • 1微信网站怎么建设wordpress 文章点赞功能
  • qq是哪年开始有的南昌网站排名优化报
  • 免费建站网站行业门户网站案例分析
  • 云建站优势做的网站每年都要收费吗
  • 网站搭建需要服务器吗开发网站手机版
  • 大连电子学校网站建设免费的云电脑
  • 牡丹江0453免费信息网站前端开发包括哪些内容
  • 免费公司介绍网站怎么做济南高新区网站建设公司
  • 手机网站前四川煤矿基本建设工程公司网站
  • 网站建设app开发 微信小程序 网站开发 自动脚本如何查询百度搜索关键词排名
  • 书城网站建设项目定义seo内部优化方式包括
  • 设计个网站需要怎么做武清网站开发tjniu
  • 重庆市建设领域农民工工资专户网站上海建设学院网站
  • 网站建设创业规划书广州网站制作公司多少钱
  • 新网站制作怎么样江苏建设通网站
  • 吉林省住房和城乡建设厅网站6机械加工制造网
  • 沧县网站建设泰安专业网站建设
  • 网站开发的阶段流程图给网站做数据分析
  • ps手机网站制作山西长治一企业