KISS-C windows download speed

1 reply [Last post]
bsilver's picture
Title: NooBot+
Joined: 05/30/2011
BotPoints: 9
User offline. Last seen 7 years 36 weeks ago.

I was working on USB downloads to the CBC from Windows for an Eclipse plugin I'm writing. I found that changing what was 4 calls to the Windows API write function in my code (I'm not sure how many the KISS-C QT code ends up with) per packet to 1 reduced download times by ~40%.

The lines in KISS-C that are (through QT) calling the WriteFile function are

  1. m_stream << SERIAL_KEY;
  2. m_stream << data;
  3. m_stream << qChecksum(data.constData(), data.size());
in kiss/targets/cbc2/src/SerialClient.cpp. I'm not sure how many calls through to the Windows API these 3 lines result in, but it's probably at least 3.

I also discovered that download times can be sped up a little bit by changing

  1. cto.ReadIntervalTimeout = 500;
  2. cto.ReadTotalTimeoutMultiplier = 0;
  3. cto.ReadTotalTimeoutConstant = 500;
  1. cto.ReadIntervalTimeout = MAXDWORD;
  2. cto.ReadTotalTimeoutMultiplier = MAXDWORD;
  3. cto.ReadTotalTimeoutConstant = 200;
in file kiss/targets/cbc2/src/QSerialPort.cpp to reduce the time it spends waiting for responses on failed packets.

The line numbers in the code are correct as of commit 3df33d25203f45ae1e9766a4229a03f4fbbf2280.

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
BotPoints: 1168
User offline. Last seen 3 years 39 weeks ago.

Nice work... I don't think KIPR noticed this thread; you might want to directly contact KIPR to get this fixed. I recall that Stephen Carlson found some similar issues last year with the KISS-C download speed in Windows, using a serial monitor. I don't believe KIPR ever used his research. :-(

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS