diff --git a/doc/man/vcontrold.rst b/doc/man/vcontrold.rst index 19eef054..963ab979 100644 --- a/doc/man/vcontrold.rst +++ b/doc/man/vcontrold.rst @@ -14,7 +14,9 @@ Unix daemon for communication with Viessmann Vito heatings SYNOPSIS ======== - vcontrold [-x ] [-d ] [-l ] [-p ] [-s] [-n] [-g] [-v] [-V] + vcontrold [-x ] [-d ] [-l ] [-p ] [-s] [-n] + [-c ] [-P ] [-U ] [-G ] + [-i] [-g] [-4] [-6] [-v] [-V] [-?] DESCRIPTION =========== @@ -28,25 +30,35 @@ OPTIONS -x , \--xmlfile location of the main config file --d , \--device +-d , \--device serial device to use. This option overrides corresponding entry in the config file. +-l , \--logfile + use instead of syslog. + -p , \--port TCP to use for remote connections. - The default is 3002 and can be specified - in the config file. + The default is 3002 and can be specified in the config file. This option overrides the corresponding entry in the config file. -s, \--syslog use syslog --l , \--logfile - use instead of syslog. +-n, \--nodaemon + do not fork. This is for testing purpose only. Normaly vcontrold + will detach from the controlling terminal and put itself into the + background. + +-c , \--commandfile + file with lines containing sequences of icmds (WAIT, SEND, RECV, PAUSE) + as used in protocol definitions. + Lines get executed in order + (developer option) --P , \--pidfile - write process id to when started as a daemon. - When started as root, is written prior to dropping privileges. +-P , \--pidfile + write process id to when started as a daemon. + When started as root, is written prior to dropping privileges. This overrides the corresponding entry in the config file. -U , \--username @@ -59,31 +71,26 @@ OPTIONS instead of group dialout. This overrides the corresponding entry in the config file. If using a serial link, ensure that user or group has access rights to the serial device. --n, \--nodaemon - do not fork. This is for testing purpose only. Normaly vcontrold - will detach from the controlling terminal and put itself into the - background. - -i, \--vsim use a temp file in ``/tmp/sim-devid.ini`` for use with the vsim simulator (developer option) --c , \--commandfile - file with lines containing sequences of icmds (WAIT, SEND, RECV, PAUSE) - as used in protocol definitions. - Lines get executed in order - (developer option) - -g, \--debug enable debug mode +-4, --inet4 + use IP v4 socket + +-6, --inet6 + use IP v6 socket + -v, \--verbose verbose mode -V, \--Version print version information, then exit -\--help +-?, \--help usage information FILES diff --git a/src/vcontrold.c b/src/vcontrold.c index 7d1b34f6..0e7cac57 100644 --- a/src/vcontrold.c +++ b/src/vcontrold.c @@ -70,7 +70,7 @@ extern devicePtr devPtr; extern configPtr cfgPtr; // Declarations -int readCmdFile(char *filename, char *result, int *resultLen, char *device ); +int readCmdFile(char *filename, char *result, int *resultLen, char *device); int interactive(int socketfd, char *device); void printHelp(int socketfd); int rawModus (int socketfd, char *device); @@ -86,6 +86,7 @@ void usage() printf("usage: vcontrold [-x|--xmlfile xml-file] [-d|--device ]\n"); printf(" [-l|--logfile ] [-p|--port port] [-s|--syslog]\n"); printf(" [-n|--nodaemon] [-v|--verbose] [-V|--Version]\n"); + printf(" [-c|--commandfile ] [-P|--pidfile ]"); printf(" [-U|--username ] [-G|--groupname ]\n"); printf(" [-?|--help] [-i|--vsim] [-g|--debug]\n"); printf(" [-4|--inet4] [-6|--inet6]\n\n"); @@ -118,7 +119,7 @@ int reloadConfig() } } -int readCmdFile(char *filename, char *result, int *resultLen, char *device ) +int readCmdFile(char *filename, char *result, int *resultLen, char *device) { FILE *cmdPtr; char line[MAXBUF]; @@ -265,7 +266,7 @@ int rawModus(int socketfd, char *device) return 0; // is this correct? } -int interactive(int socketfd, char *device ) +int interactive(int socketfd, char *device) { char readBuf[1000]; char *readPtr; @@ -627,7 +628,9 @@ static void sigTermHandler(int signo) logIT(LOG_NOTICE, "Received signal %d", signo); } vcontrol_semfree(); - if (pidFile) { unlink(pidFile); } + if (pidFile) { + unlink(pidFile); + } exit(1); }