Giter Club home page Giter Club logo

winkeydaemon's People

Contributors

dl1jbe avatar n0nb avatar reinpa0r avatar zcsahok avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

winkeydaemon's Issues

Buffering issues

I tried to use winkeydaemon with a WK clone and had severe issues due to limited UDP read length and overflowing WK's serial buffer.
I'm not sure what the state of this code is, but the implementation of the internal buffering is clearly wrong. Example: it sends 30 chars right away and the looks for an echo and as soon as echo is received the rest of the buffer is sent: (around line 431, whole $string is sent then len($echo)<=9)

 if (length($echo) > 9) {
...
 } else {
   my $out = $string;
   $count = $port->write($out);
}

As the string from UDP req can be quite long this results in buffer overflow in WK.
Also the UDP read limit (32 chars, line 250) is way too low, a longer CQ call won't fit.
WK status evaluation is also flawed as it is done in an if/elsif/elsif/.. construct, so the first bit masks
the subsequent ones.

I've checked in an improved and actually working version to my fork and I'm happy to send a PR.

Instead of looking for echoed chars my code leverages the XOFF status bit sent by WK. Data are sent in a rate-limited way (instead of pouring 30 chars a time) to ensure that XOFF can be acted upon in time. UDP reading has been also refactored to use a more fine granular select() instead of alarm. UDP and serial timeouts add up to 15 ms, that gives a byte rate of ~60 cps. As the round trip time on serial IF at 1200 baud is ~20 ms this gives a reasonable accuracy for XOFF handling without lowering too much the data rate.

Zoli, ha5cqz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.