Send a break to a serial/rs232 device from the terminal using tcsendbrake termios. I use this on OS X to soft-reset my mbed LPC1768. To compile: gcc -o sendbreak sendbreak.c Don't have gcc installed? I think it comes with xcode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <termios.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
int main(int argc,char** argv) { | |
if (argc<2) { | |
printf("Usage: One parameter, the device to send the " | |
"break to. Example: %s /dev/tty.usbmodem622 \n",argv[0]); | |
} else { | |
int tty_fd = open(argv[1], O_RDWR | O_NONBLOCK); | |
tcsendbreak(tty_fd, 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment