]> rtime.felk.cvut.cz Git - sysless.git/blob - common/libs4c/cmdprocio/cmdio_bth.c
Added .gitignore
[sysless.git] / common / libs4c / cmdprocio / cmdio_bth.c
1 /*******************************************************************
2   Components for embedded applications builded for
3   laboratory and medical instruments firmware  
4  
5   cmd_bth.c - interconnection of text command processor
6                 with RS-232 line
7  
8   Copyright (C) 2001 by Pavel Pisa pisa@cmp.felk.cvut.cz
9             (C) 2002 by PiKRON Ltd. http://www.pikron.com
10
11  *******************************************************************/
12
13 #include <cmd_proc.h>
14 #include <bth_inface.h>
15
16 #define ED_LINE_CHARS 80
17
18 /* cmd_io_t cmd_io_bth_dev; */
19
20 /* char ed_line_chars_bth_in[ED_LINE_CHARS+1]; */
21 /* char ed_line_chars_bth_out[ED_LINE_CHARS+1]; */
22
23 /* ed_line_buf_t ed_line_buf_bth_in={ */
24 /*   flg:FL_ELB_ECHO, */
25 /*   inbuf:0, */
26 /*   alloc:sizeof(ed_line_chars_bth_in), */
27 /*   maxlen:0, */
28 /*   lastch:0, */
29 /*   buf:ed_line_chars_bth_in */
30 /* }; */
31
32 /* ed_line_buf_t ed_line_buf_bth_out={ */
33 /*   flg:FL_ELB_NOCRLF, */
34 /*   inbuf:0, */
35 /*   alloc:sizeof(ed_line_chars_bth_out), */
36 /*   maxlen:0, */
37 /*   lastch:0, */
38 /*   buf:ed_line_chars_bth_out */
39 /* }; */
40
41 /* cmd_io_t cmd_io_bth={ */
42 /*   putc:cmd_io_putc_ed_line, */
43 /*   getc:NULL, */
44 /*   write:cmd_io_write_bychar, */
45 /*   read:NULL, */
46 /*   priv:{ */
47 /*     ed_line:{ */
48 /*       in: &ed_line_buf_bth_in, */
49 /*       out:&ed_line_buf_bth_out, */
50 /*       io_stack:&cmd_io_bth_dev */
51 /*     } */
52 /*   } */
53 /* }; */
54
55 int cmd_io_putc_bth(struct cmd_io *cmd_io,int ch)
56
57   return bth_inface_sendch(ch,0); //=0; //sci_bth_sendch(ch,IMPLIC_NUM_SERIAL_PORT);;
58 }
59
60 int cmd_io_getc_bth(struct cmd_io *cmd_io)
61
62   return bth_inface_recch(0);//=-1; //sci_bth_recch(IMPLIC_NUM_SERIAL_PORT);
63 }
64
65 cmd_io_t cmd_io_bth={
66   putc:cmd_io_putc_bth,
67   getc:cmd_io_getc_bth,
68   write:cmd_io_write_bychar,
69   read:cmd_io_read_bychar
70 };