integration du terminal dans le machin
This commit is contained in:
12
essai.c
12
essai.c
@@ -15,8 +15,10 @@
|
||||
#include "serial/serial.h"
|
||||
#include "viz/curses/ecran.h"
|
||||
|
||||
int verbosity;
|
||||
|
||||
int run_the_terminal(int fd_serial, char *title, WINDOW *win); /* XXX */
|
||||
|
||||
int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
int traite_les_messages(int sfd, int nbloops)
|
||||
@@ -38,7 +40,7 @@ if (NULL==fp) {
|
||||
for (idx=0; idx<nbloops; idx++) {
|
||||
|
||||
if (kbhit()) {
|
||||
static char valid_k[] = "+-";
|
||||
static char valid_k[] = "+-01";
|
||||
key = getch();
|
||||
|
||||
/* if it is a valid key, send it to the Arduino */
|
||||
@@ -47,6 +49,12 @@ for (idx=0; idx<nbloops; idx++) {
|
||||
fprintf(stderr, "put byte %02X -> %d\n",
|
||||
key, foo);
|
||||
}
|
||||
else if (0x14==key) { /* request for terminal */
|
||||
|
||||
foo = run_the_terminal(sfd, " terminal ", 0);
|
||||
sprintf(ligne, "retour terminal = %d", foo);
|
||||
aff_message(ligne); sleep(1);
|
||||
}
|
||||
else {
|
||||
sprintf(ligne, "Key 0x%02X invalid ", key);
|
||||
fprintf(stderr, "%s\n", ligne);
|
||||
|
||||
Reference in New Issue
Block a user