cec: added PollDevice()/cec_poll_device()
[deb_libcec.git] / src / testclient / main.cpp
CommitLineData
abbca718
LOK
1/*
2 * This file is part of the libCEC(R) library.
3 *
4 * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved.
5 * libCEC(R) is an original work, containing original code.
6 *
7 * libCEC(R) is a trademark of Pulse-Eight Limited.
8 *
9 * This program is dual-licensed; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 *
23 *
24 * Alternatively, you can license this library under a commercial license,
25 * please contact Pulse-Eight Licensing for more information.
26 *
27 * For more information contact:
28 * Pulse-Eight Licensing <license@pulse-eight.com>
29 * http://www.pulse-eight.com/
30 * http://www.pulse-eight.net/
31 */
32
761dcc45 33#include <cec.h>
acec5f48 34
abbca718
LOK
35#include <cstdio>
36#include <fcntl.h>
37#include <iostream>
e6d2161b 38#include <fstream>
abbca718 39#include <string>
b9187cc6 40#include <sstream>
acec5f48
LOK
41#include "../lib/platform/threads.h"
42#include "../lib/util/StdString.h"
abbca718
LOK
43
44using namespace CEC;
45using namespace std;
46
d75be19b 47#define CEC_TEST_CLIENT_VERSION 1
abbca718 48
761dcc45 49#include <cecloader.h>
8bc45476 50
3d0dca16 51int g_cecLogLevel = CEC_LOG_ALL;
d6cc5f60 52int g_iLogicalAddress = CECDEVICE_PLAYBACKDEVICE1;
3d0dca16
LOK
53ofstream g_logOutput;
54bool g_bShortLog = false;
55CStdString g_strPort;
b9187cc6 56
8bca69de 57inline bool HexStrToInt(const std::string& data, uint8_t& value)
b9187cc6 58{
8bca69de
LOK
59 int iTmp(0);
60 if (sscanf(data.c_str(), "%x", &iTmp) == 1)
61 {
62 if (iTmp > 256)
63 value = 255;
64 else if (iTmp < 0)
65 value = 0;
66 else
67 value = (uint8_t) iTmp;
b9187cc6 68
8bca69de
LOK
69 return true;
70 }
71
72 return false;
73}
b9187cc6
LOK
74
75//get the first word (separated by whitespace) from string data and place that in word
76//then remove that word from string data
77bool GetWord(string& data, string& word)
78{
79 stringstream datastream(data);
80 string end;
81
82 datastream >> word;
83 if (datastream.fail())
84 {
85 data.clear();
86 return false;
87 }
88
89 size_t pos = data.find(word) + word.length();
90
91 if (pos >= data.length())
92 {
93 data.clear();
94 return true;
95 }
96
97 data = data.substr(pos);
98
99 datastream.clear();
100 datastream.str(data);
101
102 datastream >> end;
103 if (datastream.fail())
104 data.clear();
105
106 return true;
107}
108
2abe74eb 109void flush_log(ICECAdapter *cecParser)
abbca718
LOK
110{
111 cec_log_message message;
112 while (cecParser && cecParser->GetNextLogMessage(&message))
113 {
bdd433cb 114 if ((message.level & g_cecLogLevel) == message.level)
abbca718 115 {
e6d2161b 116 CStdString strLevel;
bdd433cb
LOK
117 switch (message.level)
118 {
119 case CEC_LOG_ERROR:
e6d2161b 120 strLevel = "ERROR: ";
bdd433cb
LOK
121 break;
122 case CEC_LOG_WARNING:
e6d2161b 123 strLevel = "WARNING: ";
bdd433cb
LOK
124 break;
125 case CEC_LOG_NOTICE:
e6d2161b 126 strLevel = "NOTICE: ";
bdd433cb
LOK
127 break;
128 case CEC_LOG_TRAFFIC:
e6d2161b 129 strLevel = "TRAFFIC: ";
bdd433cb
LOK
130 break;
131 case CEC_LOG_DEBUG:
e6d2161b 132 strLevel = "DEBUG: ";
bdd433cb
LOK
133 break;
134 default:
135 break;
136 }
40339852 137
8bc45476
LOK
138 CStdString strFullLog;
139 strFullLog.Format("%s[%16lld]\t%s", strLevel.c_str(), message.time, message.message);
140 cout << strFullLog.c_str() << endl;
e6d2161b
LOK
141
142 if (g_logOutput.is_open())
8bc45476
LOK
143 {
144 if (g_bShortLog)
145 g_logOutput << message.message << endl;
146 else
147 g_logOutput << strFullLog.c_str() << endl;
148 }
bdd433cb 149 }
abbca718
LOK
150 }
151}
152
2abe74eb 153void list_devices(ICECAdapter *parser)
abbca718 154{
25701fa6
LOK
155 cec_adapter *devices = new cec_adapter[10];
156 uint8_t iDevicesFound = parser->FindAdapters(devices, 10, NULL);
abbca718
LOK
157 if (iDevicesFound <= 0)
158 {
25701fa6 159 cout << "Found devices: NONE" << endl;
abbca718
LOK
160 }
161 else
162 {
25701fa6
LOK
163 CStdString strLog;
164 strLog.Format("Found devices: %d", iDevicesFound);
165 cout << strLog.c_str() << endl;
166 for (unsigned int iDevicePtr = 0; iDevicePtr < iDevicesFound; iDevicePtr++)
abbca718
LOK
167 {
168 CStdString strDevice;
25701fa6 169 strDevice.Format("device: %d\npath: %s\ncom port: %s", iDevicePtr + 1, devices[iDevicePtr].path, devices[iDevicePtr].comm);
abbca718
LOK
170 cout << endl << strDevice.c_str() << endl;
171 }
172 }
173}
174
175void show_help(const char* strExec)
176{
177 cout << endl <<
178 strExec << " {-h|--help|-l|--list-devices|[COM PORT]}" << endl <<
179 endl <<
180 "parameters:" << endl <<
8bc45476
LOK
181 " -h --help Shows this help text" << endl <<
182 " -l --list-devices List all devices on this system" << endl <<
d6cc5f60 183 " -la --logical-address {a} The logical address to use." << endl <<
8bc45476
LOK
184 " -f --log-file {file} Writes all libCEC log message to a file" << endl <<
185 " -sf --short-log-file {file} Writes all libCEC log message without timestamps" << endl <<
186 " and log levels to a file." << endl <<
606034b6 187 " -d --log-level {level} Sets the log level. See cectypes.h for values." << endl <<
8bc45476
LOK
188 " [COM PORT] The com port to connect to. If no COM" << endl <<
189 " port is given, the client tries to connect to the" << endl <<
190 " first device that is detected." << endl <<
825ddb96 191 endl <<
8bc45476
LOK
192 "Type 'h' or 'help' and press enter after starting the client to display all " << endl <<
193 "available commands" << endl;
825ddb96
LOK
194}
195
196void show_console_help(void)
197{
198 cout << endl <<
199 "================================================================================" << endl <<
200 "Available commands:" << endl <<
201 endl <<
202 "tx {bytes} transfer bytes over the CEC line." << endl <<
1f0e9e0f 203 "txn {bytes} transfer bytes but don't wait for transmission ACK." << endl <<
825ddb96
LOK
204 "[tx 40 00 FF 11 22 33] sends bytes 0x40 0x00 0xFF 0x11 0x22 0x33" << endl <<
205 endl <<
88f45c9b
LOK
206 "on {address} power on the device with the given logical address." << endl <<
207 "[on 5] power on a connected audio system" << endl <<
208 endl <<
209 "standby {address} put the device with the given address in standby mode." << endl <<
210 "[standby 0] powers off the TV" << endl <<
211 endl <<
825ddb96
LOK
212 "la {logical_address} change the logical address of the CEC adapter." << endl <<
213 "[la 4] logical address 4" << endl <<
214 endl <<
a424ebac
LOK
215 "pa {physical_address} change the physical address of the CEC adapter." << endl <<
216 "[pa 10 00] physical address 1.0.0.0" << endl <<
217 endl <<
1969b140
LOK
218 "osd {addr} {string} set OSD message on the specified device." << endl <<
219 "[osd 0 Test Message] displays 'Test Message' on the TV" << endl <<
220 endl <<
6a1c0009
LOK
221 "ver {addr} get the CEC version of the specified device." << endl <<
222 "[ver 0] get the CEC version of the TV" << endl <<
223 endl <<
44c74256
LOK
224 "ven {addr} get the vendor ID of the specified device." << endl <<
225 "[ven 0] get the vendor ID of the TV" << endl <<
226 endl <<
227 "lang {addr} get the menu language of the specified device." << endl <<
a3269a0a
LOK
228 "[lang 0] get the menu language of the TV" << endl <<
229 endl <<
e55f3f70
LOK
230 "pow {addr} get the power status of the specified device." << endl <<
231 "[pow 0] get the power status of the TV" << endl <<
232 endl <<
57f45e6c
LOK
233 "poll {addr} poll the specified device." << endl <<
234 "[poll 0] sends a poll message to the TV" << endl <<
235 endl <<
8b7e5ff6 236 "[mon] {1|0} enable or disable CEC bus monitoring." << endl <<
bdd433cb 237 "[log] {1 - 31} change the log level. see cectypes.h for values." << endl <<
825ddb96 238 "[ping] send a ping command to the CEC adapter." << endl <<
88f45c9b
LOK
239 "[bl] to let the adapter enter the bootloader, to upgrade" << endl <<
240 " the flash rom." << endl <<
241 "[r] reconnect to the CEC adapter." << endl <<
825ddb96 242 "[h] or [help] show this help." << endl <<
88f45c9b
LOK
243 "[q] or [quit] to quit the CEC test client and switch off all" << endl <<
244 " connected CEC devices." << endl <<
825ddb96 245 "================================================================================" << endl;
abbca718
LOK
246}
247
248int main (int argc, char *argv[])
249{
d54c6c91 250 ICECAdapter *parser = LoadLibCec("CECTester");
d75be19b 251 if (!parser || parser->GetMinLibVersion() > CEC_TEST_CLIENT_VERSION)
abbca718 252 {
acec5f48
LOK
253#ifdef __WINDOWS__
254 cout << "Cannot load libcec.dll" << endl;
255#else
256 cout << "Cannot load libcec.so" << endl;
257#endif
abbca718
LOK
258 return 1;
259 }
260 CStdString strLog;
d75be19b 261 strLog.Format("CEC Parser created - libcec version %d.%d", parser->GetLibVersionMajor(), parser->GetLibVersionMinor());
abbca718
LOK
262 cout << strLog.c_str() << endl;
263
264 //make stdin non-blocking
265#ifndef __WINDOWS__
266 int flags = fcntl(0, F_GETFL, 0);
267 flags |= O_NONBLOCK;
268 fcntl(0, F_SETFL, flags);
269#endif
270
3d0dca16
LOK
271 int iArgPtr = 1;
272 while (iArgPtr < argc)
e6d2161b 273 {
3d0dca16 274 if (argc >= iArgPtr + 1)
e6d2161b 275 {
3d0dca16
LOK
276 if (!strcmp(argv[iArgPtr], "-f") ||
277 !strcmp(argv[iArgPtr], "--log-file") ||
278 !strcmp(argv[iArgPtr], "-sf") ||
279 !strcmp(argv[iArgPtr], "--short-log-file"))
280 {
281 if (argc >= iArgPtr + 2)
282 {
283 g_logOutput.open(argv[iArgPtr + 1]);
284 g_bShortLog = (!strcmp(argv[iArgPtr], "-sf") || !strcmp(argv[iArgPtr], "--short-log-file"));
285 iArgPtr += 2;
286 }
287 else
288 {
606034b6
LOK
289 cout << "== skipped log-file parameter: no file given ==" << endl;
290 ++iArgPtr;
291 }
292 }
293 else if (!strcmp(argv[iArgPtr], "-d") ||
294 !strcmp(argv[iArgPtr], "--log-level"))
295 {
296 if (argc >= iArgPtr + 2)
297 {
298 int iNewLevel = atoi(argv[iArgPtr + 1]);
299 if (iNewLevel >= CEC_LOG_ERROR && iNewLevel <= CEC_LOG_ALL)
300 {
301 g_cecLogLevel = iNewLevel;
302 cout << "log level set to " << argv[iArgPtr + 1] << endl;
303 }
304 else
305 {
306 cout << "== skipped log-level parameter: invalid level '" << argv[iArgPtr + 1] << "' ==" << endl;
307 }
308 iArgPtr += 2;
309 }
310 else
311 {
312 cout << "== skipped log-level parameter: no level given ==" << endl;
3d0dca16
LOK
313 ++iArgPtr;
314 }
315 }
d6cc5f60
LOK
316 else if (!strcmp(argv[iArgPtr], "-la") ||
317 !strcmp(argv[iArgPtr], "--logical-address"))
318 {
319 if (argc >= iArgPtr + 2)
320 {
321 int iNewAddress = atoi(argv[iArgPtr + 1]);
322 if (iNewAddress >= 0 && iNewAddress <= 15)
323 {
324 g_iLogicalAddress = iNewAddress;
325 cout << "logical address set to " << argv[iArgPtr + 1] << endl;
326 }
327 else
328 {
329 cout << "== skipped logical-address parameter: invalid address '" << argv[iArgPtr + 1] << "' ==" << endl;
330 }
331 iArgPtr += 2;
332 }
333 else
334 {
335 cout << "== skipped logical-address parameter: no address given ==" << endl;
336 ++iArgPtr;
337 }
338 }
3d0dca16
LOK
339 else if (!strcmp(argv[iArgPtr], "--list-devices") ||
340 !strcmp(argv[iArgPtr], "-l"))
341 {
342 list_devices(parser);
343 UnloadLibCec(parser);
344 return 0;
345 }
346 else if (!strcmp(argv[iArgPtr], "--help") ||
347 !strcmp(argv[iArgPtr], "-h"))
348 {
349 show_help(argv[0]);
350 UnloadLibCec(parser);
351 return 0;
352 }
353 else
354 {
355 g_strPort = argv[iArgPtr++];
356 }
e6d2161b
LOK
357 }
358 }
359
3d0dca16 360 if (g_strPort.IsEmpty())
abbca718
LOK
361 {
362 cout << "no serial port given. trying autodetect: ";
25701fa6
LOK
363 cec_adapter devices[10];
364 uint8_t iDevicesFound = parser->FindAdapters(devices, 10, NULL);
abbca718
LOK
365 if (iDevicesFound <= 0)
366 {
367 cout << "FAILED" << endl;
368 UnloadLibCec(parser);
369 return 1;
370 }
371 else
372 {
373 cout << endl << " path: " << devices[0].path << endl <<
3d0dca16
LOK
374 " com port: " << devices[0].comm << endl << endl;
375 g_strPort = devices[0].comm;
abbca718
LOK
376 }
377 }
e6d2161b 378
d6cc5f60
LOK
379 parser->SetLogicalAddress((cec_logical_address) g_iLogicalAddress);
380
3d0dca16 381 if (!parser->Open(g_strPort.c_str()))
abbca718 382 {
3d0dca16 383 cout << "unable to open the device on port " << g_strPort << endl;
abbca718
LOK
384 flush_log(parser);
385 UnloadLibCec(parser);
386 return 1;
387 }
388
389 cout << "cec device opened" << endl;
abbca718 390
8829d291 391 parser->PowerOnDevices(CECDEVICE_TV);
abbca718
LOK
392 flush_log(parser);
393
394 parser->SetActiveView();
395 flush_log(parser);
396
397 bool bContinue(true);
398 cout << "waiting for input" << endl;
399 while (bContinue)
400 {
401 flush_log(parser);
402
b5b53c7d
LOK
403 /* just ignore the command buffer and clear it */
404 cec_command dummy;
405 while (parser && parser->GetNextCommand(&dummy)) {}
406
abbca718
LOK
407 string input;
408 getline(cin, input);
409 cin.clear();
410
411 if (!input.empty())
412 {
413 string command;
414 if (GetWord(input, command))
415 {
faa6a23b 416 if (command == "tx" || command == "txn")
abbca718
LOK
417 {
418 string strvalue;
8bca69de 419 uint8_t ivalue;
9dee1670 420 cec_command bytes;
25701fa6
LOK
421 bytes.clear();
422
abbca718 423 while (GetWord(input, strvalue) && HexStrToInt(strvalue, ivalue))
b2da2768 424 bytes.push_back(ivalue);
abbca718 425
8d84e2c0 426 if (command == "txn")
1f0e9e0f 427 bytes.transmit_timeout = 0;
8d84e2c0
LOK
428
429 parser->Transmit(bytes);
abbca718 430 }
88f45c9b
LOK
431 else if (command == "on")
432 {
433 string strValue;
434 uint8_t iValue = 0;
435 if (GetWord(input, strValue) && HexStrToInt(strValue, iValue) && iValue <= 0xF)
436 {
437 parser->PowerOnDevices((cec_logical_address) iValue);
438 }
439 else
440 {
441 cout << "invalid destination" << endl;
442 }
443 }
444 else if (command == "standby")
445 {
446 string strValue;
447 uint8_t iValue = 0;
448 if (GetWord(input, strValue) && HexStrToInt(strValue, iValue) && iValue <= 0xF)
449 {
450 parser->StandbyDevices((cec_logical_address) iValue);
451 }
452 else
453 {
454 cout << "invalid destination" << endl;
455 }
456 }
57f45e6c
LOK
457 else if (command == "poll")
458 {
459 string strValue;
460 uint8_t iValue = 0;
461 if (GetWord(input, strValue) && HexStrToInt(strValue, iValue) && iValue <= 0xF)
462 {
463 if (parser->PollDevice((cec_logical_address) iValue))
464 cout << "POLL message sent" << endl;
465 else
466 cout << "POLL message not sent" << endl;
467 }
468 else
469 {
470 cout << "invalid destination" << endl;
471 }
472 }
6dfe9213
LOK
473 else if (command == "la")
474 {
475 string strvalue;
6dfe9213
LOK
476 if (GetWord(input, strvalue))
477 {
478 parser->SetLogicalAddress((cec_logical_address) atoi(strvalue.c_str()));
abbca718
LOK
479 }
480 }
a424ebac
LOK
481 else if (command == "pa")
482 {
483 string strB1, strB2;
484 uint8_t iB1, iB2;
485 if (GetWord(input, strB1) && HexStrToInt(strB1, iB1) &&
486 GetWord(input, strB2) && HexStrToInt(strB2, iB2))
487 {
488 uint16_t iPhysicalAddress = ((uint16_t)iB1 << 8) + iB2;
489 parser->SetPhysicalAddress(iPhysicalAddress);
490 }
491 }
1969b140
LOK
492 else if (command == "osd")
493 {
494 bool bFirstWord(false);
495 string strAddr, strMessage, strWord;
496 uint8_t iAddr;
497 if (GetWord(input, strAddr) && HexStrToInt(strAddr, iAddr) && iAddr < 0xF)
498 {
499 while (GetWord(input, strWord))
500 {
501 if (bFirstWord)
502 {
503 bFirstWord = false;
504 strMessage.append(" ");
505 }
506 strMessage.append(strWord);
507 }
508 parser->SetOSDString((cec_logical_address) iAddr, CEC_DISPLAY_CONTROL_DISPLAY_FOR_DEFAULT_TIME, strMessage.c_str());
509 }
510 }
abbca718
LOK
511 else if (command == "ping")
512 {
2abe74eb 513 parser->PingAdapter();
abbca718 514 }
8b7e5ff6
LOK
515 else if (command == "mon")
516 {
517 CStdString strEnable;
518 if (GetWord(input, strEnable) && (strEnable.Equals("0") || strEnable.Equals("1")))
519 {
520 parser->SwitchMonitoring(strEnable.Equals("1"));
521 }
522 }
abbca718
LOK
523 else if (command == "bl")
524 {
525 parser->StartBootloader();
526 }
a3269a0a
LOK
527 else if (command == "lang")
528 {
529 CStdString strDev;
530 if (GetWord(input, strDev))
531 {
532 int iDev = atoi(strDev);
533 if (iDev >= 0 && iDev < 15)
534 {
535 CStdString strLog;
536 cec_menu_language language;
537 if (parser->GetDeviceMenuLanguage((cec_logical_address) iDev, &language))
538 strLog.Format("menu language '%s'", language.language);
539 else
540 strLog = "failed!";
541 cout << strLog.c_str() << endl;
542 }
543 }
544 }
44c74256
LOK
545 else if (command == "ven")
546 {
547 CStdString strDev;
548 if (GetWord(input, strDev))
549 {
550 int iDev = atoi(strDev);
551 if (iDev >= 0 && iDev < 15)
552 {
553 uint64_t iVendor = parser->GetDeviceVendorId((cec_logical_address) iDev);
554 CStdString strLog;
555 strLog.Format("vendor id: %06x", iVendor);
556 cout << strLog.c_str() << endl;
557 }
558 }
559 }
6a1c0009
LOK
560 else if (command == "ver")
561 {
562 CStdString strDev;
563 if (GetWord(input, strDev))
564 {
565 int iDev = atoi(strDev);
566 if (iDev >= 0 && iDev < 15)
567 {
568 cec_version iVersion = parser->GetDeviceCecVersion((cec_logical_address) iDev);
569 switch (iVersion)
570 {
571 case CEC_VERSION_1_2:
572 cout << "CEC version 1.2" << endl;
573 break;
574 case CEC_VERSION_1_2A:
575 cout << "CEC version 1.2a" << endl;
576 break;
577 case CEC_VERSION_1_3:
578 cout << "CEC version 1.3" << endl;
579 break;
580 case CEC_VERSION_1_3A:
581 cout << "CEC version 1.3a" << endl;
582 break;
583 default:
584 cout << "unknown CEC version" << endl;
585 break;
586 }
587 }
588 }
589 }
e55f3f70
LOK
590 else if (command == "pow")
591 {
592 CStdString strDev;
593 if (GetWord(input, strDev))
594 {
595 int iDev = atoi(strDev);
596 if (iDev >= 0 && iDev < 15)
597 {
598 cec_power_status iPower = parser->GetDevicePowerStatus((cec_logical_address) iDev);
599 switch (iPower)
600 {
601 case CEC_POWER_STATUS_ON:
602 cout << "powered on" << endl;
603 break;
604 case CEC_POWER_STATUS_IN_TRANSITION_ON_TO_STANDBY:
605 cout << "on -> standby" << endl;
606 break;
607 case CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON:
608 cout << "standby -> on" << endl;
609 break;
610 case CEC_POWER_STATUS_STANDBY:
611 cout << "standby" << endl;
612 break;
613 default:
614 cout << "unknown power status" << endl;
615 break;
616 }
617 }
618 }
619 }
12027dbe
LOK
620 else if (command == "r")
621 {
25701fa6 622 cout << "closing the connection" << endl;
12027dbe 623 parser->Close();
25701fa6
LOK
624 flush_log(parser);
625
626 cout << "opening a new connection" << endl;
3d0dca16 627 parser->Open(g_strPort.c_str());
25701fa6
LOK
628 flush_log(parser);
629
630 cout << "setting active view" << endl;
12027dbe
LOK
631 parser->SetActiveView();
632 }
825ddb96
LOK
633 else if (command == "h" || command == "help")
634 {
635 show_console_help();
636 }
abbca718
LOK
637 else if (command == "q" || command == "quit")
638 {
639 bContinue = false;
640 }
bdd433cb
LOK
641 else if (command == "log")
642 {
643 CStdString strLevel;
644 if (GetWord(input, strLevel))
645 {
646 int iNewLevel = atoi(strLevel);
647 if (iNewLevel >= CEC_LOG_ERROR && iNewLevel <= CEC_LOG_ALL)
648 {
649 g_cecLogLevel = iNewLevel;
650 cout << "log level changed to " << strLevel.c_str() << endl;
651 }
652 }
653 }
abbca718
LOK
654 }
655 if (bContinue)
656 cout << "waiting for input" << endl;
657 }
658 CCondition::Sleep(50);
659 }
660
2abe74eb 661 parser->StandbyDevices(CECDEVICE_BROADCAST);
5f39c4d8 662 parser->Close();
abbca718
LOK
663 flush_log(parser);
664 UnloadLibCec(parser);
e6d2161b
LOK
665
666 if (g_logOutput.is_open())
667 g_logOutput.close();
668
abbca718
LOK
669 return 0;
670}