通过DMA搜索整数 - DmaFindInt
函数简介
通过 DMA 搜索指定范围内的整数,支持多种整数类型。(高级版功能,普通版无法使用)
接口名称
DmaFindInt
DLL调用
OLA_STRING_RETURN OLA_CALL_TYPE DmaFindInt(int64_t instance, int64_t deviceId, int32_t pid, OLA_STRING_INPUT addr_range, int64_t int_value_min, int64_t int_value_max, int32_t type);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| deviceId | 长整数型 | 设备ID |
| pid | 整数型 | 进程 PID |
| addr_range | 字符串 | 地址范围,格式:0x开始地址-0x结束地址 |
| int_value_min | 长整数型 | 最小值(包含边界) |
| int_value_max | 长整数型 | 最大值(包含边界) |
| type | 整数型 | 整数类型:0=32位有符号, 1=16位有符号, 2=8位有符号, 3=64位, 4=32位无符号, 5=16位无符号, 6=8位无符号 |
示例
const char* results = DmaFindInt(instance, deviceId, 1234, "0x400000-0x500000", 100, 200, 0);
if (results != NULL && strlen(results) > 0) {
printf("搜索结果: %s\n", results);
FreeStringPtr(instance, results);
}
返回值
字符串指针,数据格式为 addr1|addr2|addr3...,示例:123456|ff001122|dc12366。
返回的字符串指针需要调用 FreeStringPtr 释放内存。
