860e91ba85e0070b3deb854f8a8e9952bceca480
Stefan Schuermans cleanup file headers after...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c   3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
BlinkenLib/BlinkenOutputWin.c   4)    a blinkenarea.org project */
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c              5) 
BlinkenOutputWin.c              6) #include <fcntl.h>
BlinkenOutputWin.c              7) #include <stdio.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c        8) #include <stdlib.h>
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c              9) #include <string.h>
BlinkenOutputWin.c             10) #include <windows.h>
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c       11) #include <winsock2.h>
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c             12) 
Christian Heimke BlinkenLib v.0.5.5 (2008-03...

Christian Heimke authored 13 years ago

BlinkenLib/BlinkenOutputWin.c  13) #include <BlinkenLib/BlinkenLib.h>
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c             14) 
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c       15) struct s_serial_settings {
tools/BlinkenOutputWin.c       16)   char *str; // pointer into argv[]
tools/BlinkenOutputWin.c       17)   DWORD BaudRate;
tools/BlinkenOutputWin.c       18)   DWORD fParity : 1;
tools/BlinkenOutputWin.c       19)   BYTE ByteSize;
tools/BlinkenOutputWin.c       20)   BYTE Parity;
tools/BlinkenOutputWin.c       21)   BYTE StopBits;
tools/BlinkenOutputWin.c       22) };
tools/BlinkenOutputWin.c       23) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c  24) // get serial settings from text
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c       25) static int serial_settings_parse(char *str,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c       26)                                  struct s_serial_settings *serial_settings) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c             27)   int baud, data, stop;
BlinkenOutputWin.c             28)   char parity;
BlinkenOutputWin.c             29) 
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c       30)   serial_settings->str = str;
tools/BlinkenOutputWin.c       31) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c  32)   // split and parse settings string
BlinkenLib/BlinkenOutputWin.c  33)   if (sscanf(str, "%i,%c,%i,%i", &baud, &parity, &data, &stop) != 4)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c             34)     return 0;
BlinkenOutputWin.c             35) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c  36)   // baud rate
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c       37)   switch (baud) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c       38)   case 300:
tools/BlinkenOutputWin.c       39)     serial_settings->BaudRate = CBR_300;
tools/BlinkenOutputWin.c       40)     break;
tools/BlinkenOutputWin.c       41)   case 600:
tools/BlinkenOutputWin.c       42)     serial_settings->BaudRate = CBR_600;
tools/BlinkenOutputWin.c       43)     break;
tools/BlinkenOutputWin.c       44)   case 1200:
tools/BlinkenOutputWin.c       45)     serial_settings->BaudRate = CBR_1200;
tools/BlinkenOutputWin.c       46)     break;
tools/BlinkenOutputWin.c       47)   case 2400:
tools/BlinkenOutputWin.c       48)     serial_settings->BaudRate = CBR_2400;
tools/BlinkenOutputWin.c       49)     break;
tools/BlinkenOutputWin.c       50)   case 4800:
tools/BlinkenOutputWin.c       51)     serial_settings->BaudRate = CBR_4800;
tools/BlinkenOutputWin.c       52)     break;
tools/BlinkenOutputWin.c       53)   case 9600:
tools/BlinkenOutputWin.c       54)     serial_settings->BaudRate = CBR_9600;
tools/BlinkenOutputWin.c       55)     break;
tools/BlinkenOutputWin.c       56)   case 19200:
tools/BlinkenOutputWin.c       57)     serial_settings->BaudRate = CBR_19200;
tools/BlinkenOutputWin.c       58)     break;
tools/BlinkenOutputWin.c       59)   case 57600:
tools/BlinkenOutputWin.c       60)     serial_settings->BaudRate = CBR_57600;
tools/BlinkenOutputWin.c       61)     break;
tools/BlinkenOutputWin.c       62)   case 115200:
tools/BlinkenOutputWin.c       63)     serial_settings->BaudRate = CBR_115200;
tools/BlinkenOutputWin.c       64)     break;
tools/BlinkenOutputWin.c       65)   default:
tools/BlinkenOutputWin.c       66)     printf("illegal baudrate: %d\n", baud);
tools/BlinkenOutputWin.c       67)     return 0;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c             68)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c  69)   // parity
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c       70)   switch (parity) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c       71)   case 'n':
tools/BlinkenOutputWin.c       72)   case 'N':
tools/BlinkenOutputWin.c       73)     serial_settings->fParity = 0;
tools/BlinkenOutputWin.c       74)     serial_settings->Parity = NOPARITY;
tools/BlinkenOutputWin.c       75)     break;
tools/BlinkenOutputWin.c       76)   case 'e':
tools/BlinkenOutputWin.c       77)   case 'E':
tools/BlinkenOutputWin.c       78)     serial_settings->fParity = 1;
tools/BlinkenOutputWin.c       79)     serial_settings->Parity = EVENPARITY;
tools/BlinkenOutputWin.c       80)     break;
tools/BlinkenOutputWin.c       81)   case 'o':
tools/BlinkenOutputWin.c       82)   case 'O':
tools/BlinkenOutputWin.c       83)     serial_settings->fParity = 1;
tools/BlinkenOutputWin.c       84)     serial_settings->Parity = ODDPARITY;
tools/BlinkenOutputWin.c       85)     break;
tools/BlinkenOutputWin.c       86)   default:
tools/BlinkenOutputWin.c       87)     printf("invalid parity: %c\n", parity);
tools/BlinkenOutputWin.c       88)     return 0;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c             89)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c  90)   // data bits
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c       91)   switch (data) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c       92)   case 5:
tools/BlinkenOutputWin.c       93)   case 6:
tools/BlinkenOutputWin.c       94)   case 7:
tools/BlinkenOutputWin.c       95)   case 8:
tools/BlinkenOutputWin.c       96)     serial_settings->ByteSize = data;
tools/BlinkenOutputWin.c       97)     break;
tools/BlinkenOutputWin.c       98)   default:
tools/BlinkenOutputWin.c       99)     printf("illegal number of data bits: %d\n", data);
tools/BlinkenOutputWin.c      100)     return 0;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            101)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 102)   // stop bits
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      103)   switch (stop) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      104)   case 1:
tools/BlinkenOutputWin.c      105)     serial_settings->StopBits = ONESTOPBIT;
tools/BlinkenOutputWin.c      106)     break;
tools/BlinkenOutputWin.c      107)   case 2:
tools/BlinkenOutputWin.c      108)     serial_settings->StopBits = TWOSTOPBITS;
tools/BlinkenOutputWin.c      109)     break;
tools/BlinkenOutputWin.c      110)   default:
tools/BlinkenOutputWin.c      111)     printf("illegal number of stop bits: %d\n", stop);
tools/BlinkenOutputWin.c      112)     return 0;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            113)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 114)   // success
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            115)   return 1;
BlinkenOutputWin.c            116) }
BlinkenOutputWin.c            117) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 118) // set serial settings for fd
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      119) static int serial_settings_set(HANDLE hDev,
tools/BlinkenOutputWin.c      120)                                struct s_serial_settings *settings) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            121)   DCB PortDcb;
BlinkenOutputWin.c            122)   COMMTIMEOUTS CommTimeouts;
BlinkenOutputWin.c            123) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 124)   // set serial parameters
BlinkenLib/BlinkenOutputWin.c 125)   if (!GetCommState(hDev, &PortDcb)) {
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      126)     printf("error getting device comm state: error %lu\n", GetLastError());
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            127)     return 0;
BlinkenOutputWin.c            128)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 129)   if (!BuildCommDCB(hDev, &PortDcb)) {
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      130)     printf("error building comm state: error %lu\n", GetLastError());
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            131)     return 0;
BlinkenOutputWin.c            132)   }
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      133)   PortDcb.BaudRate = settings->BaudRate;
tools/BlinkenOutputWin.c      134)   PortDcb.fParity = settings->fParity;
tools/BlinkenOutputWin.c      135)   PortDcb.ByteSize = settings->ByteSize;
tools/BlinkenOutputWin.c      136)   PortDcb.Parity = settings->Parity;
tools/BlinkenOutputWin.c      137)   PortDcb.StopBits = settings->StopBits;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 138)   if (!SetCommState(hDev, &PortDcb)) {
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      139)     printf("error setting device comm state: error %lu\n", GetLastError());
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            140)     return 0;
BlinkenOutputWin.c            141)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 142)   // set timeout parameters
BlinkenLib/BlinkenOutputWin.c 143)   // maximum time between arrival of two characters: 10 ms
BlinkenLib/BlinkenOutputWin.c 144)   // if this time elapses, read command will return even if buffer is not
BlinkenLib/BlinkenOutputWin.c 145)   // filled completely
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            146)   CommTimeouts.ReadIntervalTimeout = 10;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 147)   // disable read timeouts
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            148)   CommTimeouts.ReadTotalTimeoutConstant = 0;
BlinkenOutputWin.c            149)   CommTimeouts.ReadTotalTimeoutMultiplier = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 150)   // disable write timeouts
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            151)   CommTimeouts.WriteTotalTimeoutConstant = 0;
BlinkenOutputWin.c            152)   CommTimeouts.WriteTotalTimeoutMultiplier = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 153)   if (!SetCommTimeouts(hDev, &CommTimeouts)) {
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      154)     printf("error setting device timeout parameters: error %lu\n",
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 155)            GetLastError());
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            156)     return 0;
BlinkenOutputWin.c            157)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 158)   // success
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            159)   return 1;
BlinkenOutputWin.c            160) }
BlinkenOutputWin.c            161) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 162) // receive frames from socket and output them
BlinkenLib/BlinkenOutputWin.c 163) // hDev may be INVALID_HANDLE_VALUE for not doing anything with device
BlinkenLib/BlinkenOutputWin.c 164) // returns error code (not for device-errors, 0 for success)
BlinkenLib/BlinkenOutputWin.c 165) static int recv_and_out(SOCKET udpSocket, HANDLE hDev,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      166)                         int *p_device_output_active, unsigned int format_change,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 167)                         unsigned int format_height, unsigned int format_width,
BlinkenLib/BlinkenOutputWin.c 168)                         unsigned int format_channels,
BlinkenLib/BlinkenOutputWin.c 169)                         unsigned int format_colors, etBlinkenProto proto,
BlinkenLib/BlinkenOutputWin.c 170)                         int use_msecs, unsigned int msecs,
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      171)                         int is_serial_device) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            172)   fd_set readFds, errFds;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 173)   stBlinkenFrame *pFrame;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      174)   char buffer[65536]; // 64kB is more than maximum UDP size
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      175)   int len;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 176)   struct timeval timeout, *p_timeout;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            177)   DWORD DevWrLen, Err, start, end;
BlinkenOutputWin.c            178)   COMSTAT ComStat;
BlinkenOutputWin.c            179) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 180)   for (;;) {
BlinkenLib/BlinkenOutputWin.c 181)     // wait for next frame
BlinkenLib/BlinkenOutputWin.c 182)     FD_ZERO(&readFds);
BlinkenLib/BlinkenOutputWin.c 183)     FD_SET(udpSocket, &readFds);
BlinkenLib/BlinkenOutputWin.c 184)     FD_ZERO(&errFds);
BlinkenLib/BlinkenOutputWin.c 185)     FD_SET(udpSocket, &errFds);
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      186)     if (use_msecs) // timeout
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            187)     {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 188)       start = GetTickCount();
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            189)       timeout.tv_sec = msecs / 1000;
BlinkenOutputWin.c            190)       timeout.tv_usec = msecs % 1000 * 1000;
BlinkenOutputWin.c            191)       p_timeout = &timeout;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 192)     } else
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            193)       p_timeout = NULL;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      194)     if (select(0, &readFds, NULL, &errFds, p_timeout) < 0) // error
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            195)     {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 196)       printf("error during select: %s\n", strerror(errno));
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            197)       return -1;
BlinkenOutputWin.c            198)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 199)     // error on socket
BlinkenLib/BlinkenOutputWin.c 200)     if (FD_ISSET(udpSocket, &errFds)) {
BlinkenLib/BlinkenOutputWin.c 201)       printf("error on socket\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            202)       return -1;
BlinkenOutputWin.c            203)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 204)     // received frame
BlinkenLib/BlinkenOutputWin.c 205)     if (FD_ISSET(udpSocket, &readFds)) {
BlinkenLib/BlinkenOutputWin.c 206)       // fetch data
BlinkenLib/BlinkenOutputWin.c 207)       len = recv(udpSocket, buffer, sizeof(buffer), 0);
BlinkenLib/BlinkenOutputWin.c 208)       if (len < 0) {
BlinkenLib/BlinkenOutputWin.c 209)         printf("could not read from socket\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            210)         return -1;
BlinkenOutputWin.c            211)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 212)       if (len == 0)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            213)         return -1;
BlinkenOutputWin.c            214) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 215)       // get frame from data
BlinkenLib/BlinkenOutputWin.c 216)       pFrame = BlinkenFrameFromNetwork(buffer, len, NULL);
BlinkenLib/BlinkenOutputWin.c 217)       if (pFrame != NULL) {
BlinkenLib/BlinkenOutputWin.c 218)         // change format
BlinkenLib/BlinkenOutputWin.c 219)         if (format_change)
BlinkenLib/BlinkenOutputWin.c 220)           BlinkenFrameResize(pFrame, format_height, format_width,
BlinkenLib/BlinkenOutputWin.c 221)                              format_channels, format_colors - 1);
BlinkenLib/BlinkenOutputWin.c 222) 
BlinkenLib/BlinkenOutputWin.c 223)         // create output data from frame
BlinkenLib/BlinkenOutputWin.c 224)         len = BlinkenFrameToNetwork(pFrame, proto, buffer, sizeof(buffer));
BlinkenLib/BlinkenOutputWin.c 225) 
BlinkenLib/BlinkenOutputWin.c 226)         // free frame
BlinkenLib/BlinkenOutputWin.c 227)         BlinkenFrameFree(pFrame);
BlinkenLib/BlinkenOutputWin.c 228) 
BlinkenLib/BlinkenOutputWin.c 229)         // output data to device
BlinkenLib/BlinkenOutputWin.c 230)         if (hDev != INVALID_HANDLE_VALUE && len > 0) {
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      231)           if (!WriteFile(hDev, buffer, len, &DevWrLen, NULL) ||
tools/BlinkenOutputWin.c      232)               (int)DevWrLen != len) {
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 233)             if (*p_device_output_active)
BlinkenLib/BlinkenOutputWin.c 234)               printf("error writing to device: error %lu\n", GetLastError());
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            235)             break;
BlinkenOutputWin.c            236)           }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 237)           // message: output to device was restarted
BlinkenLib/BlinkenOutputWin.c 238)           if (!*p_device_output_active)
BlinkenLib/BlinkenOutputWin.c 239)             printf("restarted output to device...\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            240)           *p_device_output_active = 1;
BlinkenOutputWin.c            241)         }
BlinkenOutputWin.c            242)       }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 243)     }
BlinkenLib/BlinkenOutputWin.c 244)     // get state of serial device
BlinkenLib/BlinkenOutputWin.c 245)     if (hDev != INVALID_HANDLE_VALUE && is_serial_device) {
BlinkenLib/BlinkenOutputWin.c 246)       ClearCommError(hDev, &Err, &ComStat);
BlinkenLib/BlinkenOutputWin.c 247)       // reception error
BlinkenLib/BlinkenOutputWin.c 248)       if (Err & (CE_BREAK | CE_FRAME | CE_OVERRUN | CE_RXOVER | CE_RXPARITY)) {
BlinkenLib/BlinkenOutputWin.c 249)         if (*p_device_output_active)
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      250)           printf("error reading from device (comm err=%lX)\n", Err);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            251)         break;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 252)       }
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            253)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 254)     // using time limit
BlinkenLib/BlinkenOutputWin.c 255)     if (use_msecs) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            256)       unsigned int msec;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 257)       // get time elapsed
BlinkenLib/BlinkenOutputWin.c 258)       end = GetTickCount();
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            259)       msec = end - start;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 260)       // more than rest of timeout (or exact match)
BlinkenLib/BlinkenOutputWin.c 261)       if (msec >= msecs)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            262)         break;
BlinkenOutputWin.c            263)       msecs -= msec;
BlinkenOutputWin.c            264)     }
BlinkenOutputWin.c            265) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      266)   } // for( ; ; )
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            267) 
BlinkenOutputWin.c            268)   return 0;
BlinkenOutputWin.c            269) }
BlinkenOutputWin.c            270) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      273) static int
tools/BlinkenOutputWin.c      274) open_and_output(SOCKET udpSocket, char *device, int *p_device_output_active,
tools/BlinkenOutputWin.c      275)                 int serial_settings_change,
tools/BlinkenOutputWin.c      276)                 struct s_serial_settings *serial_settings,
tools/BlinkenOutputWin.c      277)                 unsigned int format_change, unsigned int format_height,
tools/BlinkenOutputWin.c      278)                 unsigned int format_width, unsigned int format_channels,
tools/BlinkenOutputWin.c      279)                 unsigned int format_colors, etBlinkenProto proto) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            280)   HANDLE hDev;
BlinkenOutputWin.c            281)   int err;
BlinkenOutputWin.c            282) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 283)   // open device
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      284)   hDev = CreateFile(device, GENERIC_READ | GENERIC_WRITE, 0, NULL,
tools/BlinkenOutputWin.c      285)                     OPEN_EXISTING, 0, NULL);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 286)   if (hDev == INVALID_HANDLE_VALUE) {
BlinkenLib/BlinkenOutputWin.c 287)     if (*p_device_output_active)
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      288)       printf("could not open \"%s\": error %lu\n", device, GetLastError());
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            289)     return 0;
BlinkenOutputWin.c            290)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 291)   // setup serial port
BlinkenLib/BlinkenOutputWin.c 292)   if (serial_settings_change) {
BlinkenLib/BlinkenOutputWin.c 293)     if (!serial_settings_set(hDev, serial_settings)) {
BlinkenLib/BlinkenOutputWin.c 294)       if (*p_device_output_active)
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      295)         printf("could not set serial port to \"%s\"\n", serial_settings->str);
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 296)       CloseHandle(hDev);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            297)       return 0;
BlinkenOutputWin.c            298)     }
BlinkenOutputWin.c            299)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 300)   // receive frames and output to device
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      301)   err = recv_and_out(udpSocket, hDev, p_device_output_active, format_change,
tools/BlinkenOutputWin.c      302)                      format_height, format_width, format_channels,
tools/BlinkenOutputWin.c      303)                      format_colors, proto, 0, 0, serial_settings_change);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            304) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 305)   // close device
BlinkenLib/BlinkenOutputWin.c 306)   CloseHandle(hDev);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            307) 
BlinkenOutputWin.c            308)   return err;
BlinkenOutputWin.c            309) }
BlinkenOutputWin.c            310) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      313) static int
tools/BlinkenOutputWin.c      314) open_and_output_loop(SOCKET udpSocket, char *device, int serial_settings_change,
tools/BlinkenOutputWin.c      315)                      struct s_serial_settings *serial_settings,
tools/BlinkenOutputWin.c      316)                      int reopen_device, unsigned int reopen_device_ms,
tools/BlinkenOutputWin.c      317)                      unsigned int format_change, unsigned int format_height,
tools/BlinkenOutputWin.c      318)                      unsigned int format_width, unsigned int format_channels,
tools/BlinkenOutputWin.c      319)                      unsigned int format_colors, etBlinkenProto proto) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            320)   int device_output_active, err;
BlinkenOutputWin.c            321) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 322)   printf("receiving frames and outputting them to \"%s\"...\n", device);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            323)   device_output_active = 1;
BlinkenOutputWin.c            324) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 325)   for (;;) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            326) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 327)     // try to open device and output frames
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      328)     err = open_and_output(udpSocket, device, &device_output_active,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 329)                           serial_settings_change, serial_settings,
BlinkenLib/BlinkenOutputWin.c 330)                           format_change, format_height, format_width,
BlinkenLib/BlinkenOutputWin.c 331)                           format_channels, format_colors, proto);
BlinkenLib/BlinkenOutputWin.c 332)     if (err != 0 || !reopen_device)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            333)       break;
BlinkenOutputWin.c            334) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 335)     // output to device stopped
BlinkenLib/BlinkenOutputWin.c 336)     if (device_output_active)
BlinkenLib/BlinkenOutputWin.c 337)       printf("output to device stopped...\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            338)     device_output_active = 0;
BlinkenOutputWin.c            339) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 340)     // only fetch data from socket for a short time
BlinkenLib/BlinkenOutputWin.c 341)     err = recv_and_out(udpSocket, INVALID_HANDLE_VALUE, &device_output_active,
BlinkenLib/BlinkenOutputWin.c 342)                        format_change, format_height, format_width,
BlinkenLib/BlinkenOutputWin.c 343)                        format_channels, format_colors, proto, 1,
BlinkenLib/BlinkenOutputWin.c 344)                        reopen_device_ms, serial_settings_change);
BlinkenLib/BlinkenOutputWin.c 345)     if (err != 0)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            346)       break;
BlinkenOutputWin.c            347)   }
BlinkenOutputWin.c            348) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 349)   // output to device finshed
BlinkenLib/BlinkenOutputWin.c 350)   if (device_output_active)
BlinkenLib/BlinkenOutputWin.c 351)     printf("output to device finished...\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            352)   device_output_active = 0;
BlinkenOutputWin.c            353) 
BlinkenOutputWin.c            354)   return err;
BlinkenOutputWin.c            355) }
BlinkenOutputWin.c            356) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      357) int main(int argCnt, char **args) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            358)   WSADATA WsaData;
BlinkenOutputWin.c            359)   int i, bound;
BlinkenOutputWin.c            360)   SOCKET udpSocket;
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      361)   struct s_serial_settings serial_settings = {};
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            362)   etBlinkenProto proto;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 363)   unsigned int format_change, format_height, format_width, format_channels,
BlinkenLib/BlinkenOutputWin.c 364)       format_colors;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            365)   unsigned int height, width, channels, colors, reopen_device_ms;
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      366)   int serial_settings_change, reopen_device;
tools/BlinkenOutputWin.c      367)   unsigned long unblock;
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            368)   char txt[64];
BlinkenOutputWin.c            369)   unsigned short port;
BlinkenOutputWin.c            370)   struct sockaddr_in addr;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 371)   char *device;
BlinkenLib/BlinkenOutputWin.c 372) 
BlinkenLib/BlinkenOutputWin.c 373)   // print info
BlinkenLib/BlinkenOutputWin.c 374)   printf("BlinkenLib - BlinkenOutput\n"
Stefan Schuermans update email address of author

Stefan Schuermans authored 10 years ago

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

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 376)          "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/BlinkenOutputWin.c 377)          "a blinkenarea.org project\n\n");
BlinkenLib/BlinkenOutputWin.c 378) 
BlinkenLib/BlinkenOutputWin.c 379)   // print syntax
BlinkenLib/BlinkenOutputWin.c 380)   if (argCnt <= 1) {
BlinkenLib/BlinkenOutputWin.c 381)     printf("syntax: %s <parameter> [...]\n\n"
BlinkenLib/BlinkenOutputWin.c 382)            "parameters:\n"
BlinkenLib/BlinkenOutputWin.c 383)            "  -l [<ip>:]<port>\n"
BlinkenLib/BlinkenOutputWin.c 384)            "     local address (defaults to 0.0.0.0:2323)\n"
BlinkenLib/BlinkenOutputWin.c 385)            "     must occur before -r, may only occur once\n"
BlinkenLib/BlinkenOutputWin.c 386)            "  -r <ip>[:<port>]\n"
BlinkenLib/BlinkenOutputWin.c 387)            "     remote addess (defaults to every remote address)\n"
BlinkenLib/BlinkenOutputWin.c 388)            "  -p [BLP|EBLP|MCUF]\n"
BlinkenLib/BlinkenOutputWin.c 389)            "     protocol to output frames in (defaults to MCUF)\n"
BlinkenLib/BlinkenOutputWin.c 390)            "  -f <width>x<height>-<channels>/<colors>\n"
BlinkenLib/BlinkenOutputWin.c 391)            "     format to output frames in (defaults to no change)\n"
BlinkenLib/BlinkenOutputWin.c 392)            "  -d <device>\n"
BlinkenLib/BlinkenOutputWin.c 393)            "     device to output frames to (defaults to \"NUL\")\n"
BlinkenLib/BlinkenOutputWin.c 394)            "  -s <baud-rate>,<parity>,<data-bits>,<stop-bits>\n"
BlinkenLib/BlinkenOutputWin.c 395)            "     settings to use for serial devices (defaults to no change)\n"
BlinkenLib/BlinkenOutputWin.c 396)            "  -o <milliseconds>\n"
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      397)            "     reopen device after short time on error (defaults to not "
tools/BlinkenOutputWin.c      398)            "reopen)\n"
tools/BlinkenOutputWin.c      399)            "\n",
tools/BlinkenOutputWin.c      400)            args[0]);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            401)     return 0;
BlinkenOutputWin.c            402)   }
BlinkenOutputWin.c            403) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 404)   WSAStartup(0x0101, &WsaData);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            405) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 406)   // create udp socket
BlinkenLib/BlinkenOutputWin.c 407)   udpSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
BlinkenLib/BlinkenOutputWin.c 408)   if (udpSocket == INVALID_SOCKET) {
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      409)     printf("cannot create UDP socket: error %u\n", WSAGetLastError());
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 410)     WSACleanup();
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            411)     return -1;
BlinkenOutputWin.c            412)   }
BlinkenOutputWin.c            413)   bound = 0;
BlinkenOutputWin.c            414) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 415)   // unblock udp socket
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            416)   unblock = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 417)   if (ioctlsocket(udpSocket, FIONBIO, &unblock) == SOCKET_ERROR) {
Stefan Schuermans fix Windows cross-build of...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      418)     printf("cannot unblock UDP socket: error %u\n", WSAGetLastError());
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 419)     closesocket(udpSocket);
BlinkenLib/BlinkenOutputWin.c 420)     WSACleanup();
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            421)     return -1;
BlinkenOutputWin.c            422)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 423)   // process parameters
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            424)   proto = BlinkenProtoMcuf;
BlinkenOutputWin.c            425)   format_change = 0;
BlinkenOutputWin.c            426)   format_height = 0;
BlinkenOutputWin.c            427)   format_width = 0;
BlinkenOutputWin.c            428)   format_channels = 0;
BlinkenOutputWin.c            429)   format_colors = 0;
BlinkenOutputWin.c            430)   device = "NUL";
BlinkenOutputWin.c            431)   serial_settings_change = 0;
BlinkenOutputWin.c            432)   reopen_device = 0;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 433)   for (i = 1; i < argCnt; i++) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            434) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 435)     // local address
BlinkenLib/BlinkenOutputWin.c 436)     if (strcmp(args[i], "-l") == 0) {
BlinkenLib/BlinkenOutputWin.c 437)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            438)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 439)         if (sscanf(args[i], "%32[0-9.]:%hu", txt, &port) == 2) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            440)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 441)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutputWin.c 442)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutputWin.c 443)           if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutputWin.c 444)             printf("could not set local address to \"%s\"\n", args[i]);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            445)           else
BlinkenOutputWin.c            446)             bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 447)         } else if (sscanf(args[i], "%hu", &port) == 1) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            448)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 449)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutputWin.c 450)           addr.sin_addr.s_addr = htonl(INADDR_ANY);
BlinkenLib/BlinkenOutputWin.c 451)           if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutputWin.c 452)             printf("could not set local address to \"%s\"\n", args[i]);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            453)           else
BlinkenOutputWin.c            454)             bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 455)         } else
BlinkenLib/BlinkenOutputWin.c 456)           printf("invalid local address \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 457)       } else
BlinkenLib/BlinkenOutputWin.c 458)         printf("missing local address for \"-l\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            459)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 460)     // remote address
BlinkenLib/BlinkenOutputWin.c 461)     else if (strcmp(args[i], "-r") == 0) {
BlinkenLib/BlinkenOutputWin.c 462)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            463)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 464)         if (sscanf(args[i], "%32[0-9.]:%hu", txt, &port) == 2) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            465)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 466)           addr.sin_port = htons(port);
BlinkenLib/BlinkenOutputWin.c 467)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutputWin.c 468)           if (connect(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutputWin.c 469)             printf("could not set remote address to \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 470)         } else if (sscanf(args[i], "%32[0-9.]", txt) == 1) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            471)           addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 472)           addr.sin_port = htons(23230);
BlinkenLib/BlinkenOutputWin.c 473)           addr.sin_addr.s_addr = inet_addr(txt);
BlinkenLib/BlinkenOutputWin.c 474)           if (connect(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) != 0)
BlinkenLib/BlinkenOutputWin.c 475)             printf("could not set remote address to \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 476)         } else
BlinkenLib/BlinkenOutputWin.c 477)           printf("invalid remote address \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 478)       } else
BlinkenLib/BlinkenOutputWin.c 479)         printf("missing remote address for \"-r\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            480)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 481)     // protocol to output frames in
BlinkenLib/BlinkenOutputWin.c 482)     else if (strcmp(args[i], "-p") == 0) {
BlinkenLib/BlinkenOutputWin.c 483)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            484)         i++;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 485)         if (stricmp(args[i], "BLP") == 0)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            486)           proto = BlinkenProtoBlp;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 487)         else if (stricmp(args[i], "EBLP") == 0)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            488)           proto = BlinkenProtoEblp;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 489)         else if (stricmp(args[i], "MCUF") == 0)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            490)           proto = BlinkenProtoMcuf;
BlinkenOutputWin.c            491)         else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 492)           printf("unknown protocol \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 493)       } else
BlinkenLib/BlinkenOutputWin.c 494)         printf("missing protocol for \"-p\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            495)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 496)     // format to output frames in
BlinkenLib/BlinkenOutputWin.c 497)     else if (strcmp(args[i], "-f") == 0) {
BlinkenLib/BlinkenOutputWin.c 498)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            499)         i++;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      500)         if (sscanf(args[i], "%ux%u-%u/%u", &width, &height, &channels,
tools/BlinkenOutputWin.c      501)                    &colors) == 4 &&
tools/BlinkenOutputWin.c      502)             width > 0 && width < 1000 && height > 0 && height < 1000 &&
tools/BlinkenOutputWin.c      503)             channels > 0 && channels < 20 && colors > 1 && colors <= 256) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            504)           format_change = 1;
BlinkenOutputWin.c            505)           format_height = height;
BlinkenOutputWin.c            506)           format_width = width;
BlinkenOutputWin.c            507)           format_channels = channels;
BlinkenOutputWin.c            508)           format_colors = colors;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 509)         } else
BlinkenLib/BlinkenOutputWin.c 510)           printf("invalid frame format \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 511)       } else
BlinkenLib/BlinkenOutputWin.c 512)         printf("missing frame format for \"-r\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            513)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 514)     // device to output frames to
BlinkenLib/BlinkenOutputWin.c 515)     else if (strcmp(args[i], "-d") == 0) {
BlinkenLib/BlinkenOutputWin.c 516)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            517)         i++;
BlinkenOutputWin.c            518)         device = args[i];
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 519)       } else
BlinkenLib/BlinkenOutputWin.c 520)         printf("missing device name for \"-d\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            521)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 522)     // settings for serial output devices
BlinkenLib/BlinkenOutputWin.c 523)     else if (strcmp(args[i], "-s") == 0) {
BlinkenLib/BlinkenOutputWin.c 524)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            525)         i++;
Stefan Schuermans implement serial port confi...

Stefan Schuermans authored 5 years ago

tools/BlinkenOutputWin.c      526)         if (serial_settings_parse(args[i], &serial_settings)) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            527)           serial_settings_change = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 528)         } else
BlinkenLib/BlinkenOutputWin.c 529)           printf("invalid serial settings \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 530)       } else
BlinkenLib/BlinkenOutputWin.c 531)         printf("missing serial settings for \"-s\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            532)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 533)     // reopen device on error after some time
BlinkenLib/BlinkenOutputWin.c 534)     else if (strcmp(args[i], "-o") == 0) {
BlinkenLib/BlinkenOutputWin.c 535)       if (i + 1 < argCnt) {
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            536)         i++;
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      537)         if (sscanf(args[i], "%u", &reopen_device_ms) == 1 &&
tools/BlinkenOutputWin.c      538)             reopen_device_ms >= 1)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            539)           reopen_device = 1;
BlinkenOutputWin.c            540)         else
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 541)           printf("invalid number of milliseconds \"%s\"\n", args[i]);
BlinkenLib/BlinkenOutputWin.c 542)       } else
BlinkenLib/BlinkenOutputWin.c 543)         printf("missing time for \"-o\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            544)     }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 545)     // unknown parameter
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            546)     else
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      547)       printf("unknown parameter \"%s\", call without parameters to get help\n",
tools/BlinkenOutputWin.c      548)              args[i]);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            549) 
Stefan Schuermans format

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      550)   } // for( i ...
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            551) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 552)   // try to bind if not bound
BlinkenLib/BlinkenOutputWin.c 553)   if (!bound) {
BlinkenLib/BlinkenOutputWin.c 554)     printf("no local address to receive frames on,\n"
BlinkenLib/BlinkenOutputWin.c 555)            "  using default local address \"0.0.0.0:2323\"\n");
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            556)     addr.sin_family = AF_INET;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 557)     addr.sin_port = htons(2323);
BlinkenLib/BlinkenOutputWin.c 558)     addr.sin_addr.s_addr = htonl(INADDR_ANY);
BlinkenLib/BlinkenOutputWin.c 559)     if (bind(udpSocket, (struct sockaddr *)&addr, sizeof(addr)) == 0)
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            560)       bound = 1;
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 561)     else {
BlinkenLib/BlinkenOutputWin.c 562)       printf("could not set local address to \"0.0.0.0:2323\"\n");
BlinkenLib/BlinkenOutputWin.c 563)       closesocket(udpSocket);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            564)       return -1;
BlinkenOutputWin.c            565)     }
BlinkenOutputWin.c            566)   }
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

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

Stefan Schuermans authored 1 year ago

tools/BlinkenOutputWin.c      568)   open_and_output_loop(udpSocket, device, serial_settings_change,
tools/BlinkenOutputWin.c      569)                        &serial_settings, reopen_device, reopen_device_ms,
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 570)                        format_change, format_height, format_width,
BlinkenLib/BlinkenOutputWin.c 571)                        format_channels, format_colors, proto);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            572) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 573)   // close socket
BlinkenLib/BlinkenOutputWin.c 574)   closesocket(udpSocket);
Christian Heimke BlinkenLib v.0.5.2 (2006-05...

Christian Heimke authored 13 years ago

BlinkenOutputWin.c            575) 
Stefan Schuermans changed indenting to be mor...

Stefan Schuermans authored 13 years ago

BlinkenLib/BlinkenOutputWin.c 576)   WSACleanup();