欢迎来到天天文库
浏览记录
ID:56489833
大小:3.65 MB
页数:14页
时间:2020-06-25
《北邮 计科大三 现代交换技术 实验报告(全部代码) 时间表调度实验 摘挂机检测实验.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、基础实验一时间表调度实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)voidinitSchTable(intScheduleTable[SchTabLen][SchTabWdh]){inti;for(i=0;i<=19;i++){ScheduleTable[i][0]=0;}ScheduleTable[0][0]=1;for(i=0;i<=19;i++){ScheduleTable[i][1]=1;}for(i=0;i<=19;i++){ScheduleTable
2、[i][2]=0;}ScheduleTable[0][2]=1;ScheduleTable[10][2]=1;return;}基础实验二 摘挂机检测实验 源代码extern"C"_declspec(dllexport)voidscanfor200(intlinestate200[LINEMAX],intlinestate[LINEMAX],UpOnnode*head1,UpOnnode*end1){inti;UpOnnode*p;for(i=0;i3、te200[i]){p=newUpOnnode;p->phonestate=ehandup;p->linenum=i;p->next=0;end1->next=p;end1=p;}if(linestate200[i]&~linestate[i]){p=newUpOnnode;p->phonestate=ehandon;p->linenum=i;p->next=0;end1->next=p;end1=p;}}if(i==LINEMAX)for(i=0;i4、e[i];return;}基础实验三 脉冲计数实验源代码voidscanpulse(intlinestate[LINEMAX],intlinestate10[LINEMAX],intchange[LINEMAX],intfchange[LINEMAX],intpulsenum[LINEMAX]){inti;for(i=0;i5、(change[i]&&(!linestate10[i]))pulsenum[i]=pulsenum[i]+1;}for(i=0;i6、head2,Digitnode*end2){inti;Digitnode*p;for(i=0;inum=pulsenum[i];p->linenum=i;p->next=0;end2->next=p;end2=p;pulsenum[i]=0;}}}for(i=0;i7、;linestate100[i]=linestate2[i];}return;}基础实验五 软件送音实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)intdecide_ringtype(Userstatestate){switch(state){case1:caller_ehandup;return1;case2:caller_calledbusy;return4;case3:theother_firstehandon;return4;case4:dial_ti8、mer_timeout;return4;case5:recvnum_timer_timeout;return4;case6:connect_timer_timeout;return4;case7:nulltone_timer_timeout;return4;case8:ringback_t
3、te200[i]){p=newUpOnnode;p->phonestate=ehandup;p->linenum=i;p->next=0;end1->next=p;end1=p;}if(linestate200[i]&~linestate[i]){p=newUpOnnode;p->phonestate=ehandon;p->linenum=i;p->next=0;end1->next=p;end1=p;}}if(i==LINEMAX)for(i=0;i4、e[i];return;}基础实验三 脉冲计数实验源代码voidscanpulse(intlinestate[LINEMAX],intlinestate10[LINEMAX],intchange[LINEMAX],intfchange[LINEMAX],intpulsenum[LINEMAX]){inti;for(i=0;i5、(change[i]&&(!linestate10[i]))pulsenum[i]=pulsenum[i]+1;}for(i=0;i6、head2,Digitnode*end2){inti;Digitnode*p;for(i=0;inum=pulsenum[i];p->linenum=i;p->next=0;end2->next=p;end2=p;pulsenum[i]=0;}}}for(i=0;i7、;linestate100[i]=linestate2[i];}return;}基础实验五 软件送音实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)intdecide_ringtype(Userstatestate){switch(state){case1:caller_ehandup;return1;case2:caller_calledbusy;return4;case3:theother_firstehandon;return4;case4:dial_ti8、mer_timeout;return4;case5:recvnum_timer_timeout;return4;case6:connect_timer_timeout;return4;case7:nulltone_timer_timeout;return4;case8:ringback_t
4、e[i];return;}基础实验三 脉冲计数实验源代码voidscanpulse(intlinestate[LINEMAX],intlinestate10[LINEMAX],intchange[LINEMAX],intfchange[LINEMAX],intpulsenum[LINEMAX]){inti;for(i=0;i5、(change[i]&&(!linestate10[i]))pulsenum[i]=pulsenum[i]+1;}for(i=0;i6、head2,Digitnode*end2){inti;Digitnode*p;for(i=0;inum=pulsenum[i];p->linenum=i;p->next=0;end2->next=p;end2=p;pulsenum[i]=0;}}}for(i=0;i7、;linestate100[i]=linestate2[i];}return;}基础实验五 软件送音实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)intdecide_ringtype(Userstatestate){switch(state){case1:caller_ehandup;return1;case2:caller_calledbusy;return4;case3:theother_firstehandon;return4;case4:dial_ti8、mer_timeout;return4;case5:recvnum_timer_timeout;return4;case6:connect_timer_timeout;return4;case7:nulltone_timer_timeout;return4;case8:ringback_t
5、(change[i]&&(!linestate10[i]))pulsenum[i]=pulsenum[i]+1;}for(i=0;i6、head2,Digitnode*end2){inti;Digitnode*p;for(i=0;inum=pulsenum[i];p->linenum=i;p->next=0;end2->next=p;end2=p;pulsenum[i]=0;}}}for(i=0;i7、;linestate100[i]=linestate2[i];}return;}基础实验五 软件送音实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)intdecide_ringtype(Userstatestate){switch(state){case1:caller_ehandup;return1;case2:caller_calledbusy;return4;case3:theother_firstehandon;return4;case4:dial_ti8、mer_timeout;return4;case5:recvnum_timer_timeout;return4;case6:connect_timer_timeout;return4;case7:nulltone_timer_timeout;return4;case8:ringback_t
6、head2,Digitnode*end2){inti;Digitnode*p;for(i=0;inum=pulsenum[i];p->linenum=i;p->next=0;end2->next=p;end2=p;pulsenum[i]=0;}}}for(i=0;i7、;linestate100[i]=linestate2[i];}return;}基础实验五 软件送音实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)intdecide_ringtype(Userstatestate){switch(state){case1:caller_ehandup;return1;case2:caller_calledbusy;return4;case3:theother_firstehandon;return4;case4:dial_ti8、mer_timeout;return4;case5:recvnum_timer_timeout;return4;case6:connect_timer_timeout;return4;case7:nulltone_timer_timeout;return4;case8:ringback_t
7、;linestate100[i]=linestate2[i];}return;}基础实验五 软件送音实验源代码#include"bconstant.h"extern"C"_declspec(dllexport)intdecide_ringtype(Userstatestate){switch(state){case1:caller_ehandup;return1;case2:caller_calledbusy;return4;case3:theother_firstehandon;return4;case4:dial_ti
8、mer_timeout;return4;case5:recvnum_timer_timeout;return4;case6:connect_timer_timeout;return4;case7:nulltone_timer_timeout;return4;case8:ringback_t
此文档下载收益归作者所有