新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS OEM擴展接口
場景介紹

為了支持不同 OEM 車型信號矩陣定制化需求,HarmonyOS 提供了 OEM 擴展接口,用于訪問/設置/訂閱/去訂閱 OEM 自定義信號。
說明
該功能針對不同的 OEM 車廠/車型,提供了統(tǒng)一的 OEM 擴展接口。
接口說明
目前 OEM 擴展接口提供的功能有如下表所示:
| 接口名 | 描述 |
|---|---|
| getVehicleSignal() | 獲取 OEM 自定義信號實時取值。 |
| getVehicleSignalMultiAreas() | 獲取指定 OEM 自定義信號的多區(qū)域值。 |
| setVehicleActuator() | 設置 OEM 自定義執(zhí)行器參數(shù)值。 |
| subscribeVehicleSignal() | 訂閱指定的 OEM 自定義信號。 |
| unsubscribeVehicleSignal() | 取消訂閱指定的 OEM 自定義信號。 |
| unsubscribeVehicleSignalAll() | 取消訂閱全部的 OEM 自定義信號。 |
開發(fā)步驟
根據(jù)不同管理入口類,調(diào)對應接口。
// 設置輔助輸入信號值
String propId = "OEM_Status_DTCCountTest";
int zoneId = VehicleZone.ZONE_NONE;
Boolean value = true;
VehicleActuatorCallback callback = new VehicleActuatorCallback() {
@Override
public void onErrorActuator(String propId, int zoneId, int outResult) {
}
};
bool result = true;
try {
VehicleVendorExtensionManager.setVehicleActuator(propId, zoneId, callback, value);
} catch(RemoteException | IllegalArgumentException e) {
result = false;
}
if(!result) {
System.out.println(String.format("Set transmiss performance mode error: %d", result));
} 當前題目:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS OEM擴展接口
網(wǎng)頁鏈接:http://www.5511xx.com/article/djpeegi.html


咨詢
建站咨詢
