HMP学习-srl相关函数-sr_GetThreadDeviceGroup( ) |
函数原型:
Linux long sr_GetThreadDeviceGroup (long *Devices,int *NumDevices)Windows int sr_GetThreadDeviceGroup (long *Devices,int *NumDevices)
参数:设备指针,设备个数
返回值:0成功 -1失败
作用:返回该线程创建的所有设备句柄。
示例程序:
#define MAX_DEVICES 96#define DEVICES_PER_TRUNK 24
EventPollThread (){long Devices [MAX_DEVICES];int DevNum, index;long EventHandle;for (DevNum = 0; DevNum < DEVICES_PER_TRUNK; DevNum++){Devices [DevNum] = dx_open(...);}sr_CreateThreadDeviceGroup (Devices);while (1){sr_WaitThreadDeviceGroup (-1);// do something with the eventif (done == true){break;}}DevNum = MAX_DEVICES;sr_GetThreadDeviceGroup (&Devices, &DevNum);printf ("%d devices in the device group:\n", DevNum);for (index = 0; index < DevNum; index++){// NOTE: This loop will execute 24 timesprintf ("Device handle #%2d: %d\n", index, Devices[index]);}sr_DeleteThreadDeviceGroup();}
|
阅读全文(1643) | 回复(0) | 编辑 | 精华 |
|
« | September 2025 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | | | | |
|
Blog信息 |
blog名称: 日志总数:33 评论数量:61 留言数量:-8 访问次数:236575 建立时间:2006年4月27日 | |

|