Ticket #166 (new enhancement)

Opened 8 months ago

Last modified 8 months ago

igclient --send=FILE fails when FILE starts with a space

Reported by: bluey Owned by: jdunn
Priority: normal Component: Software
Version: Severity: minor
Keywords: Cc:

Description

If you run

igclient --send=FILE

and the first line of FILE is

space 1000

igclient fails with:

Nov 25 15:49:22 2009 ERROR: Illegal pulse reading pulse file FILE(1): pulse 500
Nov 25 15:49:22 2009 ERROR: Failed to pack data: Invalid argument

We shouldn't fail if the first line of a code is a space. We should probably just ignore that line and send the rest of the file and print a warning that says:

WARNING: FILE begins with space, ignoring first line.

Change History

Changed 8 months ago by jdunn

  • type changed from defect to enhancement
  • component changed from USB IR Transceiver to Software

Seems reasonable. I'll take a look at doing that. Parsers suck in C, but it may also be time to make the parsing of that file be a little more advanced. Specifically:

  • skip leading spaces with a LOG_WARN
  • combine successive spaces or pulses with a LOG_WARN
    • this would make it easier to use the output of igclient --receiver-on
  • drop trailing spaces with a LOG_WARN
  • skip unrecognized lines?
    • probably not skip all unrecognized lines, but we may want to check the error message
    • make sure comments are allowed as they should be
Note: See TracTickets for help on using tickets.