860e91ba85e0070b3deb854f8a8e9952bceca480
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c   1) /* BlinkenLib
Stefan Schuermans update email address of author

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c   2)    Copyright 2004-2014 Stefan Schuermans <stefan@schuermans.info>
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c   3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
Stefan Schuermans fix comment formatting

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenOutput.c   4)    a blinkenarea.org project */
BlinkenLib/BlinkenOutput.c   5) /* OS X support by Manfred Wuits
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c   6)    <manfred@werkzeugH.at> */
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c              7) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c        8) #include <arpa/inet.h>
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c              9) #include <errno.h>
BlinkenOutput.c             10) #include <fcntl.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c       11) #include <netinet/in.h>
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             12) #include <stdio.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c       13) #include <stdlib.h>
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             14) #include <string.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c       15) #include <sys/socket.h>
tools/BlinkenOutput.c       16) #include <sys/time.h>
tools/BlinkenOutput.c       17) #include <sys/types.h>
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             18) #include <termios.h>
BlinkenOutput.c             19) #include <time.h>
BlinkenOutput.c             20) #include <unistd.h>
BlinkenOutput.c             21) 
Christian Heimke BlinkenLib v.0.5.5 (2008-03...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c  22) #include <BlinkenLib/BlinkenLib.h>
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             23) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c  24) // get serial settings from text
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c       25) static int serial_settings_parse(char *str, int *settings, int *speed) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             26)   int baud, data, stop;
BlinkenOutput.c             27)   char parity;
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c  28)   int set = 0, sp = 0;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             29) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c  30)   // split and parse settings string
BlinkenLib/BlinkenOutput.c  31)   if (sscanf(str, "%i,%c,%i,%i", &baud, &parity, &data, &stop) != 4)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             32)     return 0;
BlinkenOutput.c             33) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c       34)     // baud rate
tools/BlinkenOutput.c       35) #define BAUD(rate) else if (baud == rate) sp = B##rate;
tools/BlinkenOutput.c       36)   if (0) {
tools/BlinkenOutput.c       37)   }
Stefan Schuermans more baudrates for BlinkenO...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c  38)   BAUD(300)
BlinkenLib/BlinkenOutput.c  39)   BAUD(600)
BlinkenLib/BlinkenOutput.c  40)   BAUD(1200)
BlinkenLib/BlinkenOutput.c  41)   BAUD(2400)
BlinkenLib/BlinkenOutput.c  42)   BAUD(4800)
BlinkenLib/BlinkenOutput.c  43)   BAUD(9600)
BlinkenLib/BlinkenOutput.c  44)   BAUD(19200)
BlinkenLib/BlinkenOutput.c  45)   BAUD(38400)
BlinkenLib/BlinkenOutput.c  46)   BAUD(57600)
BlinkenLib/BlinkenOutput.c  47)   BAUD(115200)
BlinkenLib/BlinkenOutput.c  48) #ifdef B230400
BlinkenLib/BlinkenOutput.c  49)   BAUD(230400)
BlinkenLib/BlinkenOutput.c  50) #endif
BlinkenLib/BlinkenOutput.c  51) #ifdef B460800
BlinkenLib/BlinkenOutput.c  52)   BAUD(460800)
BlinkenLib/BlinkenOutput.c  53) #endif
BlinkenLib/BlinkenOutput.c  54) #ifdef B576000
BlinkenLib/BlinkenOutput.c  55)   BAUD(576000)
BlinkenLib/BlinkenOutput.c  56) #endif
BlinkenLib/BlinkenOutput.c  57) #ifdef B921600
BlinkenLib/BlinkenOutput.c  58)   BAUD(921600)
BlinkenLib/BlinkenOutput.c  59) #endif
BlinkenLib/BlinkenOutput.c  60) #ifdef B1000000
BlinkenLib/BlinkenOutput.c  61)   BAUD(1000000)
BlinkenLib/BlinkenOutput.c  62) #endif
BlinkenLib/BlinkenOutput.c  63) #ifdef B1152000
BlinkenLib/BlinkenOutput.c  64)   BAUD(1152000)
BlinkenLib/BlinkenOutput.c  65) #endif
BlinkenLib/BlinkenOutput.c  66) #ifdef B1500000
BlinkenLib/BlinkenOutput.c  67)   BAUD(1500000)
BlinkenLib/BlinkenOutput.c  68) #endif
BlinkenLib/BlinkenOutput.c  69) #ifdef B2000000
BlinkenLib/BlinkenOutput.c  70)   BAUD(2000000)
BlinkenLib/BlinkenOutput.c  71) #endif
BlinkenLib/BlinkenOutput.c  72) #ifdef B2500000
BlinkenLib/BlinkenOutput.c  73)   BAUD(2500000)
BlinkenLib/BlinkenOutput.c  74) #endif
BlinkenLib/BlinkenOutput.c  75) #ifdef B3000000
BlinkenLib/BlinkenOutput.c  76)   BAUD(3000000)
BlinkenLib/BlinkenOutput.c  77) #endif
BlinkenLib/BlinkenOutput.c  78) #ifdef B3500000
BlinkenLib/BlinkenOutput.c  79)   BAUD(3500000)
BlinkenLib/BlinkenOutput.c  80) #endif
BlinkenLib/BlinkenOutput.c  81) #ifdef B4000000
BlinkenLib/BlinkenOutput.c  82)   BAUD(4000000)
BlinkenLib/BlinkenOutput.c  83) #endif
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c  84)   else {
BlinkenLib/BlinkenOutput.c  85)     printf("illegal baudrate: %d\n", baud);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             86)     return 0;
BlinkenOutput.c             87)   }
BlinkenOutput.c             88) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c  89)   // parity
BlinkenLib/BlinkenOutput.c  90)   if (parity == 'n' || parity == 'N')
BlinkenLib/BlinkenOutput.c  91)     set |= 0;
BlinkenLib/BlinkenOutput.c  92)   else if (parity == 'e' || parity == 'E')
BlinkenLib/BlinkenOutput.c  93)     set |= PARENB;
BlinkenLib/BlinkenOutput.c  94)   else if (parity == 'o' || parity == 'O')
BlinkenLib/BlinkenOutput.c  95)     set |= PARENB | PARODD;
BlinkenLib/BlinkenOutput.c  96)   else {
BlinkenLib/BlinkenOutput.c  97)     printf("invalid parity: %c\n", parity);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c             98)     return 0;
BlinkenOutput.c             99)   }
BlinkenOutput.c            100) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 101)   // data bits
BlinkenLib/BlinkenOutput.c 102)   if (data == 5)
BlinkenLib/BlinkenOutput.c 103)     set |= CS5;
BlinkenLib/BlinkenOutput.c 104)   else if (data == 6)
BlinkenLib/BlinkenOutput.c 105)     set |= CS6;
BlinkenLib/BlinkenOutput.c 106)   else if (data == 7)
BlinkenLib/BlinkenOutput.c 107)     set |= CS7;
BlinkenLib/BlinkenOutput.c 108)   else if (data == 8)
BlinkenLib/BlinkenOutput.c 109)     set |= CS8;
BlinkenLib/BlinkenOutput.c 110)   else {
BlinkenLib/BlinkenOutput.c 111)     printf("illegal number of data bits: %d\n", data);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            112)     return 0;
BlinkenOutput.c            113)   }
BlinkenOutput.c            114) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 115)   // stop bits
BlinkenLib/BlinkenOutput.c 116)   if (stop == 1)
BlinkenLib/BlinkenOutput.c 117)     set |= 0;
BlinkenLib/BlinkenOutput.c 118)   else if (stop == 2)
BlinkenLib/BlinkenOutput.c 119)     set |= CSTOPB;
BlinkenLib/BlinkenOutput.c 120)   else {
BlinkenLib/BlinkenOutput.c 121)     printf("illegal number of stop bits: %d\n", stop);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            122)     return 0;
BlinkenOutput.c            123)   }
BlinkenOutput.c            124) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 125)   // success
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            126)   *settings = set;
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 127)   *speed = sp;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            128)   return 1;
BlinkenOutput.c            129) }
BlinkenOutput.c            130) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 131) // convert serial settings to text
BlinkenLib/BlinkenOutput.c 132) static void serial_settings_to_str(int settings, char *buf,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      133)                                    unsigned int maxlen) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            134)   int baud, data, stop;
BlinkenOutput.c            135)   char parity;
BlinkenOutput.c            136) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 137)   // baud rate
BlinkenLib/BlinkenOutput.c 138)   if (settings & B300)
BlinkenLib/BlinkenOutput.c 139)     baud = 300;
BlinkenLib/BlinkenOutput.c 140)   else if (settings & B600)
BlinkenLib/BlinkenOutput.c 141)     baud = 600;
BlinkenLib/BlinkenOutput.c 142)   else if (settings & B1200)
BlinkenLib/BlinkenOutput.c 143)     baud = 1200;
BlinkenLib/BlinkenOutput.c 144)   else if (settings & B2400)
BlinkenLib/BlinkenOutput.c 145)     baud = 2400;
BlinkenLib/BlinkenOutput.c 146)   else if (settings & B4800)
BlinkenLib/BlinkenOutput.c 147)     baud = 4800;
BlinkenLib/BlinkenOutput.c 148)   else if (settings & B9600)
BlinkenLib/BlinkenOutput.c 149)     baud = 9600;
BlinkenLib/BlinkenOutput.c 150)   else if (settings & B19200)
BlinkenLib/BlinkenOutput.c 151)     baud = 19200;
BlinkenLib/BlinkenOutput.c 152)   else if (settings & B38400)
BlinkenLib/BlinkenOutput.c 153)     baud = 38400;
BlinkenLib/BlinkenOutput.c 154)   else if (settings & B57600)
BlinkenLib/BlinkenOutput.c 155)     baud = 57600;
BlinkenLib/BlinkenOutput.c 156)   else if (settings & B115200)
BlinkenLib/BlinkenOutput.c 157)     baud = 115200;
BlinkenLib/BlinkenOutput.c 158)   else
BlinkenLib/BlinkenOutput.c 159)     baud = 0;
BlinkenLib/BlinkenOutput.c 160) 
BlinkenLib/BlinkenOutput.c 161)   // parity
BlinkenLib/BlinkenOutput.c 162)   if (settings & PARENB)
BlinkenLib/BlinkenOutput.c 163)     if (settings & PARODD)
BlinkenLib/BlinkenOutput.c 164)       parity = 'O';
BlinkenLib/BlinkenOutput.c 165)     else
BlinkenLib/BlinkenOutput.c 166)       parity = 'E';
BlinkenLib/BlinkenOutput.c 167)   else
BlinkenLib/BlinkenOutput.c 168)     parity = 'N';
BlinkenLib/BlinkenOutput.c 169) 
BlinkenLib/BlinkenOutput.c 170)   // data bits
BlinkenLib/BlinkenOutput.c 171)   if (settings & CS5)
BlinkenLib/BlinkenOutput.c 172)     data = 5;
BlinkenLib/BlinkenOutput.c 173)   else if (settings & CS6)
BlinkenLib/BlinkenOutput.c 174)     data = 6;
BlinkenLib/BlinkenOutput.c 175)   else if (settings & CS7)
BlinkenLib/BlinkenOutput.c 176)     data = 7;
BlinkenLib/BlinkenOutput.c 177)   else if (settings & CS8)
BlinkenLib/BlinkenOutput.c 178)     data = 8;
BlinkenLib/BlinkenOutput.c 179)   else
BlinkenLib/BlinkenOutput.c 180)     data = 0;
BlinkenLib/BlinkenOutput.c 181) 
BlinkenLib/BlinkenOutput.c 182)   // stop bits
BlinkenLib/BlinkenOutput.c 183)   if (settings & CSTOPB)
BlinkenLib/BlinkenOutput.c 184)     stop = 2;
BlinkenLib/BlinkenOutput.c 185)   else
BlinkenLib/BlinkenOutput.c 186)     stop = 1;
BlinkenLib/BlinkenOutput.c 187) 
BlinkenLib/BlinkenOutput.c 188)   snprintf(buf, maxlen, "%d,%c,%d,%d", baud, parity, data, stop);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            189) }
BlinkenOutput.c            190) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 191) // set serial settings for fd
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      192) static int serial_settings_set(int fd, int settings, int speed) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            193)   struct termios tio;
BlinkenOutput.c            194) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 195)   // set port settings
BlinkenLib/BlinkenOutput.c 196)   bzero(&tio, sizeof(tio));
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            197)   tio.c_cflag = CLOCAL | HUPCL | CREAD | settings;
BlinkenOutput.c            198)   tio.c_iflag = IGNBRK | IGNPAR;
BlinkenOutput.c            199)   tio.c_oflag = 0;
BlinkenOutput.c            200)   tio.c_lflag = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 201)   tio.c_cc[VTIME] = 10; // 1 sec timeout
BlinkenLib/BlinkenOutput.c 202)   tio.c_cc[VMIN] = 0;   // return on single char read
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 203) 
Stefan Schuermans Makefile fixed for MAC OS X...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 204) #ifdef BLINKENLIB_CFG_OSX
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 205)   if (cfsetspeed(&tio, speed) == -1) {
BlinkenLib/BlinkenOutput.c 206)     printf("cfsetspeed: error: %s\n", strerror(errno));
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 207)     return 0;
BlinkenLib/BlinkenOutput.c 208)   }
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      209) #else  // #ifdef BLINKENLIB_CFG_OSX
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 210)   tio.c_cflag |= speed;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 211) #endif // #ifdef BLINKENLIB_CFG_OSX
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 212) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 213)   if (tcsetattr(fd, TCSANOW, &tio) == -1) {
BlinkenLib/BlinkenOutput.c 214)     printf("tcsetattr: error: %s\n", strerror(errno));
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            215)     return 0;
BlinkenOutput.c            216)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 217)   // success
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            218)   return 1;
BlinkenOutput.c            219) }
BlinkenOutput.c            220) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 221) // receive frames from socket and output them
BlinkenLib/BlinkenOutput.c 222) // dev_fd may be -1 for not doing anything with device
BlinkenLib/BlinkenOutput.c 223) // returns error code (not for device-errors, 0 for success)
BlinkenLib/BlinkenOutput.c 224) static int recv_and_out(SOCKET udpSocket, int dev_fd,
BlinkenLib/BlinkenOutput.c 225)                         int *p_device_output_active,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 226)                         unsigned int min_interval_ms,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      227)                         unsigned int format_change, unsigned int format_height,
tools/BlinkenOutput.c      228)                         unsigned int format_width, unsigned int format_channels,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 229)                         unsigned int format_colors, etBlinkenProto proto,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      230)                         int use_msecs, unsigned int msecs) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            231)   fd_set readFds, errFds;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 232)   stBlinkenFrame *pFrame;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      233)   char buffer[65536]; // 64kB is more than maximum UDP size
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 234)   int maxFd, len, dev_eof, out_ok;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 235)   struct timeval start, timeout, *p_timeout, end;
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 236)   struct timeval out_last, out_now;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            237) 
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            238)   dev_eof = 0;
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 239)   gettimeofday(&out_last, NULL);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 240)   for (;;) {
BlinkenLib/BlinkenOutput.c 241)     // wait for next frame
BlinkenLib/BlinkenOutput.c 242)     FD_ZERO(&readFds);
BlinkenLib/BlinkenOutput.c 243)     FD_SET(udpSocket, &readFds);
BlinkenLib/BlinkenOutput.c 244)     if (dev_fd != -1 && !dev_eof)
BlinkenLib/BlinkenOutput.c 245)       FD_SET(dev_fd, &readFds);
BlinkenLib/BlinkenOutput.c 246)     FD_ZERO(&errFds);
BlinkenLib/BlinkenOutput.c 247)     FD_SET(udpSocket, &errFds);
BlinkenLib/BlinkenOutput.c 248)     if (dev_fd != -1)
BlinkenLib/BlinkenOutput.c 249)       FD_SET(dev_fd, &errFds);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            250)     maxFd = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 251)     if (udpSocket > maxFd)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            252)       maxFd = udpSocket;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 253)     if (dev_fd != -1 && dev_fd > maxFd)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            254)       maxFd = dev_fd;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      255)     if (use_msecs) // timeout
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            256)     {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 257)       gettimeofday(&start, NULL);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            258)       timeout.tv_sec = msecs / 1000;
BlinkenOutput.c            259)       timeout.tv_usec = msecs % 1000 * 1000;
BlinkenOutput.c            260)       p_timeout = &timeout;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 261)     } else
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            262)       p_timeout = NULL;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      263)     if (select(maxFd + 1, &readFds, NULL, &errFds, p_timeout) < 0) // error
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            264)     {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 265)       printf("error during select: %s\n", strerror(errno));
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            266)       return -1;
BlinkenOutput.c            267)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 268)     // error on socket or device
BlinkenLib/BlinkenOutput.c 269)     if (FD_ISSET(udpSocket, &errFds)) {
BlinkenLib/BlinkenOutput.c 270)       printf("error on socket\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            271)       return -1;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            272)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 273)     if (dev_fd != -1 && FD_ISSET(dev_fd, &errFds)) {
BlinkenLib/BlinkenOutput.c 274)       if (*p_device_output_active)
BlinkenLib/BlinkenOutput.c 275)         printf("error on device\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            276)       break;
BlinkenOutput.c            277)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 278)     // received frame
BlinkenLib/BlinkenOutput.c 279)     if (FD_ISSET(udpSocket, &readFds)) {
BlinkenLib/BlinkenOutput.c 280)       // fetch data
BlinkenLib/BlinkenOutput.c 281)       len = recv(udpSocket, buffer, sizeof(buffer), 0);
BlinkenLib/BlinkenOutput.c 282)       if (len < 0) {
BlinkenLib/BlinkenOutput.c 283)         printf("could not read from socket\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            284)         return -1;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            285)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 286)       if (len == 0)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            287)         return -1;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            288) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 289)       // get frame from data
BlinkenLib/BlinkenOutput.c 290)       pFrame = BlinkenFrameFromNetwork(buffer, len, NULL);
BlinkenLib/BlinkenOutput.c 291)       if (pFrame != NULL) {
BlinkenLib/BlinkenOutput.c 292)         // change format
BlinkenLib/BlinkenOutput.c 293)         if (format_change)
BlinkenLib/BlinkenOutput.c 294)           BlinkenFrameResize(pFrame, format_height, format_width,
BlinkenLib/BlinkenOutput.c 295)                              format_channels, format_colors - 1);
BlinkenLib/BlinkenOutput.c 296) 
BlinkenLib/BlinkenOutput.c 297)         // create output data from frame
BlinkenLib/BlinkenOutput.c 298)         len = BlinkenFrameToNetwork(pFrame, proto, buffer, sizeof(buffer));
BlinkenLib/BlinkenOutput.c 299) 
BlinkenLib/BlinkenOutput.c 300)         // free frame
BlinkenLib/BlinkenOutput.c 301)         BlinkenFrameFree(pFrame);
BlinkenLib/BlinkenOutput.c 302) 
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 303)         // check if minimum interval between output frames is met
BlinkenLib/BlinkenOutput.c 304)         gettimeofday(&out_now, NULL);
Stefan Schuermans fix sign in comparison for...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 305)         if (out_now.tv_sec > out_last.tv_sec - (int)min_interval_ms / 1000)
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 306)           out_ok = 1;
BlinkenLib/BlinkenOutput.c 307)         else if ((out_now.tv_sec - out_last.tv_sec) * 1000 +
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      308)                      ((long)out_now.tv_usec - (long)out_last.tv_usec) / 1000 >
Stefan Schuermans fix sign in comparison for...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 309)                  (long)min_interval_ms)
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 310)           out_ok = 1;
BlinkenLib/BlinkenOutput.c 311)         else
BlinkenLib/BlinkenOutput.c 312)           out_ok = 0;
BlinkenLib/BlinkenOutput.c 313) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 314)         // output data to device
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 315)         if (dev_fd != -1 && len > 0 && out_ok) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 316)           if (write(dev_fd, buffer, len) != len) {
BlinkenLib/BlinkenOutput.c 317)             if (*p_device_output_active)
BlinkenLib/BlinkenOutput.c 318)               printf("error writing to device\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            319)             break;
BlinkenOutput.c            320)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 321)           // message: output to device was restarted
BlinkenLib/BlinkenOutput.c 322)           if (!*p_device_output_active)
BlinkenLib/BlinkenOutput.c 323)             printf("restarted output to device...\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            324)           *p_device_output_active = 1;
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 325)           // remember last time of output
BlinkenLib/BlinkenOutput.c 326)           out_last = out_now;
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            327)         }
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            328)       }
BlinkenOutput.c            329)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 330)     // received data from device
BlinkenLib/BlinkenOutput.c 331)     if (dev_fd != -1 && FD_ISSET(dev_fd, &readFds)) {
BlinkenLib/BlinkenOutput.c 332)       // read data
BlinkenLib/BlinkenOutput.c 333)       len = read(dev_fd, buffer, sizeof(buffer));
BlinkenLib/BlinkenOutput.c 334)       if (len < 0) {
BlinkenLib/BlinkenOutput.c 335)         if (*p_device_output_active)
BlinkenLib/BlinkenOutput.c 336)           printf("error reading from device\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            337)         break;
BlinkenOutput.c            338)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 339)       if (len == 0)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            340)         dev_eof = 1;
BlinkenOutput.c            341)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 342)     // using time limit
BlinkenLib/BlinkenOutput.c 343)     if (use_msecs) {
BlinkenLib/BlinkenOutput.c 344)       // get time elapsed
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            345)       int sec, usec;
BlinkenOutput.c            346)       unsigned int msec;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 347)       gettimeofday(&end, NULL);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            348)       sec = end.tv_sec - start.tv_sec;
BlinkenOutput.c            349)       usec = end.tv_usec - start.tv_usec;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 350)       if (usec < 0) {
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            351)         usec += 1000000;
BlinkenOutput.c            352)         sec--;
BlinkenOutput.c            353)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 354)       if (usec < 0)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            355)         usec = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 356)       if (sec < 0)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            357)         sec = 0;
BlinkenOutput.c            358)       msec = sec * 1000 + usec / 1000;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 359)       // more than rest of timeout (or exact match)
BlinkenLib/BlinkenOutput.c 360)       if (msec >= msecs)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            361)         break;
BlinkenOutput.c            362)       msecs -= msec;
BlinkenOutput.c            363)     }
BlinkenOutput.c            364) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      365)   } // for( ; ; )
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            366) 
BlinkenOutput.c            367)   return 0;
BlinkenOutput.c            368) }
BlinkenOutput.c            369) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 370) // open device and output frames
BlinkenLib/BlinkenOutput.c 371) // returns error code (not for device-errors, 0 for success)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      372) static int
tools/BlinkenOutput.c      373) open_and_output(SOCKET udpSocket, char *device, int *p_device_output_active,
tools/BlinkenOutput.c      374)                 int serial_settings_change, int serial_settings,
tools/BlinkenOutput.c      375)                 int serial_speed, unsigned int min_interval_ms,
tools/BlinkenOutput.c      376)                 unsigned int format_change, unsigned int format_height,
tools/BlinkenOutput.c      377)                 unsigned int format_width, unsigned int format_channels,
tools/BlinkenOutput.c      378)                 unsigned int format_colors, etBlinkenProto proto) {
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            379)   int dev_fd, err;
BlinkenOutput.c            380)   char txt[64];
BlinkenOutput.c            381) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 382)   // open device
BlinkenLib/BlinkenOutput.c 383)   dev_fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK);
BlinkenLib/BlinkenOutput.c 384)   if (dev_fd == -1) {
BlinkenLib/BlinkenOutput.c 385)     if (*p_device_output_active)
BlinkenLib/BlinkenOutput.c 386)       printf("could not open \"%s\": error: %s\n", device, strerror(errno));
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            387)     return 0;
BlinkenOutput.c            388)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 389)   // setup serial port
BlinkenLib/BlinkenOutput.c 390)   if (serial_settings_change) {
BlinkenLib/BlinkenOutput.c 391)     if (!serial_settings_set(dev_fd, serial_settings, serial_speed)) {
BlinkenLib/BlinkenOutput.c 392)       if (*p_device_output_active) {
BlinkenLib/BlinkenOutput.c 393)         serial_settings_to_str(serial_settings, txt, sizeof(txt));
BlinkenLib/BlinkenOutput.c 394)         printf("could not set serial port to \"%s\"\n", txt);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            395)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 396)       close(dev_fd);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            397)       return 0;
BlinkenOutput.c            398)     }
BlinkenOutput.c            399)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 400)   // receive frames and output to device
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      401)   err = recv_and_out(udpSocket, dev_fd, p_device_output_active, min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 402)                      format_change, format_height, format_width,
BlinkenLib/BlinkenOutput.c 403)                      format_channels, format_colors, proto, 0, 0);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            404) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 405)   // close device
BlinkenLib/BlinkenOutput.c 406)   close(dev_fd);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            407) 
BlinkenOutput.c            408)   return err;
BlinkenOutput.c            409) }
BlinkenOutput.c            410) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 411) // open device and output frames in a loop
BlinkenLib/BlinkenOutput.c 412) // returns error code (not for device-errors, 0 for success)
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      413) static int
tools/BlinkenOutput.c      414) open_and_output_loop(SOCKET udpSocket, char *device, int serial_settings_change,
tools/BlinkenOutput.c      415)                      int serial_settings, int serial_speed, int reopen_device,
tools/BlinkenOutput.c      416)                      unsigned int reopen_device_ms,
tools/BlinkenOutput.c      417)                      unsigned int min_interval_ms, unsigned int format_change,
tools/BlinkenOutput.c      418)                      unsigned int format_height, unsigned int format_width,
tools/BlinkenOutput.c      419)                      unsigned int format_channels, unsigned int format_colors,
tools/BlinkenOutput.c      420)                      etBlinkenProto proto) {
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            421)   int device_output_active, err;
BlinkenOutput.c            422) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 423)   printf("receiving frames and outputting them to \"%s\"...\n", device);
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            424)   device_output_active = 1;
BlinkenOutput.c            425) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 426)   for (;;) {
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            427) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 428)     // try to open device and output frames
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      429)     err = open_and_output(udpSocket, device, &device_output_active,
tools/BlinkenOutput.c      430)                           serial_settings_change, serial_settings, serial_speed,
tools/BlinkenOutput.c      431)                           min_interval_ms, format_change, format_height,
tools/BlinkenOutput.c      432)                           format_width, format_channels, format_colors, proto);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 433)     if (err != 0 || !reopen_device)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            434)       break;
BlinkenOutput.c            435) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 436)     // output to device stopped
BlinkenLib/BlinkenOutput.c 437)     if (device_output_active)
BlinkenLib/BlinkenOutput.c 438)       printf("output to device stopped...\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            439)     device_output_active = 0;
BlinkenOutput.c            440) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 441)     // only fetch data from socket for a short time
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      442)     err = recv_and_out(udpSocket, -1, &device_output_active, min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 443)                        format_change, format_height, format_width,
BlinkenLib/BlinkenOutput.c 444)                        format_channels, format_colors, proto, 1,
BlinkenLib/BlinkenOutput.c 445)                        reopen_device_ms);
BlinkenLib/BlinkenOutput.c 446)     if (err != 0)
Stefan Schuermans fix double semicolon

Stefan Schuermans authored 7 years ago

BlinkenLib/BlinkenOutput.c 447)       break;
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            448)   }
BlinkenOutput.c            449) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 450)   // output to device finshed
BlinkenLib/BlinkenOutput.c 451)   if (device_output_active)
BlinkenLib/BlinkenOutput.c 452)     printf("output to device finished...\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            453)   device_output_active = 0;
BlinkenOutput.c            454) 
BlinkenOutput.c            455)   return err;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            456) }
BlinkenOutput.c            457) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      458) int main(int argCnt, char **args) {
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 459)   int i, bound, serial_settings, serial_speed;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutput.c            460)   SOCKET udpSocket;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            461)   etBlinkenProto proto;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 462)   unsigned int format_change, format_height, format_width, format_channels,
BlinkenLib/BlinkenOutput.c 463)       format_colors;
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 464)   unsigned int height, width, channels, colors;
BlinkenLib/BlinkenOutput.c 465)   unsigned int reopen_device_ms, min_interval_ms;
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            466)   int serial_settings_change, reopen_device;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            467)   char txt[64];
BlinkenOutput.c            468)   unsigned short port;
BlinkenOutput.c            469)   struct sockaddr_in addr;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 470)   char *device;
BlinkenLib/BlinkenOutput.c 471) 
BlinkenLib/BlinkenOutput.c 472)   // print info
BlinkenLib/BlinkenOutput.c 473)   printf("BlinkenLib - BlinkenOutput\n"
BlinkenLib/BlinkenOutput.c 474)          "version %d.%d.%d\n"
BlinkenLib/BlinkenOutput.c 475)          "config " BLINKENLIB_CONFIG "\n"
Stefan Schuermans update email address of author

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 476)          "Copyright 2004-2014 Stefan Schuermans <stefan@schuermans.info>\n"
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 477)          "Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html\n"
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 478)          "a blinkenarea.org project\n\n",
BlinkenLib/BlinkenOutput.c 479)          BLINKENLIB_VERSION_MAJOR, BLINKENLIB_VERSION_MINOR,
BlinkenLib/BlinkenOutput.c 480)          BLINKENLIB_VERSION_REVISION);
BlinkenLib/BlinkenOutput.c 481) 
BlinkenLib/BlinkenOutput.c 482)   // print syntax
BlinkenLib/BlinkenOutput.c 483)   if (argCnt <= 1) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      484)     printf(
tools/BlinkenOutput.c      485)         "syntax: %s <parameter> [...]\n\n"
tools/BlinkenOutput.c      486)         "parameters:\n"
tools/BlinkenOutput.c      487)         "  -l [<ip>:]<port>\n"
tools/BlinkenOutput.c      488)         "     local address (defaults to 0.0.0.0:2323)\n"
tools/BlinkenOutput.c      489)         "     must occur before -r, may only occur once\n"
tools/BlinkenOutput.c      490)         "  -r <ip>[:<port>]\n"
tools/BlinkenOutput.c      491)         "     remote addess (defaults to every remote address)\n"
tools/BlinkenOutput.c      492)         "  -p [BLP|EBLP|MCUF]\n"
tools/BlinkenOutput.c      493)         "     protocol to output frames in (defaults to MCUF)\n"
tools/BlinkenOutput.c      494)         "  -f <width>x<height>-<channels>/<colors>\n"
tools/BlinkenOutput.c      495)         "     format to output frames in (defaults to no change)\n"
tools/BlinkenOutput.c      496)         "  -d <device>\n"
tools/BlinkenOutput.c      497)         "     device to output frames to (defaults to \"/dev/null\")\n"
tools/BlinkenOutput.c      498)         "  -s <baud-rate>,<parity>,<data-bits>,<stop-bits>\n"
tools/BlinkenOutput.c      499)         "     settings to use for serial devices (defaults to no change)\n"
tools/BlinkenOutput.c      500)         "  -o <milliseconds>\n"
tools/BlinkenOutput.c      501)         "     reopen device after short time on error (defaults to not "
tools/BlinkenOutput.c      502)         "reopen)\n"
tools/BlinkenOutput.c      503)         "  -i <milliseconds>\n"
tools/BlinkenOutput.c      504)         "     minimum interval between two frames on output (defaults to 0)\n"
tools/BlinkenOutput.c      505)         "\n",
tools/BlinkenOutput.c      506)         args[0]);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            507)     return 0;
BlinkenOutput.c            508)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 509)   // create udp socket
BlinkenLib/BlinkenOutput.c 510)   udpSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
BlinkenLib/BlinkenOutput.c 511)   if (udpSocket == INVALID_SOCKET) {
BlinkenLib/BlinkenOutput.c 512)     printf("cannot create UDP socket\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            513)     return -1;
BlinkenOutput.c            514)   }
BlinkenOutput.c            515)   bound = 0;
BlinkenOutput.c            516) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 517)   // process parameters
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            518)   proto = BlinkenProtoMcuf;
BlinkenOutput.c            519)   format_change = 0;
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            520)   format_height = 0;
BlinkenOutput.c            521)   format_width = 0;
BlinkenOutput.c            522)   format_channels = 0;
BlinkenOutput.c            523)   format_colors = 0;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            524)   device = "/dev/null";
Christian Heimke BlinkenLib v.0.5.3 (2007-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            525)   serial_settings = 0;
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutput.c 526)   serial_speed = 0;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            527)   serial_settings_change = 0;
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            528)   reopen_device = 0;
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 529)   min_interval_ms = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 530)   for (i = 1; i < argCnt; i++) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            531) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 532)     // local address
BlinkenLib/BlinkenOutput.c 533)     if (strcmp(args[i], "-l") == 0) {
BlinkenLib/BlinkenOutput.c 534)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            535)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 536)         if (sscanf(args[i], "%32[0-9.]:%hu", txt, &port) == 2) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            537)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 538)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutput.c 539)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutput.c 540)           if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 541)             printf("could not set local address to \"%s\"\n", args[i]);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            542)           else
BlinkenOutput.c            543)             bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 544)         } else if (sscanf(args[i], "%hu", &port) == 1) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            545)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 546)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutput.c 547)           addr.sin_addr.s_addr = htonl(INADDR_ANY);
BlinkenLib/BlinkenOutput.c 548)           if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 549)             printf("could not set local address to \"%s\"\n", args[i]);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            550)           else
BlinkenOutput.c            551)             bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 552)         } else
BlinkenLib/BlinkenOutput.c 553)           printf("invalid local address \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 554)       } else
BlinkenLib/BlinkenOutput.c 555)         printf("missing local address for \"-l\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            556)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 557)     // remote address
BlinkenLib/BlinkenOutput.c 558)     else if (strcmp(args[i], "-r") == 0) {
BlinkenLib/BlinkenOutput.c 559)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            560)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 561)         if (sscanf(args[i], "%32[0-9.]:%hu", txt, &port) == 2) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            562)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 563)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutput.c 564)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutput.c 565)           if (connect(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 566)             printf("could not set remote address to \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 567)         } else if (sscanf(args[i], "%32[0-9.]", txt) == 1) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            568)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 569)           addr.sin_port = htons(23230);
BlinkenLib/BlinkenOutput.c 570)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutput.c 571)           if (connect(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 572)             printf("could not set remote address to \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 573)         } else
BlinkenLib/BlinkenOutput.c 574)           printf("invalid remote address \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 575)       } else
BlinkenLib/BlinkenOutput.c 576)         printf("missing remote address for \"-r\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            577)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 578)     // protocol to output frames in
BlinkenLib/BlinkenOutput.c 579)     else if (strcmp(args[i], "-p") == 0) {
BlinkenLib/BlinkenOutput.c 580)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            581)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 582)         if (strcasecmp(args[i], "BLP") == 0)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            583)           proto = BlinkenProtoBlp;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 584)         else if (strcasecmp(args[i], "EBLP") == 0)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            585)           proto = BlinkenProtoEblp;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 586)         else if (strcasecmp(args[i], "MCUF") == 0)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            587)           proto = BlinkenProtoMcuf;
BlinkenOutput.c            588)         else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 589)           printf("unknown protocol \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 590)       } else
BlinkenLib/BlinkenOutput.c 591)         printf("missing protocol for \"-p\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            592)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 593)     // format to output frames in
BlinkenLib/BlinkenOutput.c 594)     else if (strcmp(args[i], "-f") == 0) {
BlinkenLib/BlinkenOutput.c 595)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            596)         i++;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      597)         if (sscanf(args[i], "%ux%u-%u/%u", &width, &height, &channels,
tools/BlinkenOutput.c      598)                    &colors) == 4 &&
tools/BlinkenOutput.c      599)             width > 0 && width < 1000 && height > 0 && height < 1000 &&
tools/BlinkenOutput.c      600)             channels > 0 && channels < 20 && colors > 1 && colors <= 256) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            601)           format_change = 1;
BlinkenOutput.c            602)           format_height = height;
BlinkenOutput.c            603)           format_width = width;
BlinkenOutput.c            604)           format_channels = channels;
BlinkenOutput.c            605)           format_colors = colors;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 606)         } else
BlinkenLib/BlinkenOutput.c 607)           printf("invalid frame format \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 608)       } else
BlinkenLib/BlinkenOutput.c 609)         printf("missing frame format for \"-r\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            610)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 611)     // device to output frames to
BlinkenLib/BlinkenOutput.c 612)     else if (strcmp(args[i], "-d") == 0) {
BlinkenLib/BlinkenOutput.c 613)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            614)         i++;
BlinkenOutput.c            615)         device = args[i];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 616)       } else
BlinkenLib/BlinkenOutput.c 617)         printf("missing device name for \"-d\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            618)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 619)     // settings for serial output devices
BlinkenLib/BlinkenOutput.c 620)     else if (strcmp(args[i], "-s") == 0) {
BlinkenLib/BlinkenOutput.c 621)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            622)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 623)         if (serial_settings_parse(args[i], &serial_settings, &serial_speed)) {
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            624)           serial_settings_change = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 625)         } else
BlinkenLib/BlinkenOutput.c 626)           printf("invalid serial settings \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 627)       } else
BlinkenLib/BlinkenOutput.c 628)         printf("missing serial settings for \"-s\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            629)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 630)     // reopen device on error after some time
BlinkenLib/BlinkenOutput.c 631)     else if (strcmp(args[i], "-o") == 0) {
BlinkenLib/BlinkenOutput.c 632)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            633)         i++;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      634)         if (sscanf(args[i], "%u", &reopen_device_ms) == 1 &&
tools/BlinkenOutput.c      635)             reopen_device_ms >= 1)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            636)           reopen_device = 1;
BlinkenOutput.c            637)         else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 638)           printf("invalid number of milliseconds \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 639)       } else
BlinkenLib/BlinkenOutput.c 640)         printf("missing time for \"-o\"\n");
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            641)     }
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 642)     // minimum interval between two frame on output
BlinkenLib/BlinkenOutput.c 643)     else if (strcmp(args[i], "-i") == 0) {
BlinkenLib/BlinkenOutput.c 644)       if (i + 1 < argCnt) {
BlinkenLib/BlinkenOutput.c 645)         i++;
BlinkenLib/BlinkenOutput.c 646)         if (sscanf(args[i], "%u", &min_interval_ms) != 1) {
BlinkenLib/BlinkenOutput.c 647)           min_interval_ms = 0;
BlinkenLib/BlinkenOutput.c 648)           printf("invalid number of milliseconds \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 649)         }
BlinkenLib/BlinkenOutput.c 650)       } else
BlinkenLib/BlinkenOutput.c 651)         printf("missing time for \"-i\"\n");
BlinkenLib/BlinkenOutput.c 652)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 653)     // unknown parameter
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            654)     else
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      655)       printf("unknown parameter \"%s\", call without parameters to get help\n",
tools/BlinkenOutput.c      656)              args[i]);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            657) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      658)   } // for( i ...
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            659) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 660)   // try to bind if not bound
BlinkenLib/BlinkenOutput.c 661)   if (!bound) {
BlinkenLib/BlinkenOutput.c 662)     printf("no local address to receive frames on,\n"
BlinkenLib/BlinkenOutput.c 663)            "  using default local address \"0.0.0.0:2323\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            664)     addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 665)     addr.sin_port = htons(2323);
BlinkenLib/BlinkenOutput.c 666)     addr.sin_addr.s_addr = htonl(INADDR_ANY);
BlinkenLib/BlinkenOutput.c 667)     if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) == 0)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            668)       bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 669)     else {
BlinkenLib/BlinkenOutput.c 670)       printf("could not set local address to \"0.0.0.0:2323\"\n");
BlinkenLib/BlinkenOutput.c 671)       close(udpSocket);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            672)       return -1;
BlinkenOutput.c            673)     }
BlinkenOutput.c            674)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 675)   // open device and output frames in a loop
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutput.c      676)   open_and_output_loop(
tools/BlinkenOutput.c      677)       udpSocket, device, serial_settings_change, serial_settings, serial_speed,
tools/BlinkenOutput.c      678)       reopen_device, reopen_device_ms, min_interval_ms, format_change,
tools/BlinkenOutput.c      679)       format_height, format_width, format_channels, format_colors, proto);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 680) 
BlinkenLib/BlinkenOutput.c 681)   // close socket
BlinkenLib/BlinkenOutput.c 682)   close(udpSocket);