added the K parameter
This commit is contained in:
6
essai.c
6
essai.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user