aboutsummaryrefslogtreecommitdiff
path: root/example-fs-bb48/tty.h
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-05-23 13:48:24 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-05-23 13:48:24 +0900
commitb6603f677159b72a8165a5475dad525947889881 (patch)
tree0ebf65e409053730b9546a00d5debd3f1a7eb521 /example-fs-bb48/tty.h
parentee92bb15b361b3daee816a4e930be0032be2d9e7 (diff)
Update example-fs-bb48
Diffstat (limited to 'example-fs-bb48/tty.h')
-rw-r--r--example-fs-bb48/tty.h31
1 files changed, 7 insertions, 24 deletions
diff --git a/example-fs-bb48/tty.h b/example-fs-bb48/tty.h
index 77b7014..bd0f070 100644
--- a/example-fs-bb48/tty.h
+++ b/example-fs-bb48/tty.h
@@ -1,26 +1,9 @@
-#define BUFSIZE 128
-#define FLAG_CONNECTED (1 << 0)
-#define FLAG_SEND_AVAIL (1 << 1)
-#define FLAG_RECV_AVAIL (1 << 2)
+#define LINEBUFSIZE 128
-/*
- * Current implementation is synchronous and buffers are not yet used.
- */
-struct stream {
- chopstx_mutex_t mtx;
- chopstx_cond_t cnd;
- int sending;
- unsigned int recv_len;
- uint8_t recv_buf[BUFSIZE];
- uint8_t buf_send[BUFSIZE]; /* Not yet used. */
- uint8_t cnt_send_head; /* Not yet used. */
- uint8_t cnt_send_tail; /* Not yet used. */
- uint8_t cnt_recv_head; /* Not yet used. */
- uint8_t cnt_recv_tail; /* Not yet used. */
- uint32_t flags;
-};
+struct tty;
-struct stream *stream_open (void);
-int stream_wait_connection (struct stream *st);
-int stream_send (struct stream *st, uint8_t *buf, uint8_t count);
-int stream_recv (struct stream *st, uint8_t *buf);
+struct tty *tty_open (void);
+void tty_wait_configured (struct tty *tty);
+void tty_wait_connection (struct tty *tty);
+int tty_send (struct tty *tty, uint8_t *buf, int count);
+int tty_recv (struct tty *tty, uint8_t *buf, uint32_t *timeout);