c9469b64fc3933d0565ffba8a45be8a39df6b927
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) 
BlinkenOutput.c              8) #include <errno.h>
BlinkenOutput.c              9) #include <fcntl.h>
BlinkenOutput.c             10) #include <stdlib.h>
BlinkenOutput.c             11) #include <stdio.h>
BlinkenOutput.c             12) #include <string.h>
BlinkenOutput.c             13) #include <termios.h>
BlinkenOutput.c             14) #include <time.h>
BlinkenOutput.c             15) #include <unistd.h>
BlinkenOutput.c             16) #include <arpa/inet.h>
BlinkenOutput.c             17) #include <netinet/in.h>
BlinkenOutput.c             18) #include <sys/types.h>
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c             20) #include <sys/socket.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
BlinkenLib/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) {
BlinkenOutput.c             27)   int baud, data, stop;
BlinkenOutput.c             28)   char parity;
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c  31)   // split and parse settings string
BlinkenLib/BlinkenOutput.c  32)   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             33)     return 0;
BlinkenOutput.c             34) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c  35)   // baud rate
Stefan Schuermans more baudrates for BlinkenO...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c  36) #define BAUD(rate) else if (baud == rate) sp = B ## rate;
BlinkenLib/BlinkenOutput.c  37)   if (0) {}
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,
BlinkenLib/BlinkenOutput.c 133)                                    unsigned int maxlen)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 138)   // baud rate
BlinkenLib/BlinkenOutput.c 139)   if (settings & B300)
BlinkenLib/BlinkenOutput.c 140)     baud = 300;
BlinkenLib/BlinkenOutput.c 141)   else if (settings & B600)
BlinkenLib/BlinkenOutput.c 142)     baud = 600;
BlinkenLib/BlinkenOutput.c 143)   else if (settings & B1200)
BlinkenLib/BlinkenOutput.c 144)     baud = 1200;
BlinkenLib/BlinkenOutput.c 145)   else if (settings & B2400)
BlinkenLib/BlinkenOutput.c 146)     baud = 2400;
BlinkenLib/BlinkenOutput.c 147)   else if (settings & B4800)
BlinkenLib/BlinkenOutput.c 148)     baud = 4800;
BlinkenLib/BlinkenOutput.c 149)   else if (settings & B9600)
BlinkenLib/BlinkenOutput.c 150)     baud = 9600;
BlinkenLib/BlinkenOutput.c 151)   else if (settings & B19200)
BlinkenLib/BlinkenOutput.c 152)     baud = 19200;
BlinkenLib/BlinkenOutput.c 153)   else if (settings & B38400)
BlinkenLib/BlinkenOutput.c 154)     baud = 38400;
BlinkenLib/BlinkenOutput.c 155)   else if (settings & B57600)
BlinkenLib/BlinkenOutput.c 156)     baud = 57600;
BlinkenLib/BlinkenOutput.c 157)   else if (settings & B115200)
BlinkenLib/BlinkenOutput.c 158)     baud = 115200;
BlinkenLib/BlinkenOutput.c 159)   else
BlinkenLib/BlinkenOutput.c 160)     baud = 0;
BlinkenLib/BlinkenOutput.c 161) 
BlinkenLib/BlinkenOutput.c 162)   // parity
BlinkenLib/BlinkenOutput.c 163)   if (settings & PARENB)
BlinkenLib/BlinkenOutput.c 164)     if (settings & PARODD)
BlinkenLib/BlinkenOutput.c 165)       parity = 'O';
BlinkenLib/BlinkenOutput.c 166)     else
BlinkenLib/BlinkenOutput.c 167)       parity = 'E';
BlinkenLib/BlinkenOutput.c 168)   else
BlinkenLib/BlinkenOutput.c 169)     parity = 'N';
BlinkenLib/BlinkenOutput.c 170) 
BlinkenLib/BlinkenOutput.c 171)   // data bits
BlinkenLib/BlinkenOutput.c 172)   if (settings & CS5)
BlinkenLib/BlinkenOutput.c 173)     data = 5;
BlinkenLib/BlinkenOutput.c 174)   else if (settings & CS6)
BlinkenLib/BlinkenOutput.c 175)     data = 6;
BlinkenLib/BlinkenOutput.c 176)   else if (settings & CS7)
BlinkenLib/BlinkenOutput.c 177)     data = 7;
BlinkenLib/BlinkenOutput.c 178)   else if (settings & CS8)
BlinkenLib/BlinkenOutput.c 179)     data = 8;
BlinkenLib/BlinkenOutput.c 180)   else
BlinkenLib/BlinkenOutput.c 181)     data = 0;
BlinkenLib/BlinkenOutput.c 182) 
BlinkenLib/BlinkenOutput.c 183)   // stop bits
BlinkenLib/BlinkenOutput.c 184)   if (settings & CSTOPB)
BlinkenLib/BlinkenOutput.c 185)     stop = 2;
BlinkenLib/BlinkenOutput.c 186)   else
BlinkenLib/BlinkenOutput.c 187)     stop = 1;
BlinkenLib/BlinkenOutput.c 188) 
BlinkenLib/BlinkenOutput.c 189)   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            190) }
BlinkenOutput.c            191) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 192) // set serial settings for fd
BlinkenLib/BlinkenOutput.c 193) 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            194) {
BlinkenOutput.c            195)   struct termios tio;
BlinkenOutput.c            196) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 203)   tio.c_cc[VTIME] = 10; // 1 sec timeout
BlinkenLib/BlinkenOutput.c 204)   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 205) 
Stefan Schuermans Makefile fixed for MAC OS X...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 207)   if (cfsetspeed(&tio, speed) == -1) {
BlinkenLib/BlinkenOutput.c 208)     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 209)     return 0;
BlinkenLib/BlinkenOutput.c 210)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            217)     return 0;
BlinkenOutput.c            218)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 228)                         unsigned int min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 229)                         unsigned int format_change,
BlinkenLib/BlinkenOutput.c 230)                         unsigned int format_height, unsigned int format_width,
BlinkenLib/BlinkenOutput.c 231)                         unsigned int format_channels,
BlinkenLib/BlinkenOutput.c 232)                         unsigned int format_colors, etBlinkenProto proto,
BlinkenLib/BlinkenOutput.c 233)                         int use_msecs, unsigned int msecs)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 236)   stBlinkenFrame *pFrame;
BlinkenLib/BlinkenOutput.c 237)   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 238)   int maxFd, len, dev_eof, out_ok;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            258)       maxFd = dev_fd;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            262)       timeout.tv_sec = msecs / 1000;
BlinkenOutput.c            263)       timeout.tv_usec = msecs % 1000 * 1000;
BlinkenOutput.c            264)       p_timeout = &timeout;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            266)       p_timeout = NULL;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 267)     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            268)     {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 269)       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            270)       return -1;
BlinkenOutput.c            271)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            280)       break;
BlinkenOutput.c            281)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 309)         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 310)           out_ok = 1;
BlinkenLib/BlinkenOutput.c 311)         else if ((out_now.tv_sec - out_last.tv_sec) * 1000 +
BlinkenLib/BlinkenOutput.c 312)                  ((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 313)                  (long)min_interval_ms)
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 314)           out_ok = 1;
BlinkenLib/BlinkenOutput.c 315)         else
BlinkenLib/BlinkenOutput.c 316)           out_ok = 0;
BlinkenLib/BlinkenOutput.c 317) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            323)             break;
BlinkenOutput.c            324)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            341)         break;
BlinkenOutput.c            342)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 346)     // using time limit
BlinkenLib/BlinkenOutput.c 347)     if (use_msecs) {
BlinkenLib/BlinkenOutput.c 348)       // get time elapsed
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            352)       sec = end.tv_sec - start.tv_sec;
BlinkenOutput.c            353)       usec = end.tv_usec - start.tv_usec;
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 += 1000000;
BlinkenOutput.c            356)         sec--;
BlinkenOutput.c            357)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            365)         break;
BlinkenOutput.c            366)       msecs -= msec;
BlinkenOutput.c            367)     }
BlinkenOutput.c            368) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            370) 
BlinkenOutput.c            371)   return 0;
BlinkenOutput.c            372) }
BlinkenOutput.c            373) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 374) // open device and output frames
BlinkenLib/BlinkenOutput.c 375) // returns error code (not for device-errors, 0 for success)
BlinkenLib/BlinkenOutput.c 376) static int open_and_output(SOCKET udpSocket, char *device,
BlinkenLib/BlinkenOutput.c 377)                            int *p_device_output_active,
BlinkenLib/BlinkenOutput.c 378)                            int serial_settings_change, int serial_settings,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 379)                            int serial_speed,
BlinkenLib/BlinkenOutput.c 380)                            unsigned int min_interval_ms,
BlinkenLib/BlinkenOutput.c 381)                            unsigned int format_change,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 382)                            unsigned int format_height,
BlinkenLib/BlinkenOutput.c 383)                            unsigned int format_width,
BlinkenLib/BlinkenOutput.c 384)                            unsigned int format_channels,
BlinkenLib/BlinkenOutput.c 385)                            unsigned int format_colors, etBlinkenProto proto)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            386) {
BlinkenOutput.c            387)   int dev_fd, err;
BlinkenOutput.c            388)   char txt[64];
BlinkenOutput.c            389) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 390)   // open device
BlinkenLib/BlinkenOutput.c 391)   dev_fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK);
BlinkenLib/BlinkenOutput.c 392)   if (dev_fd == -1) {
BlinkenLib/BlinkenOutput.c 393)     if (*p_device_output_active)
BlinkenLib/BlinkenOutput.c 394)       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            395)     return 0;
BlinkenOutput.c            396)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 397)   // setup serial port
BlinkenLib/BlinkenOutput.c 398)   if (serial_settings_change) {
BlinkenLib/BlinkenOutput.c 399)     if (!serial_settings_set(dev_fd, serial_settings, serial_speed)) {
BlinkenLib/BlinkenOutput.c 400)       if (*p_device_output_active) {
BlinkenLib/BlinkenOutput.c 401)         serial_settings_to_str(serial_settings, txt, sizeof(txt));
BlinkenLib/BlinkenOutput.c 402)         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            403)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            405)       return 0;
BlinkenOutput.c            406)     }
BlinkenOutput.c            407)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 408)   // receive frames and output to device
BlinkenLib/BlinkenOutput.c 409)   err = recv_and_out(udpSocket, dev_fd, p_device_output_active,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 410)                      min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            416) 
BlinkenOutput.c            417)   return err;
BlinkenOutput.c            418) }
BlinkenOutput.c            419) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 420) // open device and output frames in a loop
BlinkenLib/BlinkenOutput.c 421) // returns error code (not for device-errors, 0 for success)
BlinkenLib/BlinkenOutput.c 422) static int open_and_output_loop(SOCKET udpSocket, char *device,
BlinkenLib/BlinkenOutput.c 423)                                 int serial_settings_change,
BlinkenLib/BlinkenOutput.c 424)                                 int serial_settings, int serial_speed,
BlinkenLib/BlinkenOutput.c 425)                                 int reopen_device,
BlinkenLib/BlinkenOutput.c 426)                                 unsigned int reopen_device_ms,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 427)                                 unsigned int min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 428)                                 unsigned int format_change,
BlinkenLib/BlinkenOutput.c 429)                                 unsigned int format_height,
BlinkenLib/BlinkenOutput.c 430)                                 unsigned int format_width,
BlinkenLib/BlinkenOutput.c 431)                                 unsigned int format_channels,
BlinkenLib/BlinkenOutput.c 432)                                 unsigned int format_colors,
BlinkenLib/BlinkenOutput.c 433)                                 etBlinkenProto proto)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            434) {
BlinkenOutput.c            435)   int device_output_active, err;
BlinkenOutput.c            436) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 437)   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            438)   device_output_active = 1;
BlinkenOutput.c            439) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 442)     // try to open device and output frames
BlinkenLib/BlinkenOutput.c 443)     err = open_and_output(udpSocket, device,
BlinkenLib/BlinkenOutput.c 444)                           &device_output_active,
BlinkenLib/BlinkenOutput.c 445)                           serial_settings_change, serial_settings,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 446)                           serial_speed, min_interval_ms,
BlinkenLib/BlinkenOutput.c 447)                           format_change, format_height,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 448)                           format_width, format_channels, format_colors,
BlinkenLib/BlinkenOutput.c 449)                           proto);
BlinkenLib/BlinkenOutput.c 450)     if (err != 0 || !reopen_device)
Christian Heimke BlinkenLib v.0.5.1 (2005-12...

Christian Heimke authored 13 years ago

BlinkenOutput.c            451)       break;
BlinkenOutput.c            452) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            456)     device_output_active = 0;
BlinkenOutput.c            457) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 458)     // only fetch data from socket for a short time
BlinkenLib/BlinkenOutput.c 459)     err = recv_and_out(udpSocket, -1, &device_output_active,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 460)                        min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 461)                        format_change, format_height, format_width,
BlinkenLib/BlinkenOutput.c 462)                        format_channels, format_colors, proto, 1,
BlinkenLib/BlinkenOutput.c 463)                        reopen_device_ms);
BlinkenLib/BlinkenOutput.c 464)     if (err != 0)
Stefan Schuermans fix double semicolon

Stefan Schuermans authored 7 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            466) 
BlinkenOutput.c            467)   }
BlinkenOutput.c            468) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            472)   device_output_active = 0;
BlinkenOutput.c            473) 
BlinkenOutput.c            474)   return err;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 477) int main(int argCnt, char **args)
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            478) {
Christian Heimke BlinkenLib v.0.6.2 (2009-02...

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 484)   unsigned int height, width, channels, colors;
BlinkenLib/BlinkenOutput.c 485)   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            486)   int serial_settings_change, reopen_device;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            487)   char txt[64];
BlinkenOutput.c            488)   unsigned short port;
BlinkenOutput.c            489)   struct sockaddr_in addr;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 490)   char *device;
BlinkenLib/BlinkenOutput.c 491) 
BlinkenLib/BlinkenOutput.c 492)   // print info
BlinkenLib/BlinkenOutput.c 493)   printf("BlinkenLib - BlinkenOutput\n"
BlinkenLib/BlinkenOutput.c 494)          "version %d.%d.%d\n"
BlinkenLib/BlinkenOutput.c 495)          "config " BLINKENLIB_CONFIG "\n"
Stefan Schuermans update email address of author

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 497)          "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 498)          "a blinkenarea.org project\n\n",
BlinkenLib/BlinkenOutput.c 499)          BLINKENLIB_VERSION_MAJOR, BLINKENLIB_VERSION_MINOR,
BlinkenLib/BlinkenOutput.c 500)          BLINKENLIB_VERSION_REVISION);
BlinkenLib/BlinkenOutput.c 501) 
BlinkenLib/BlinkenOutput.c 502)   // print syntax
BlinkenLib/BlinkenOutput.c 503)   if (argCnt <= 1) {
BlinkenLib/BlinkenOutput.c 504)     printf("syntax: %s <parameter> [...]\n\n"
BlinkenLib/BlinkenOutput.c 505)            "parameters:\n"
BlinkenLib/BlinkenOutput.c 506)            "  -l [<ip>:]<port>\n"
BlinkenLib/BlinkenOutput.c 507)            "     local address (defaults to 0.0.0.0:2323)\n"
BlinkenLib/BlinkenOutput.c 508)            "     must occur before -r, may only occur once\n"
BlinkenLib/BlinkenOutput.c 509)            "  -r <ip>[:<port>]\n"
BlinkenLib/BlinkenOutput.c 510)            "     remote addess (defaults to every remote address)\n"
BlinkenLib/BlinkenOutput.c 511)            "  -p [BLP|EBLP|MCUF]\n"
BlinkenLib/BlinkenOutput.c 512)            "     protocol to output frames in (defaults to MCUF)\n"
BlinkenLib/BlinkenOutput.c 513)            "  -f <width>x<height>-<channels>/<colors>\n"
BlinkenLib/BlinkenOutput.c 514)            "     format to output frames in (defaults to no change)\n"
BlinkenLib/BlinkenOutput.c 515)            "  -d <device>\n"
BlinkenLib/BlinkenOutput.c 516)            "     device to output frames to (defaults to \"/dev/null\")\n"
BlinkenLib/BlinkenOutput.c 517)            "  -s <baud-rate>,<parity>,<data-bits>,<stop-bits>\n"
BlinkenLib/BlinkenOutput.c 518)            "     settings to use for serial devices (defaults to no change)\n"
BlinkenLib/BlinkenOutput.c 519)            "  -o <milliseconds>\n"
BlinkenLib/BlinkenOutput.c 520)            "     reopen device after short time on error (defaults to not reopen)\n"
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 521)            "  -i <milliseconds>\n"
BlinkenLib/BlinkenOutput.c 522)            "     minimum interval between two frames on output (defaults to 0)\n"
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 523)            "\n", args[0]);
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

BlinkenOutput.c            524)     return 0;
BlinkenOutput.c            525)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            530)     return -1;
BlinkenOutput.c            531)   }
BlinkenOutput.c            532)   bound = 0;
BlinkenOutput.c            533) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            537)   format_height = 0;
BlinkenOutput.c            538)   format_width = 0;
BlinkenOutput.c            539)   format_channels = 0;
BlinkenOutput.c            540)   format_colors = 0;
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 553)         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            554)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 555)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutput.c 556)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutput.c 557)           if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 558)             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            559)           else
BlinkenOutput.c            560)             bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 561)         } 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            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 = htonl(INADDR_ANY);
BlinkenLib/BlinkenOutput.c 565)           if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 566)             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            567)           else
BlinkenOutput.c            568)             bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 578)         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            579)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 580)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutput.c 581)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutput.c 582)           if (connect(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 583)             printf("could not set remote address to \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 584)         } 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            585)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 586)           addr.sin_port = htons(23230);
BlinkenLib/BlinkenOutput.c 587)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutput.c 588)           if (connect(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutput.c 589)             printf("could not set remote address to \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 590)         } else
BlinkenLib/BlinkenOutput.c 591)           printf("invalid remote address \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 592)       } else
BlinkenLib/BlinkenOutput.c 593)         printf("missing remote address for \"-r\"\n");
Christian Heimke BlinkenLib v.0.5 (2005-12-06)

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 614)         if (sscanf
BlinkenLib/BlinkenOutput.c 615)             (args[i], "%ux%u-%u/%u", &width, &height, &channels, &colors) == 4
BlinkenLib/BlinkenOutput.c 616)             && width > 0 && width < 1000 && height > 0 && height < 1000
BlinkenLib/BlinkenOutput.c 617)             && 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            618)           format_change = 1;
BlinkenOutput.c            619)           format_height = height;
BlinkenOutput.c            620)           format_width = width;
BlinkenOutput.c            621)           format_channels = channels;
BlinkenOutput.c            622)           format_colors = colors;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 640)         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            641)           serial_settings_change = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 659)     // minimum interval between two frame on output
BlinkenLib/BlinkenOutput.c 660)     else if (strcmp(args[i], "-i") == 0) {
BlinkenLib/BlinkenOutput.c 661)       if (i + 1 < argCnt) {
BlinkenLib/BlinkenOutput.c 662)         i++;
BlinkenLib/BlinkenOutput.c 663)         if (sscanf(args[i], "%u", &min_interval_ms) != 1) {
BlinkenLib/BlinkenOutput.c 664)           min_interval_ms = 0;
BlinkenLib/BlinkenOutput.c 665)           printf("invalid number of milliseconds \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutput.c 666)         }
BlinkenLib/BlinkenOutput.c 667)       } else
BlinkenLib/BlinkenOutput.c 668)         printf("missing time for \"-i\"\n");
BlinkenLib/BlinkenOutput.c 669)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            671)     else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 678)   // try to bind if not bound
BlinkenLib/BlinkenOutput.c 679)   if (!bound) {
BlinkenLib/BlinkenOutput.c 680)     printf("no local address to receive frames on,\n"
BlinkenLib/BlinkenOutput.c 681)            "  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            682)     addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 683)     addr.sin_port = htons(2323);
BlinkenLib/BlinkenOutput.c 684)     addr.sin_addr.s_addr = htonl(INADDR_ANY);
BlinkenLib/BlinkenOutput.c 685)     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            686)       bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Christian Heimke authored 13 years ago

BlinkenOutput.c            690)       return -1;
BlinkenOutput.c            691)     }
BlinkenOutput.c            692)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 693)   // open device and output frames in a loop
BlinkenLib/BlinkenOutput.c 694)   open_and_output_loop(udpSocket, device,
BlinkenLib/BlinkenOutput.c 695)                        serial_settings_change, serial_settings, serial_speed,
Stefan Schuermans added minimum time between...

Stefan Schuermans authored 10 years ago

BlinkenLib/BlinkenOutput.c 696)                        reopen_device, reopen_device_ms, min_interval_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutput.c 697)                        format_change, format_height, format_width,
BlinkenLib/BlinkenOutput.c 698)                        format_channels, format_colors, proto);
BlinkenLib/BlinkenOutput.c 699) 
BlinkenLib/BlinkenOutput.c 700)   // close socket
BlinkenLib/BlinkenOutput.c 701)   close(udpSocket);