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

為了支持不同 OEM 車(chē)型信號(hào)矩陣定制化需求,HarmonyOS 提供了 OEM 擴(kuò)展接口,用于訪問(wèn)/設(shè)置/訂閱/去訂閱 OEM 自定義信號(hào)。
說(shuō)明
該功能針對(duì)不同的 OEM 車(chē)廠/車(chē)型,提供了統(tǒng)一的 OEM 擴(kuò)展接口。
接口說(shuō)明
目前 OEM 擴(kuò)展接口提供的功能有如下表所示:
| 接口名 | 描述 |
|---|---|
| getVehicleSignal() | 獲取 OEM 自定義信號(hào)實(shí)時(shí)取值。 |
| getVehicleSignalMultiAreas() | 獲取指定 OEM 自定義信號(hào)的多區(qū)域值。 |
| setVehicleActuator() | 設(shè)置 OEM 自定義執(zhí)行器參數(shù)值。 |
| subscribeVehicleSignal() | 訂閱指定的 OEM 自定義信號(hào)。 |
| unsubscribeVehicleSignal() | 取消訂閱指定的 OEM 自定義信號(hào)。 |
| unsubscribeVehicleSignalAll() | 取消訂閱全部的 OEM 自定義信號(hào)。 |
開(kāi)發(fā)步驟
根據(jù)不同管理入口類(lèi),調(diào)對(duì)應(yīng)接口。
// 設(shè)置輔助輸入信號(hà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));
} 網(wǎng)頁(yè)題目:創(chuàng)新互聯(lián)鴻蒙OS教程:鴻蒙OS OEM擴(kuò)展接口
本文來(lái)源:http://www.dlmjj.cn/article/djpeegi.html


咨詢(xún)
建站咨詢(xún)
