Compare commits
2 Commits
a2e28adcd9
...
d5d858a043
Author | SHA1 | Date | |
---|---|---|---|
d5d858a043 | |||
a724173b76 |
@ -3,6 +3,8 @@
|
|||||||
OPTS = -Wall -g -DDEBUG_LEVEL=0
|
OPTS = -Wall -g -DDEBUG_LEVEL=0
|
||||||
|
|
||||||
|
|
||||||
|
all: joy2laser
|
||||||
|
|
||||||
laserblast.o: laserblast.c Makefile
|
laserblast.o: laserblast.c Makefile
|
||||||
gcc -c ${OPTS} $<
|
gcc -c ${OPTS} $<
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# joy2laser
|
# joy2laser
|
||||||
|
|
||||||
Kluge intuité pendant [Sonoptic 2020](https://sonoptic.net).
|
Kluge intuité pendant [Sonoptic 2020](http://sonoptic.net).
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ blast_addpoint(fx-SZ, fy-SZ, 0);
|
|||||||
|
|
||||||
blast_flush(0);
|
blast_flush(0);
|
||||||
|
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
int xy_handler(const char *path, const char *types, lo_arg ** argv,
|
int xy_handler(const char *path, const char *types, lo_arg ** argv,
|
||||||
@ -54,7 +54,7 @@ int val_x, val_y;
|
|||||||
int foo;
|
int foo;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, "%s ( %s %s %d )\n", __func__, path, types, argc);
|
fprintf(stderr, ">>> %s ( %s %s %d )\n", __func__, path, types, argc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
val_x = argv[0]->i; val_y = argv[1]->i;
|
val_x = argv[0]->i; val_y = argv[1]->i;
|
||||||
@ -75,7 +75,14 @@ exit(1);
|
|||||||
int help(int k)
|
int help(int k)
|
||||||
{
|
{
|
||||||
puts("HELP ME !");
|
puts("HELP ME !");
|
||||||
return 0;
|
puts("\t-p NNN\t\tlocal listening port");
|
||||||
|
puts("\t-R a.b.c.d\tremote host");
|
||||||
|
puts("\t-P NNN\t\tremote port");
|
||||||
|
puts("\t-L N\t\tlaser number");
|
||||||
|
puts("\t-S N\t\tscene number");
|
||||||
|
puts("\t-v\t\tincrease verbosity");
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -89,7 +96,7 @@ lo_server_thread st;
|
|||||||
long starttime;
|
long starttime;
|
||||||
|
|
||||||
/* parsing command line options */
|
/* parsing command line options */
|
||||||
while ((opt = getopt(argc, argv, "hp:vL:S:")) != -1) {
|
while ((opt = getopt(argc, argv, "hp:vL:S:R:P:")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'h': if (help(0)) exit(1); break;
|
case 'h': if (help(0)) exit(1); break;
|
||||||
case 'p': local_port = optarg; break;
|
case 'p': local_port = optarg; break;
|
||||||
@ -107,6 +114,7 @@ if (verbosity) {
|
|||||||
fprintf(stderr, "local port : %s\n", local_port);
|
fprintf(stderr, "local port : %s\n", local_port);
|
||||||
fprintf(stderr, "scene : %d\n", scenenumber);
|
fprintf(stderr, "scene : %d\n", scenenumber);
|
||||||
fprintf(stderr, "laser : %d\n", lasernumber);
|
fprintf(stderr, "laser : %d\n", lasernumber);
|
||||||
|
fprintf(stderr, "remote : %s %s\n", remote_host, remote_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
foo = blast_init(remote_host, remote_port, scenenumber, lasernumber);
|
foo = blast_init(remote_host, remote_port, scenenumber, lasernumber);
|
||||||
|
@ -59,7 +59,7 @@ int blast_addpoint(float x, float y, long col)
|
|||||||
char buff[100];
|
char buff[100];
|
||||||
int foo, sz;
|
int foo, sz;
|
||||||
|
|
||||||
sz = sprintf(buff, "(%f, %f, %ld),", x, y, col);
|
sz = sprintf(buff, "(%.2f, %.2f, %ld),", x, y, col);
|
||||||
|
|
||||||
if (verbosity)
|
if (verbosity)
|
||||||
fprintf(stderr, "%s --> %s\n", __func__, buff);
|
fprintf(stderr, "%s --> %s\n", __func__, buff);
|
||||||
@ -80,6 +80,7 @@ int blast_flush(void)
|
|||||||
int foo;
|
int foo;
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
|
|
||||||
|
/* we have to kill the last ',' in the big buff before send */
|
||||||
big_buffer[curpos-1] = ']'; big_buffer[curpos] = '\0';
|
big_buffer[curpos-1] = ']'; big_buffer[curpos] = '\0';
|
||||||
|
|
||||||
if (verbosity)
|
if (verbosity)
|
||||||
|
Loading…
Reference in New Issue
Block a user