use 9600 Baud
This commit is contained in:
@ -126,6 +126,7 @@ void termHandler(int signum)
|
|||||||
void init() {
|
void init() {
|
||||||
infolog("Register termination handler\n");
|
infolog("Register termination handler\n");
|
||||||
signal(SIGTERM, termHandler);
|
signal(SIGTERM, termHandler);
|
||||||
|
signal(SIGINT, termHandler);
|
||||||
|
|
||||||
infolog("setting up gpios\n");
|
infolog("setting up gpios\n");
|
||||||
|
|
||||||
@ -182,6 +183,12 @@ int openSerial(char *serialDevice, uint32_t speedNum) {
|
|||||||
case 2400:
|
case 2400:
|
||||||
speed = B2400;
|
speed = B2400;
|
||||||
break;
|
break;
|
||||||
|
case 4800:
|
||||||
|
speed = B4800;
|
||||||
|
break;
|
||||||
|
case 9600:
|
||||||
|
speed = B9600;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
errlog("speed %d not supported\n", speedNum);
|
errlog("speed %d not supported\n", speedNum);
|
||||||
return -1;
|
return -1;
|
||||||
@ -460,7 +467,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
|
|
||||||
infolog("opening device\n");
|
infolog("opening device\n");
|
||||||
int fd = openSerial(DEFAULT_SERIAL_DEVICE, 2400);
|
int fd = openSerial(DEFAULT_SERIAL_DEVICE, 9600);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
errlog("unable to open device, fatal error\n");
|
errlog("unable to open device, fatal error\n");
|
||||||
myExit(-1);
|
myExit(-1);
|
||||||
|
Reference in New Issue
Block a user