/* Copyright (C) 2017-2019 Fredrik Öhrström This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include"cmdline.h" #include"config.h" #include"meters.h" #include"printer.h" #include"serial.h" #include"util.h" #include"version.h" #include"wmbus.h" #include #include #include #include #include #include #include #include #include #include using namespace std; void oneshotCheck(Configuration *cmdline, SerialCommunicationManager *manager, Telegram *t, Meter *meter, vector> &meters); bool startUsingCommandline(Configuration *cmdline); void startUsingConfigFiles(string root, bool is_daemon); void startDaemon(string pid_file); // Will use config files. int main(int argc, char **argv) { auto cmdline = parseCommandLine(argc, argv); if (cmdline->version) { printf("wmbusmeters: " VERSION "\n"); printf(COMMIT "\n"); exit(0); } if (cmdline->license) { const char * license = R"LICENSE( Copyright (C) 2017-2019 Fredrik Öhrström This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . You can download the source here: https://github.com/weetmuts/wmbusmeters But you can also request the source from the person/company that provided you with this binary. Read the full license for all details. )LICENSE"; puts(license); exit(0); } if (cmdline->need_help) { printf("wmbusmeters version: " VERSION "\n"); const char *msg = R"MANUAL( Usage: wmbusmeters {options} {:suffix} ( [meter_name] [meter_type]{:} [meter_id] [meter_key] )* As you can use: --addconversions=+ add conversion to these units to json and meter env variables (GJ) --debug for a lot of information --exitafter=