Skip to content

Conversation

@mcarter00
Copy link

@mcarter00 mcarter00 commented Aug 10, 2017

Problem

  • Numbered serial ports on CFSolo didn't work with CFLinkJS.
  • CFMini on-board serial port replaces it's CFLink ID with FF, causing the SPR messages not to be matched by the watcher regex.

Solution

  • Add support for correctly parsing CFSolo serial messages with port numbers.
  • Hack around this by accepting "FF" or the CFLinkID (This could cause problems with more than one CFMini watchSerial() on the same CFLink bus.

@jarrodbell
@fpillet

@mcarter00 mcarter00 changed the title fix(protocol): add support for CFSolo serial ports fix(protocol): add support for CFSolo serial ports and CFMini on-board serial port Aug 10, 2017
id = (id == null || id === "") ? "[\\s\\S]" : "\\"+String.fromCharCode(parseInt(id,16));
payload = (payload == null || payload === "") ? "" : payload.replace("|","\\|");
return new RegExp("^\xF2" + id + "\xF3" + cmd + "\xF4" + payload);
return new RegExp("^\xF2" + '(' +id + '|\xFF)' + "\xF3" + cmd + "\xF4" + payload); // TODO: fix hack here around FF.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ugly, but I'm not sure how else to handle the fact that the on-board serial port in a CFMini sends back FF instead of the CFLink ID. Maybe you can issue a firmware update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant