#include <fstream>
#include <string>
#include <sstream>
+#include <signal.h>
#include "../lib/platform/threads/mutex.h"
#include "../lib/platform/util/timeutils.h"
#include "../lib/implementations/CECCommandHandler.h"
return currentTvPower == CEC_POWER_STATUS_ON;
}
+void sighandler(int iSignal)
+{
+ PrintToStdOut("signal caught: %d - exiting", iSignal);
+
+ g_parser->Close();
+ UnloadLibCec(g_parser);
+
+ exit(1);
+}
+
int main (int UNUSED(argc), char *UNUSED(argv[]))
{
+ if (signal(SIGINT, sighandler) == SIG_ERR)
+ {
+ PrintToStdOut("can't register sighandler");
+ return -1;
+ }
+
g_callbacks.Clear();
g_config.Clear();
PrintToStdOut("=== USB-CEC Adapter Configuration ===\n");
#include <fstream>
#include <string>
#include <sstream>
+#include <signal.h>
#include "../lib/platform/os.h"
#include "../lib/implementations/CECCommandHandler.h"
#include "../lib/platform/util/StdString.h"
return bReturn;
}
+void sighandler(int iSignal)
+{
+ PrintToStdOut("signal caught: %d - exiting", iSignal);
+ g_bExit = true;
+}
+
int main (int argc, char *argv[])
{
+ if (signal(SIGINT, sighandler) == SIG_ERR)
+ {
+ PrintToStdOut("can't register sighandler");
+ return -1;
+ }
+
g_config.Clear();
g_callbacks.Clear();
snprintf(g_config.strDeviceName, 13, "CECTester");