Compare commits

..

No commits in common. "c1327cf31804a19256546ea7f67a7de9740e0f25" and "8dc0acc382332881161c55b5352b4edcf7af9377" have entirely different histories.

7 changed files with 12 additions and 81 deletions

View File

@ -1,5 +1,4 @@
# LOTH PROJECT
# config pour le MapMachin # config pour le MapMachin
IP_VIDEO="10.20.25.6" IP_VIDEO="10.20.25.6"

View File

@ -14,14 +14,14 @@ joy2laser: joy2laser.c Makefile laserblast.o
# -------------------------------------------- # --------------------------------------------
asyncburp.o: asyncburp.c burpmsg.h laserblast.h Makefile asyncburp.o: asyncburp.c burpmsg.h Makefile
gcc -c ${OPTS} $< gcc -c ${OPTS} $<
burpmsg.o: burpmsg.c burpmsg.h Makefile burpmsg.o: burpmsg.c burpmsg.h Makefile
gcc -c ${OPTS} $< gcc -c ${OPTS} $<
asyncburp: asyncburp.o burpmsg.o laserblast.o asyncburp: asyncburp.o burpmsg.o
gcc ${OPTS} $< laserblast.o burpmsg.o -llo -o $@ gcc ${OPTS} $< burpmsg.o -llo -o $@
# -------------------------------------------- # --------------------------------------------

View File

@ -7,7 +7,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <string.h>
#include <lo/lo.h> /* OSC library */ #include <lo/lo.h> /* OSC library */
@ -26,54 +25,18 @@
int verbosity; /* global variable */ int verbosity; /* global variable */
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
/* ------------------------------------------------------------------- */ static int bloub(void)
int init_osc_receiver(char *port, int notused)
{ {
BurpMsg message;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, port, notused);
#endif
return -1; message.magic = BURP_MAGIC;
}
/* ------------------------------------------------------------------- */
int init_osc_sender(char *r_host, char *r_port, int notused)
{
int foo;
#if DEBUG_LEVEL display_burp_msg(&message, NULL);
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
r_host, r_port, notused);
#endif
foo = blast_init(r_host, r_port, 0, 0);
if (foo) {
fprintf(stderr, "blast_init return %d\n", foo);
return -2;
}
if (verbosity) blast_NOP(getpid());
return 0; return 0;
} }
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
/*
* this is a tool function for debugging, do not use in real life
*/
static int tentative(void)
{
int foo;
blast_rewind();
blast_addpoint(200, 200, 0xff0000);
blast_addpoint(300, 300, 0xff0000);
blast_flush(0);
return 42;
}
/* ------------------------------------------------------------------- */
static int help(int krkrkr) static int help(int krkrkr)
{ {
puts("HELP ME !"); puts("HELP ME !");
@ -86,6 +49,7 @@ puts("\t-v\t\tincrease verbosity");
return 1; return 1;
} }
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
char *local_port = LOCAL_PORT; char *local_port = LOCAL_PORT;
@ -94,7 +58,7 @@ char *remote_port = REMOTE_PORT;
int lasernumber, scenenumber; int lasernumber, scenenumber;
int opt, foo; int opt;
fprintf(stderr, "%s compiled %s at %s\n",argv[0], __DATE__, __TIME__); fprintf(stderr, "%s compiled %s at %s\n",argv[0], __DATE__, __TIME__);
@ -123,10 +87,7 @@ if (verbosity) {
fprintf(stderr, "scn/laser : %d %d\n", scenenumber, lasernumber); fprintf(stderr, "scn/laser : %d %d\n", scenenumber, lasernumber);
} }
foo = init_osc_sender(remote_host, remote_port, 0); bloub();
fprintf(stderr, "init osc sender -> %d\n", foo);
tentative();
return 2; return 2;
} }

View File

@ -7,7 +7,6 @@
#include <sys/select.h> #include <sys/select.h>
#include <unistd.h> #include <unistd.h>
#include "laserblast.h"
#include "burpmsg.h" #include "burpmsg.h"
@ -38,9 +37,6 @@ switch(header->msgtype) {
case BURP_SCENE: case BURP_SCENE:
txt_type = "scene"; txt_type = "scene";
break; break;
case BURP_TEXTE:
txt_type = "texte";
break;
default: default:
fprintf(stderr, "burpmsg at %p : invalid msgtype %d\n", fprintf(stderr, "burpmsg at %p : invalid msgtype %d\n",
@ -48,7 +44,7 @@ switch(header->msgtype) {
return -1; return -1;
} }
fprintf(stderr, "type %4d/%-8s serial %9d szdata %3d\n", fprintf(stderr, "%4d %12s %9d %3d\n",
header->msgtype, txt_type, header->serial, header->szdata); header->msgtype, txt_type, header->serial, header->szdata);
return 0; return 0;
@ -84,8 +80,6 @@ for(;;) { /* start of infinite loop */
foo, sizeof(BurpMsg)); foo, sizeof(BurpMsg));
} }
display_burp_msg(&message, NULL); display_burp_msg(&message, NULL);
/* read appended datas */
} }
else { else {
/* got a time out */ /* got a time out */

View File

@ -20,7 +20,6 @@ typedef struct {
#define BURP_LASER 3 #define BURP_LASER 3
#define BURP_SCENE 4 #define BURP_SCENE 4
#define BURP_COLOR 5 #define BURP_COLOR 5
#define BURP_TEXTE 6
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */

View File

@ -46,27 +46,6 @@ x_scale = y_scale = 700;
big_buffer[0] = '\0'; /* clear buffer */ big_buffer[0] = '\0'; /* clear buffer */
curpos = 0; /* index in buffer */ curpos = 0; /* index in buffer */
return 0;
}
/* ------------------------------------------------------------------- */
/*
* this function is for test purpose, don't use in the
* real world, Just don't, OK?
*/
int blast_NOP(int reason)
{
int foo;
char msg[50];
fprintf(stderr, "===== BLAST NOP %d\n", reason);
sprintf(msg, "BLAST NOP %d", reason);
foo = lo_send(lo_addr, "/dev/null", "s", msg);
if (-1==foo) {
fprintf(stderr, "%s : error %d\n", __func__, foo);
return -1;
}
return 0; return 0;
} }
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
@ -100,7 +79,7 @@ return -1;
int blast_addpoint(float x, float y, long col) int blast_addpoint(float x, float y, long col)
{ {
char buff[100]; char buff[100];
int sz; int foo, sz;
sz = sprintf(buff, "(%.2f, %.2f, %ld),", x, y, col); sz = sprintf(buff, "(%.2f, %.2f, %ld),", x, y, col);

View File

@ -11,4 +11,3 @@ int blast_setscale(int width, int height);
int blast_addpoint(float fx, float fy, long col); int blast_addpoint(float fx, float fy, long col);
int blast_flush(int notused); int blast_flush(int notused);
int blast_NOP(int reason);