Skip to content

Instantly share code, notes, and snippets.

@speters
Created July 8, 2022 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save speters/43a23e201ce8693bb0e1e8d878874fbf to your computer and use it in GitHub Desktop.
Save speters/43a23e201ce8693bb0e1e8d878874fbf to your computer and use it in GitHub Desktop.
A simple candump to yacht devices canview converter using netcat and some sed
candump -t A can0 | sed -e 's/ (.* \(.*\)\.\(...\).*) *can. *\([0-9A-F]*\) *\[.*\] */\1.\2 R \3 /g' -e 's/[\r\n]*$/\r/' | nc -l -p 1457 2>&1 | sed -u -n -e 's/^\([^ ]*\) /\1#/g;s/ //g;s/\r//g;/^$/!p;' | while IFS="" read CMD ; do cansend can0 $CMD ; done
@speters
Copy link
Author

speters commented Jul 8, 2022

does not report back that command has been sent, maybe convert to using exec filedescriptor redirection or some more elaborate script in Python...

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