freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

最新基于android智能家居詳細(xì)設(shè)計經(jīng)典-資料下載頁

2025-06-28 04:25本頁面
  

【正文】 。 //裝載庫 } public MyUartService() { _init()。 //注冊本地方法,打開串口并初始化 } /* * uart native methods. */ public String UartDataUpdate() { String s = _uart_data_update()。 return s。v }//更新采集的數(shù)據(jù) public int UartSendCmd(int n, int c) { _uart_send_cmd(n, c)。 return 0。 } //發(fā)送命令控制M0 板 private static native boolean _init()。 /聲明jni 庫可以提供的方法 private static native String _uart_data_update()。 private static native int _uart_send_cmd(int n, int c)。 3. uart_stub\include\struct uart_module_t { struct hw_module_t mon。 }。//HAL 規(guī)定不能直接使用hw_module_t結(jié)構(gòu),因此需要做這么一個繼承。 struct uart_control_device_t { //自定義的一個針對 Uart控制的結(jié)構(gòu),包含hw_device_t和支持的API 操作 struct hw_device_t mon。 /* attributes */ 基于 Android 的智能家居第 24 頁 共 51 頁 /* supporting control APIs go here */ int (*uart_read_hal)(struct uart_control_device_t *dev, char *buf, int count)。 int (*uart_write_hal)(struct uart_control_device_t *dev, const char *cmd)。 }。 define UART_HARDWARE_MODULE_ID uart //定義一個MODULE_ID,HAL層可以根據(jù)這個ID找到我們這個HAL stub 4. define LOG_TAG MyUartService include utils/ include include include include include include ../../uart_stub/include/ static uart_control_device_t *sUartDevice = 0。 static uart_module_t* sUartModule=0。 JNINativeMethod是 jni層注冊的方法,F(xiàn)ramework 層可以使用這些方法 *_init 、uart_read、uart_write 是在Framework中調(diào)用的方法名稱,函數(shù)的類型及返回值如下: *()Z無參數(shù) 返回值為bool型 * ()Ljava/lang/String。 無參數(shù) 返回值為String型 * (II)I 參數(shù)為 2個int 型 返回值為int型 static const JNINativeMethod gMethods[] = { {_init, ()Z, (void*)uart_init}, { _uart_data_update, ()Ljava/lang/String。, (void*)uart_read }, { _uart_send_cmd, (II)I, (void*)uart_write }, }。 static int registerMethods(JNIEnv* env) { static const char* const kClassName = //smarthome/uart/MyUartService。 //注意:必須和Framework層的service類名相 jclass clazz。 /* look up the class */ clazz = envFindClass(kClassName)。 //查找被注冊的類 if (clazz == NULL) {
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1