本站首页    管理页面    写新日志    退出


HMP学习-srl相关函数-sr_getboardcnt( )
zhu_ruixian 发表于 2007/1/9 16:02:07

函数原型:long sr_getboardcnt(char* class_namep,int* boardcntp) 参数:指向类名的指针,记录主板卡的数目 返回值:0成功 -1失败 作用:仅仅用在windows平台。返回特定类型的板卡资源数量。 #include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
long chdev[MAXDEVS];
long evt_handle;
main( ... )
{
char channel_name[12], board_name[12];
int brd_handle;
int brd, ch, devcnt = 0;
int numvoxbrds = 0;
if ( sr_getboardcnt(DEV_CLASS_VOICE, &numvoxbrds) == -1)
{
/* erro

阅读全文(2489) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-sr_enbhdlr( )
zhu_ruixian 发表于 2007/1/9 15:53:24

函数原型:long sr_enbhdlr(long dev,long evt_type, handler) Linux: long (*handler)( )
Windows: long (*handler) (unsigned long parm) 参数:设备句柄,事件类型,事件处理函数 返回值:0成功 -1失败 作用:让事件处理函数开始监听事件 示例程序: #include <srllib.h>
#include <dxxxlib.h>
/* LINUX: set up handler */
long int dx_handler(void* pData)
{
printf( "dx_handler() called, event is 0x%x\n", sr_getevttype());
return( 0 );
/* tell SRL to dispose of the event */
}
m

阅读全文(2566) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-sr_dishdlr( )
zhu_ruixian 发表于 2007/1/9 15:29:26

函数原型:long sr_dishdlr(long dev,long evt_type, handler) Linux: long (*handler)( )
Windows: long (*handler) (unsigned long parm) 参数:设备句柄,事件类型,事件处理函数 返回值:0成功 -1失败 作用:让一个事件处理函数不在起作用。 示例程序: #include <srllib.h>
#include <dxxxlib.h>
#include <cstdio>
using namespace std;
/* LINUX: set up handler */
long int dx_handler(void * pdata){
    printf( "dx_handler() called, event is 0x%x\n", sr_getevttype())
阅读全文(2164) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-sr_GetThreadDeviceGroup( )
zhu_ruixian 发表于 2007/1/9 15:25:05

函数原型: 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 [Dev
阅读全文(1642) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-sr_DeleteThreadDeviceGroup( )
zhu_ruixian 发表于 2007/1/9 15:20:08

函数原型: Linux long sr_DeleteThreadDeviceGroup(void)
Windows  int sr_DeleteThreadDeviceGroup(void) 参数:空 返回值:0成功  -1 失败 作用:移除所有的该线程创建的设备句柄组。 示例程序: EventPollThread ()
long Devices [24];
int DevNum;
long EventHandle;
for (DevNum = 0; DevNum < 24; DevNum++)
Devices [DevNum] = dx_open(...);
sr_CreateThreadDeviceGroup (Devices);
while (1)
sr_WaitThreadDeviceGroup (-1);
// do something with the event
if (done
阅读全文(2024) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-sr_CreateThreadDeviceGroup( )
zhu_ruixian 发表于 2007/1/9 15:16:32

函数原型: Linux long sr_CreateThreadDeviceGroup (long *Devices,int NumDevices)
Windows int sr_CreateThreadDeviceGroup (long *Devices,int NumDevices) 参数:设备句柄指针。设备句柄个数。 返回值:0成功 -1失败 示例程序: EventPollThread ()
{
long Devices [24];
int DevNum;
long EventHandle;
for (DevNum = 0; DevNum < 24; DevNum++)
{
Devices [DevNum] = dx_open(...);
}
sr_CreateThreadDeviceGroup (Devices, 24);
while (1)
{
sr_WaitThreadDeviceGroup (-1);
阅读全文(1694) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-sr_AddToThreadDeviceGroup( )
zhu_ruixian 发表于 2007/1/9 15:10:46

函数原型: Linux long sr_AddToThreadDeviceGroup (long *evices, int NumDevices)
Windows: int sr_AddToThreadDeviceGroup (long *evices,int NumDevices) 参数:一列设备句柄列表的头指针。设备列表中设备句柄的个数。 返回值:0成功  -1失败 示例程序; EventPollThread ()
{
long Devices [24];
int DevNum;
long EventHandle;
for (DevNum = 0; DevNum < 24; DevNum++)
{
Devices [DevNum] = dx_open(...);
}
sr_CreateThreadDeviceGroup (Devices);
while (1)
{
sr_WaitThreadDeviceG
阅读全文(2046) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-ATDV_SUBDEVS()
zhu_ruixian 发表于 2007/1/9 15:04:21

函数原型:long ATDV_SUBDEVS(int dev) 参数:设备句柄 返回值:设备句柄的子设备的数目 示例程序: #include <srllib.h>
#include <dxxxlib.h>
int main()
{
        int dxxxdev;
        /* Open a dxxx channel device */
        if(( dxxxdev = dx_open( "dxxxB1", 0 )) == -1 )
        {
       &n
阅读全文(1643) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-ATDV_NAMEP()
zhu_ruixian 发表于 2007/1/9 14:53:16

函数原型:char * ATDV_NAMEP(int dev) 参数:设备句柄 返回值:用来打开这个设备的字符串。设备名例如:
• dxxxBbCc • dtiBbTt b 代表系统中的板卡号。 c 代表真实或虚拟D/4x板卡中的频道号 t  表示数字网络接口中的时间片序号 示例程序: #include <srllib.h>
#include <dxxxlib.h>
int main(){
        int dxxxdev;
        /* Open a dxxx channel device */
        if(( dxxxdev =
阅读全文(1634) | 回复(0) | 编辑 | 精华 | 删除

HMP学习-srl相关函数-ATDV_LASTERR()
zhu_ruixian 发表于 2007/1/9 14:45:43

函数原型:long ATDV_LASTERR(int dev) 参数:设备句柄 返回值:句柄无效Linux返回EDV_BADDESC Windows返回
AT_FAILURE,否则返回一个错误代码。错误代码在DEVICElib.h中定义。 示例程序: #include <srllib.h>
#include <dxxxlib.h>
int main(){
        int dxxxdev;
        int parm = ET_RON;
        /* Open dxxx channel device */
        if(( dxxxdev = dx_
阅读全文(1679) | 回复(0) | 编辑 | 精华 | 删除
« 1 2 3 4 »

 
«September 2025»
123456
78910111213
14151617181920
21222324252627
282930

  公告
欢迎大家留言!既然来了,多少说两句!呵呵!

 


  我的分类(专题)
  最近日志

  最新评论

  留言板

  链接


  Blog信息
blog名称:
日志总数:33
评论数量:61
留言数量:-8
访问次数:236455
建立时间:2006年4月27日



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.043 second(s), page refreshed 144779698 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号