Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol): add support for CFSolo serial ports and CFMini on-board serial port #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
@@ -89,7 +89,7 @@ var CFL = {
_packetRegex: function(id,cmd,payload) {
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