Rsdemo.c
上传用户:keruier
上传日期:2013-02-04
资源大小:57k
文件大小:6k
源码类别:

源码/资料

开发平台:

DOS

  1. /*  RSDEMO.C  */
  2. #include "rs232.h"
  3. #include <string.h>
  4. #include <conio.h>
  5. #include <stdio.h>
  6. #include <dos.h>
  7. #define ESC 27
  8. /* prototypes */
  9. void interroge(void);
  10. void main(void);
  11. void terminal(void);
  12. void testorphy(void);
  13. int cherche_orphy(void);
  14. char typo[10];
  15. int valcom;
  16. void main(void)
  17. {
  18. char rep[100];
  19. int n, type_orphy,reponse;
  20. long debit;
  21. clrscr();  /* efface l'俢ran */
  22. if ((type_orphy=cherche_orphy())==0) /* ORPHY sur COM1 ou COM2*/
  23. {
  24. reponse=init_rs(0,9600,'n',8,1);
  25.   ecris_rs_rc("XSTOPS 0");
  26. debit=9600L;
  27. do
  28. {  clrscr();
  29.    gotoxy(60,2);
  30.    textcolor(LIGHTRED);
  31.    cprintf("vitesse: ");
  32.    gotoxy(60,3);
  33.    cprintf("%6ld Bauds",debit);
  34.    textcolor(WHITE);
  35.    gotoxy(1,1);
  36.    printf("n       communication avec ORPHY %s sur COM%d nn",typo,valcom);
  37.    printf("n               C. RELLIER  pour EVARISTE nn");
  38.    printf("        赏屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯籠n");
  39.    printf("