#include "qt_pi_serial/ros_node.h"
#include <csignal>

void sighandler(int signum) {
  printf("Caught signal %d, Exiting after thread completion\n", signum);

  shutdown_node();
  close_comm();

  printf("COMM CLOSED\n");

  ros::shutdown();

  printf("shutting down\n");
}

int main(int argc, char **argv) {

  ros::init(argc, argv, "serial_driver");

  ros::NodeHandle n;

  init_node(n);

  signal(SIGINT, sighandler);
  ros::spin();
}
