From: zwj <645281962@qq.com> Date: Mon, 26 Jun 2023 03:39:10 +0000 (+0800) Subject: 修改tof中间件定义 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=687b75777b5b53dc59936abcbfbdf146ebb13639;p=yn%2Falarmmonitor.git 修改tof中间件定义 --- diff --git "a/TW8013\344\270\255\351\227\264\344\273\266\346\216\245\345\217\243\345\256\232\344\271\211.md" "b/TW8013\344\270\255\351\227\264\344\273\266\346\216\245\345\217\243\345\256\232\344\271\211.md" index 457d689..f69f3dc 100755 --- "a/TW8013\344\270\255\351\227\264\344\273\266\346\216\245\345\217\243\345\256\232\344\271\211.md" +++ "b/TW8013\344\270\255\351\227\264\344\273\266\346\216\245\345\217\243\345\256\232\344\271\211.md" @@ -50,7 +50,7 @@ #### 获取按键控制器 默认按键设备: #define BUTTON_DEVICE_PATH "/dev/input/event2" - + btn_ctrl_t mg_button_open( char * button_device_path ); 参数定义: button_device_path:键盘设备文件, 如/dev/input/event1 @@ -341,9 +341,9 @@ ### 3.2控制接口 #### 获取TOF控制器 - mg_tof_t * mg_tof_open( void ); + mg_tof_t * mg_tof_open(uint32_t distance); 参数定义: - 无 + 监测距离 返回值: 打开失败,返回 NULL; 成功,返回TOF控制器指针。 @@ -351,7 +351,7 @@ #### 关闭控制器 void mg_tof_close( mg_tof_t * tof_ctrl ); 参数定义: - tof_ctrl: 按键控制器 + tof_ctrl: tof控制器 返回值: 无 #### TOF 启用 @@ -371,7 +371,7 @@ -1:失败 #### TOF状态查询 - int32_t mg_tof_read( mg_tof_t *tof_ctrl, tof_info_t *info ); + int32_t mg_tof_read( mg_tof_t *tof_ctrl, tof_info_t *info ); 参数定义: tof_ctrl: TOF控制器 info: TOF状态,启用/停用,有人/无人, 距离 信息 @@ -379,11 +379,21 @@ 0: 成功 -1:失败 +#### TOF 动态修改监测距离 + + int32_t Distance_parameter_correction(mg_tof_t *tof_ctrl,uint32_t distance); + 参数定义: + btn_ctrl: 按键控制器 + distance 监测距离 + 返回值: + 0: 成功 + -1:失败 + #### TOF 事件注册 - int32_t mg_tof_event_register( mg_tof_t *tof_ctrl, uint32_t distance, tof_event_cb_t cb ); + + int32_t mg_tof_event_register(mg_tof_t *tof_ctrl,tof_event_cb_t cb); 参数定义: btn_ctrl: 按键控制器 - distance: 触发事件的距离 单位:毫米 cb: 事件回调函数 返回值: 0: 成功 @@ -413,7 +423,7 @@ int fd; //文件描述符 als_info_t data; //传感器完整状态信息 }; - + struct mg_als; typedef struct mg_als mg_als_t; @@ -533,10 +543,10 @@ #### 蜂鸣器控制描述符 struct mg_buzzer{ - char* dev_path[5]; //文件路径 - uint32_t enable; //蜂鸣器状态 - uint32_t time_ms; //时间 - buzzer_status_t buzzer_x_t[2]; + char* dev_path[5]; //文件路径 + uint32_t enable; //蜂鸣器状态 + uint32_t time_ms; //时间 + buzzer_status_t buzzer_x_t[2]; }; struct mg_buzzer; typedef struct mg_buzzer mg_buzzer_t;