added the K parameter

This commit is contained in:
phyto
2019-05-16 12:28:47 +02:00
parent 946616e55a
commit dcc394a088
3 changed files with 91 additions and 4 deletions

View File

@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <curses.h>
#include <ncurses.h>
#include <time.h>
#include "core/utils.h"
@@ -17,6 +17,7 @@
int verbosity;
/* --------------------------------------------------------------- */
int traite_les_messages(int sfd, int nbloops)
{
@@ -115,6 +116,7 @@ void help(int k)
{
puts("options : ");
puts("\t-d\tserial device to read.");
puts("\t-K\tset the K parameter.");
puts("\t-v\tincrease verbosity.");
exit(0);
}
@@ -125,12 +127,14 @@ int main(int argc, char *argv[])
int opt;
int serial_in;
char *device = "/dev/ttyACM0";
int K = 0;
char ligne[100];
while ((opt = getopt(argc, argv, "d:hv")) != -1) {
switch (opt) {
case 'd': device = optarg; break;
case 'h': help(0); break;
case 'K': K = atoi(optarg); break;
case 'v': verbosity++; break;
default: break;
}