5.5. 视频接入 - Camera
5.5.1. 模块描述
Camera 接入
X5 支持 MIPI CSI 视频
输入 或者 通过 解串器( deserial )转换 为 MIPI CSI 信号 接入 两种 方式。 这
两种 方式 使用 时 需要 通过 attach 和 detach 接口 与 VIN Node 绑定 和解 绑,从而 初始化 和 去 初始化 sensor 。 MIPI CSI 直接
接入 时 需要 通过 hbn_camera_attach_to_vin和hbn_camera_detach_from_vin接口将 Camera 与 VIN Node 绑定 和解 绑。 解串器(deserial)接入
使用 时 需要 通过 hbn_deserial_attach_to_vin和hbn_deserial_detach_from_vin接口将 deserial 与 VIN Node 绑定 和解 绑。
关于 VIN Node的
描述,参考视频 接入- VIN 模块 。描述 章节
5.5.1.1. 硬件框图
主要
MIPI D-PHY (RX):作为 MIPI 协议
接收端 的 物理层,支持 高速 串行 数据传输。 MIPI HOST 控制器:实现
了 主机 端的CSI-2协议,负责 从D-PHY接收数据 并 进行 协议 解析。X5 包含4个 独立 的HOST实例。 IPI (Image Pixel Interface):图像
像素 接口,CSI HOST控制器 解析 出 的 有效 图像 数据 通过 此 并行接口 输出 给SIF (Sensor Interface)模块 进行 后续 处理。 IDI (Image Data Interface):图像
数据 接口。

关键
芯片
最 多 支持 4路 独立 的MIPI HOST (CSI0~CSI3),每个 独立 支持 最 多 2条 Lane MIPI HOST与IPI分配:
HOST0 / HOST2:每个
最 多 可 绑定 4路 IPI。 HOST1 / HOST3:每个
最 多 可 绑定 2路 IPI。
通过DMUX启用Lane拼接
功能 时,HOST0和HOST2可 分别 配置 为 使用 4条 Lane,以 获得 更 高 的 单路 带宽。注意:在 此 配置 下,HOST1和HOST3将 无法 接收数据。 MIPI模块
通过 12路 IPI接口 将 数据 接入SIF。每 一路IPI可 绑定 一个 独立 的 虚拟 通道,结合SerDes使用,理论 上 最 多 可 接入 12路 Camera
5.5.1.2. MIPI 基础规格
支持 MIPI CSI 视频
输入: 兼容 MIPI 联盟
接口 规范 v2.1 支持
最 多 8 条 数据通道,每条 数据通道 最高 支持 2.5Gbps 数据 速率 支持 MIPI-HS 和 MIPI-LP 模式
硬件资源:4 个 2-lane PHY + 4 个 CSI-2 控制器
最
多 支持 12 个 虚拟 通道 支持
最高 分辨率 5472 x 3076 像素@30fps 视频 输入 支持
多种 视频格式: RAW 8-/10-/12-/14-/16-bit 格式
YUV 422 格式(8-/10-bit)
支持
视频 输入 到 输出 直通 模式: 支持 MIPI CSI RX 到 MIPI CSI TX 的
直通(back-to-back)模式
5.5.2. 参考示例
Camera 接入
部分 示例 代码 可以 参考 sample_vin 章节
5.5.3. API 参考
| API 接口 | 接口 |
|---|---|
| hbn_camera_create | 根据 camera_config_t 传入 |
| hbn_camera_destroy | 根据 camera handle 销毁 |
| hbn_camera_attach_to_vin | 通过 camera 和 vin node 的 handle,将 |
| hbn_camera_detach_from_vin | 将 camera 与 vin node 解绑,并 |
| hbn_camera_attach_to_deserial | 通过 camera 和 deserial 的 handle,将 |
| hbn_camera_detach_from_deserial | 将 camera 与 deserial 解绑,并 |
| hbn_camera_start | 配置 camera 寄存器,开始 |
| hbn_camera_stop | 配置 camera 寄存器,关流。 |
| hbn_camera_reset | 通过 |
| hbn_camera_change_fps | 动态 |
| hbn_camera_read_register | 读取 camera 寄存器 |
| hbn_camera_get_handle | 通过 vin node handle 或者 camera port index,获取 |
| hbn_camera_init_cfg | 通过 |
| hbn_deserial_create | 根据 |
| hbn_deserial_destroy | 根据 deserial handle 销毁 |
| hbn_deserial_attach_to_vin | 将 deserial 与 vin node 绑定。 |
| hbn_deserial_detach_from_vin | 将 deserial 与 vin node 解绑。 |
| hbn_txser_create | 根据 |
| hbn_txser_destroy | 根据 tx serial handle 销毁 |
| hbn_txser_attach_to_vin | 将 tx serial 与 vin node 绑定。 |
| hbn_txser_detach_from_vin | 将 tx serial 与 vin node 解绑。 |
| hbn_camera_switch_scence | 动态 |
5.5.3.1. hbn_camera_create
【函数声明】
int32_t hbn_camera_create(camera_config_t *cam_config, camera_handle_t *cam_fd)
【参数描述】
[IN] camera_config_t *cam_config:要
配置 的 camera 对应 的 参数 结构 体 指针; [OUT] camera_handle_t *cam_fd:根据
配置 参数 返回 的 fd,作为 camera 的 操作 handle;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
根据 camera_config_t 传入
【注意事项】
API 里面
会 对 sensor lib 进行 检查,如果 sensor 驱动 代码 不 符合 HBN 框架 规范,则 会 检查 报错。 API 里面
会 对 cam_config 进行 检查,如果 配置 不 符合 IP 硬件 能力,则 会 检查 报错。
5.5.3.2. hbn_camera_destroy
【函数声明】
int32_t hbn_camera_destroy(camera_handle_t cam_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera 的
操作 handle,由 hbn_camera_create 所 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
根据 camera handle 销毁
【注意事项】
hbn_camera_destroy 需要
和 hbn_camera_create 成 对 使用。 hbn_camera_destroy 会
释放 sensor lib, 执行 完成 后,sensor 将 无法 正常 访问。 hbn_camera_destroy 内部
会 调用 hbn_camera_detach_from_vin,会 触发 sensor 停流 操作,所以 hbn_camera_destroy 需要 在 hbn_vflow_destroy 之前 调用。
5.5.3.3. hbn_camera_attach_to_vin
【函数声明】
int32_t hbn_camera_attach_to_vin(camera_handle_t cam_fd, vpf_handle_t vin_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
[IN] vpf_handle_t vin_fd:由 hbn_vnode_open 接口
创建 的 vin node handle。
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
通过 camera 和 vin node 的 handle,将
【注意事项】
同一个 camera,不能
重复 执行 hbn_camera_attach_to_vin,否则 会 报 attach error 错误。
5.5.3.4. hbn_camera_detach_from_vin
【函数声明】
int32_t hbn_camera_detach_from_vin(camera_handle_t cam_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
将 camera 与 vin node 解绑,并
【注意事项】
hbn_camera_detach_from_vin 需要
和 hbn_camera_attach_to_vin 成 对 使用。 hbn_camera_destroy 内部
调用 了 hbn_camera_detach_from_vin,所以 调用 了 hbn_camera_destroy 接口,hbn_camera_detach_from_vin 可以 不再 调用。
5.5.3.5. hbn_camera_attach_to_deserial
【函数声明】
int32_t hbn_camera_attach_to_deserial(camera_handle_t cam_fd, deserial_handle_t des_fd, camera_des_link_t link)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
[IN] deserial_handle_t des_fd:deserial handle,由 hbn_deserial_create 创建;
[IN] camera_des_link_t link:camera 与 deserial 的 link 方式,根据 camera 接到
哪个 link 决定。
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
通过 camera 和 deserial 的 handle,将
【注意事项】
硬件
上 有 解串器 时 才 需要 调用 该 接口。 执行 hbn_camera_attach_to_deserial 后,就
不 需要 再 执行 hbn_camera_attach_to_vin,而是 由 deserial 绑定 到 vin node。
5.5.3.6. hbn_camera_detach_from_deserial
【函数声明】
int32_t hbn_camera_detach_from_deserial(camera_handle_t cam_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
将 camera 与 deserial 解绑,并
【注意事项】
hbn_camera_detach_from_deserial 需要
和 hbn_camera_attach_to_deserial 成 对 使用。
5.5.3.7. hbn_camera_start
【函数声明】
int32_t hbn_camera_start(camera_handle_t cam_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
配置 camera 寄存器,开始
【注意事项】
camera handle attach 到 vflow 后,该
5.5.3.8. hbn_camera_stop
【函数声明】
int32_t hbn_camera_stop(camera_handle_t cam_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
配置 camera 寄存器,关流。
【注意事项】
需要
和 hbn_camera_start 成 对 使用。
5.5.3.9. hbn_camera_reset
【函数声明】
int32_t hbn_camera_reset(camera_handle_t cam_fd)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
通过
【注意事项】
如果
在 camera attach vin 之前 调用 该 接口,则 会 通过 camera_attach_to_vin 接口 来 给 sensor 初始化,达到 reset 效果。如果 是 在 camera attach vin 之后 调用 该 接口,则 会 调用 sensor stop,sensor deinit,然后 初始化 再 重新 init sensor,start sensor。
5.5.3.10. hbn_camera_change_fps
【函数声明】
int32_t hbn_camera_change_fps(camera_handle_t cam_fd, int32_t fps)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
[IN] int32_t fps:sensor 出图
帧 率;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
动态
【注意事项】
该
功能 需要 在 sensor lib 库中 实现 相应 的 回调 函数 dynamic_switch_fps。
5.5.3.11. hbn_camera_read_register
【函数声明】
int32_t hbn_camera_read_register(camera_handle_t cam_fd, camera_reg_type_t type, uint32_t reg_addr)
【参数描述】
[IN] camera_handle_t cam_fd:camera handle,由 hbn_camera_create 创建;
[IN] camera_reg_type_t type:读取 sensor 寄存器
的 类型; [IN] uint32_t reg_addr:寄存器
地址;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
读取 camera 寄存器
【注意事项】
无
5.5.3.12. hbn_camera_get_handle
【函数声明】
camera_handle_t hbn_camera_get_handle(vpf_handle_t vin_fd, int32_t camera_index)
【参数描述】
[IN] vpf_handle_t vin_fd:vin node 的 fd;
[IN] int32_t camera_index:camera 的 port index;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
通过 vin node handle 或者 camera port index,获取
【注意事项】
无
5.5.3.13. hbn_camera_init_cfg
【函数声明】
int32_t hbn_camera_init_cfg(const char *cfg_file)
【参数描述】
[IN] const char *cfg_file:camera 配置文件
路径(json);
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
通过
【注意事项】
该 API 是
通过 解析 json 方式 来 创建 camera,与 sample 中非 json 方式 接口 不同,详情请 咨询 FAE。
5.5.3.14. hbn_deserial_create
【函数声明】
int32_t hbn_deserial_create(deserial_config_t *des_config, deserial_handle_t *des_fd)
【参数描述】
[IN] deserial_config_t *des_config:deserial 配置
参数 结构 体 指针; [OUT] deserial_handle_t *des_fd:根据
配置 创建 的 deserial handle;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
根据
【注意事项】
硬件
上 有 解串器 时 才 需要 调用 该 接口。 该
接口 会 对 deserial 的 配置 进行 检查,如果 配置 超出 一定 范围,则 会 报错。 该
接口 会 对 deserial lib 进行 检查,如果 不 符合 HBN 架构 规范,则 会 报错。
5.5.3.15. hbn_deserial_destroy
【函数声明】
int32_t hbn_deserial_destroy(deserial_handle_t des_fd)
【参数描述】
[IN] deserial_handle_t des_fd:deserial handle,由 hbn_deserial_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
根据 deserial handle 销毁
【注意事项】
hbn_deserial_destroy 需要
和 hbn_deserial_create 成 对 使用。
5.5.3.16. hbn_deserial_attach_to_vin
【函数声明】
int32_t hbn_deserial_attach_to_vin(deserial_handle_t des_fd, camera_des_link_t link, vpf_handle_t vin_fd)
【参数描述】
[IN] deserial_handle_t des_fd:deserial handle,由 hbn_deserial_create 创建;
[IN] camera_des_link_t link:deserial 的 link 编号;
[IN] vpf_handle_t vin_fd:要
绑定 到 的 vin node handle;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
将 deserial 与 vin node 绑定。
【注意事项】
硬件
上 带有 解串器,则 camera 与 deserial 进行 绑定,deserial 与 vin node 绑定。
5.5.3.17. hbn_deserial_detach_from_vin
【函数声明】
int32_t hbn_deserial_detach_from_vin(deserial_handle_t des_fd, camera_des_link_t link)
【参数描述】
[IN] deserial_handle_t des_fd:deserial handle,由 hbn_deserial_create 创建;
[IN] camera_des_link_t link:deserial 的 link 编号;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
将 deserial 与 vin node 解绑。
【注意事项】
hbn_deserial_detach_from_vin 与 hbn_deserial_attach_to_vin 需要
成 对 使用。
5.5.3.18. hbn_txser_create
【函数声明】
int32_t hbn_txser_create(txser_config_t *txs_config, txser_handle_t *txs_fd)
【参数描述】
[IN] txser_config_t *txs_config:tx serial 配置
参数 结构 体 指针; [OUT] txser_handle_t *txs_fd:根据
配置 创建 的 tx serial handle;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
根据
【注意事项】
硬件
上 有 串行 器时 才 需要 调用 该 接口。 该
接口 会 对 txser 的 配置 进行 检查,如果 配置 超出 一定 范围,则 会 报错。 该
接口 会 对 txser lib 进行 检查,如果 不 符合 HBN 架构 规范,则 会 报错。
5.5.3.19. hbn_txser_destroy
【函数声明】
int32_t hbn_txser_destroy(txser_handle_t txs_fd)
【参数描述】
[IN] txser_handle_t txs_fd:tx serial handle,由 hbn_txser_create 创建;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
根据 tx serial handle 销毁
【注意事项】
硬件
上 有 串行 器时 才 需要 调用 该 接口。 hbn_txser_destroy 与 hbn_txser_create 需要
成 对 使用。
5.5.3.20. hbn_txser_attach_to_vin
【函数声明】
int32_t hbn_txser_attach_to_vin(txser_handle_t txs_fd, camera_txs_csi_t csi, vpf_handle_t vin_fd)
【参数描述】
[IN] txser_handle_t txs_fd:tx serialhandle,由 hbn_txser_create 创建;
[IN] camera_txs_csi_t csi:tx csi index;
[IN] vpf_handle_t vin_fd:要
绑定 到 的 vin node handle;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
将 tx serial 与 vin node 绑定。
【注意事项】
硬件
上 有 串行 器时 才 需要 调用 该 接口。 该
接口 会 对 txser 硬件 进行 初始化。 硬件
上 带有 串行 器,则 camera 与 txser 进行 绑定,txser 与 vin node 绑定。
5.5.3.21. hbn_txser_detach_from_vin
【函数声明】
int32_t hbn_txser_detach_from_vin(txser_handle_t txs_fd, camera_txs_csi_t csi)
【参数描述】
[IN] txser_handle_t txs_fd:tx serial handle,由 hbn_txser_create 创建;
[IN] camera_txs_csi_t csi:tx csi index;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
将 tx serial 与 vin node 解绑。
【注意事项】
hbn_txser_detach_from_vin 需要
与 hbn_txser_attach_to_vin 成 对 使用。
5.5.3.22. hbn_camera_switch_scence
【函数声明】
int32_t hbn_camera_switch_scence(int64_t vflow_fd, int64_t isp_vnode_fd, const char *cname)
【参数描述】
[IN] int64_t vflow_fd:camera flow handle,由 hbn_vflow_create 创建;
[IN] int64_t isp_vnode_fd:isp node handle,由 hbn_vflow_get_vnode_handle 获取;
[IN] const char *cname:isp tuning json 字符串,默认
从/usr/hobot/lib/sensor 目录 找 指定 的 tuning 文件,如果 tuning 文件 不 在/usr/hobot/lib/sensor 目录,需要 指定 tuning 文件 的 绝对路径;
【返回值】
成功:RET_OK 0
失败:异常
为 负值 错误码
【功能描述】
动态
【注意事项】
该 API 会先 stop vflow,然后
进行 切换 isp tuning 文件,最后 再 重新 start vflow。
5.5.4. 数据结构
Camera 参数
typedef struct camera_config_s
| 名称 | 类型 | 最小值 | 最大值 | 默认值 | 含义 | 必选 |
|---|---|---|---|---|---|---|
| name[CAMERA_MODULE_NAME_LEN] | char | - | CAMERA_MODULE_NAME_LEN(108) | - | camera 模组 |
是 |
| addr | uint32_t | 0x00 | 0x7f | 0x00 | sensor 设备 |
是 |
| isp_addr | uint32_t | 0x00 | 0x7f | 0x00 | isp 设备 |
否 |
| eeprom_addr | uint32_t | 0x00 | 0x7f | 0x00 | eeprom 设备 |
否 |
| serial_addr | uint32_t | 0x00 | 0x7f | 0x00 | serdes 设备 |
否 |
| sensor_mode | uint32_t | 1 | 6 | 1 | sensor 工作 1:NORMAL_M,linear 模式; 2:DOL2_M,hdr2帧 3:DOL3_M,hdr3帧 4:DOL4_M,hdr4帧 5:PWL_M,hdr 模式 sensor 内部 6:SLAVE_M,slave 模式, 需要 |
是 |
| sensor_clk | uint32_t | - | - | 0x00 | sensor 一些 clk 时钟 |
否 |
| gpio_enable_bit | uint32_t | 0 | 0xFFFFFFFF | 0 | 是否 如:使用 gpio 来 注意:需要 0:不 非0:使用 gpio 来 |
是 |
| gpio_level_bit | uint32_t | 0 | 1 | 0 | 如果 0: 先 1: 先 比如:0x05 = 101,从 bit0 到 bit2 分别 需要 |
是 |
| bus_select | uint32_t | 0 | 6 | 0 | sensor i2c number 选择,一般 dts 中 |
否 |
| bus_timeout | uint32_t | 0 | - | 0 | I2C 的 timeout 时间 |
否 |
| fps | uint32_t | 0 | 120 | 0 | sensor 帧 |
是 |
| width | uint32_t | 0 | 8192 | 0 | sensor 出图 |
是 |
| height | uint32_t | 0 | 4096 | 0 | sensor 出图 |
是 |
| format | uint32_t | - | - | - | sensor 数据类型,常见 RAW8: 0x2A; RAW10: 0x2B; RAW12: 0x2C; YUV422 8-bit: 0x1E |
是 |
| flags | uint32_t | 0 | - | 0 | 可 |
否 |
| extra_mode | uint32_t | 0 | - | 0 | 各 sensor 库 |
是 |
| config_index | uint32_t | 0 | - | 0 | 各 sensor 库 |
是 |
| ts_compensate | uint32_t | 0 | - | 0 | 预留 |
否 |
| mipi_cfg | mipi_config_t | - | - | - | MIPI 配置, 置 |
是 |
| calib_lname | char | - | - | - | sensor 效果 比如: calib_lname="/userdata/test_tuning.json"。 目前 |
是 |
| sensor_param | char | - | - | - | sensor 自 |
否 |
| iparam_mode | uint32_t | - | - | - | 预留 |
否 |
| end_flag | uint32_t | - | - | - | 预留 |
否 |
typedef struct deserial_config_s
| 名称 | 类型 | 最小值 | 最大值 | 默认值 | 含义 | 必选 |
|---|---|---|---|---|---|---|
| name | char[CAMERA_MODULE_NAME_LEN] | - | - | - | Deserial 的 |
是 |
| addr | uint32_t | 0 | - | - | Deserial 设备 |
是 |
| gpio_enable_bit | uint32_t | 0 | - | - | GPIO 操作 |
是 |
| gpio_level_bit | uint32_t | 0 | - | - | GPIO 工作 |
是 |
| gpio_mfp | uint8_t[CAMERA_DES_GPIO_MAX] | 0 | CAMERA_DES_GPIO_MAX | 0x0 | MFP 的 GPIO 功能 |
是 |
| bus_select | uint32_t | 0 | - | - | I2C 总线 |
是 |
| bus_timeout | uint32_t | 0 | - | - | I2C 超时 |
是 |
| lane_mode | uint32_t | 0 | - | - | PHY 配置 |
是 |
| lane_speed | uint32_t | 0 | - | - | PHY 配置 |
是 |
| link_map | uint32_t | 0 | - | - | Link 和 CSI/VC 的 |
是 |
| link_desp | char[CAMERA_DES_LINKMAX][CAMERA_DES_PORTDESP_LEN] | - | - | - | 各 Link 连接 |
是 |
| reset_delay | uint32_t | 0 | - | - | Reset 操作 |
是 |
| flags | uint32_t | 0 | - | - | 可 |
否 |
| poc_cfg | poc_config_t* | - | - | NULL | POC 配置 |
否 |
| mipi_cfg | mipi_config_t* | - | - | NULL | MIPI 配置 |
否 |
| deserial_param | char* | - | - | NULL | Deserial 自 |
否 |
| end_flag | uint32_t | 0 | 0xFFFFFFFF | - | 结构 |
是 |
typedef struct poc_config_s
| 名称 | 类型 | 最小值 | 最大值 | 默认值 | 含义 | 必选 |
|---|---|---|---|---|---|---|
| name | char[CAMERA_MODULE_NAME_LEN] | - | - | - | POC 的 |
是 |
| addr | uint32_t | 0 | - | - | POC 设备 |
是 |
| gpio_enable_bit | uint32_t | 0 | - | - | GPIO 操作 |
是 |
| gpio_level_bit | uint32_t | 0 | - | - | GPIO 工作 |
是 |
| poc_map | uint32_t | 0 | - | - | POC 与 Link 的 |
是 |
| power_delay | uint32_t | 0 | - | - | POC 开关 |
是 |
| end_flag | uint32_t | 0 | 0xFFFFFFFF | - | 结构 |
是 |
5.5.5. 返回值说明
| 错误码 | 宏 |
描述 | 常见 |
|---|---|---|---|
| 0 | HBN_STATUS_SUCESS | 成功 | |
| 1 | HBN_STATUS_INVALID_NODE | vnode 无效,找 |
|
| 2 | HBN_STATUS_INVALID_NODETYPE | vnode 类型 |
对于 VIN,vnode 类型 |
| 3 | HBN_STATUS_INVALID_HWID | 无效 |
对于 VIN,hw_id 取值 |
| 4 | HBN_STATUS_INVALID_CTXID | 无效 |
可 |
| 5 | HBN_STATUS_INVALID_OCHNID | 无效 |
VIN 输出 |
| 6 | HBN_STATUS_INVALID_ICHNID | 无效 |
VIN 仅 |
| 7 | HBN_STATUS_INVALID_FORMAT | 无效 |
|
| 8 | HBN_STATUS_INVALID_NULL_PTR | 空 |
|
| 9 | HBN_STATUS_INVALID_PARAMETER | 无效 |
|
| 10 | HBN_STATUS_ILLEGAL_ATTR | 无效 |
|
| 11 | HBN_STATUS_INVALID_FLOW | 无效 |
|
| 12 | HBN_STATUS_FLOW_EXIST | flow 已经 |
|
| 13 | HBN_STATUS_FLOW_UNEXIST | flow 不 |
|
| 14 | HBN_STATUS_NODE_EXIST | node 已经 |
|
| 15 | HBN_STATUS_NODE_UNEXIST | node 不 |
|
| 16 | HBN_STATUS_NOT_CONFIG | 预留 | |
| 17 | HBN_STATUS_CHN_NOT_ENABLED | 通道 |
|
| 18 | HBN_STATUS_CHN_ALREADY_ENABLED | 通道 |
|
| 19 | HBN_STATUS_ALREADY_BINDED | node 已经 |
|
| 20 | HBN_STATUS_NOT_BINDED | node 未 |
|
| 21 | HBN_STATUS_TIMEOUT | 超时 | |
| 22 | HBN_STATUS_NOT_INITIALIZED | 未 |
|
| 23 | HBN_STATUS_NOT_SUPPORT | 通道 |
|
| 24 | HBN_STATUS_NOT_PERM | 操作 |
|
| 25 | HBN_STATUS_NOMEM | 内存不足 | |
| 26 | HBN_STATUS_INVALID_VNODE_FD | 无效 |
|
| 27 | HBN_STATUS_INVALID_ICHNID_FD | 无效 |
|
| 28 | HBN_STATUS_INVALID_OCHNID_FD | 无效 |
|
| 29 | HBN_STATUS_OPEN_OCHN_FAIL | 打开 |
|
| 30 | HBN_STATUS_OPEN_ICHN_FAIL | 打开 |
|
| 31 | HBN_STATUS_JSON_PARSE_FAIL | json 解析 |
|
| 32 | HBN_STATUS_REQ_BUF_FAIL | 请求 buffer 失败 | |
| 33 | HBN_STATUS_QUERY_BUF_FAIL | 查询 buffer 信息 |
|
| 34 | HBN_STATUS_SET_CONTROL_FAIL | 模块 |
|
| 35 | HBN_STATUS_GET_CONTROL_FAIL | 模块 |
|
| 36 | HBN_STATUS_NODE_START_FAIL | node 开启 |
|
| 37 | HBN_STATUS_NODE_STOP_FAIL | node 停止 |
|
| 38 | HBN_STATUS_NODE_POLL_ERROR | node 通道 poll 错误 | |
| 39 | HBN_STATUS_NODE_POLL_TIMEOUT | node 通道 poll 超时 | |
| 40 | HBN_STATUS_NODE_POLL_FRAME_DROP | node 通道 poll 时 |
|
| 41 | HBN_STATUS_NODE_POLL_HUP | node 通道 poll 时 |
|
| 42 | HBN_STATUS_NODE_ILLEGAL_EVENT | node 通道 poll 时 |
|
| 43 | HBN_STATUS_NODE_DEQUE_ERROR | node 通道 dequeue buffer 错误 | |
| 44 | HBN_STATUS_ILLEGAL_BUF_INDEX | 无效 |
|
| 45 | HBN_STATUS_NODE_QUE_ERROR | node 通道 queue buffer 错误 | |
| 46 | HBN_STATUS_FLUSH_FRAME_ERROR | node 通道 |
|
| 47 | HBN_STATUS_INIT_BIND_ERROR | 用 json 解析 |
|
| 48 | HBN_STATUS_ADD_NODE_FAIL | 向 flow 中 |
|
| 49 | HBN_STATUS_WRONG_CONFIG_ID | 系统 |
|
| 50 | HBN_STATUS_BIND_NODE_FAIL | flow 绑定 node 时 |
|
| 51 | HBN_STATUS_INVALID_VERSION | 底层 |
|
| 52 | HBN_STATUS_GET_VERSION_ERROR | 获取 |
|
| 53 | HBN_STATUS_MEM_INIT_FAIL | hbmem 内存 |
|
| 54 | HBN_STATUS_MEM_IMPORT_FAIL | hbmem 内存 |
|
| 55 | HBN_STATUS_MEM_FREE_FAIL | hbmem 内存 |
|
| 56 | HBN_STATUS_SYSFS_OPEN_FAIL | 系统文件 |
|
| 57 | HBN_STATUS_STRUCT_SIZE_NOT_MATCH | hal 层 |
|
| 58 | HBN_STATUS_RGN_UNEXIST | 获取 |
|
| 59 | HBN_STATUS_RGN_INVALID_OPERATION | rgn 操作 |
|
| 60 | HBN_STATUS_RGN_OPEN_FILE_FAIL | rgn 模块 |
|
| 128 | HBN_STATUS_ERR_UNKNOW | 未知 |