Migliora discovery e pubblicazione MQTT per inverter in cascata
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 9m22s
Build Docker Image for Raspberry Pi / build-and-push (push) Successful in 9m22s
This commit is contained in:
@@ -175,6 +175,7 @@ int main(int argc, char* argv[]) {
|
||||
// Get command flag settings from the arguments (if any)
|
||||
InputParser cmdArgs(argc, argv);
|
||||
const string &rawcmd = cmdArgs.getCmdOption("-r");
|
||||
const string ¶llelDataCount = cmdArgs.getCmdOption("-P");
|
||||
|
||||
if(cmdArgs.cmdOptionExists("-h") || cmdArgs.cmdOptionExists("--help")) {
|
||||
return print_help();
|
||||
@@ -209,6 +210,27 @@ int main(int argc, char* argv[]) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Parallel inverter QPGS read (single session)
|
||||
if(cmdArgs.cmdOptionExists("-P") || cmdArgs.cmdOptionExists("--parallel-qpgs")) {
|
||||
int count = 2;
|
||||
if (!parallelDataCount.empty()) {
|
||||
try {
|
||||
count = stoi(parallelDataCount);
|
||||
} catch (...) {
|
||||
count = 2;
|
||||
}
|
||||
}
|
||||
|
||||
vector<string> replies;
|
||||
int ok = ups->QueryParallelQpgs(count, replies);
|
||||
printf("PARALLEL_COUNT=%d\n", count);
|
||||
for (int i = 0; i < count; i++) {
|
||||
printf("QPGS%d_REPLY=%s\n", i, replies[i].c_str());
|
||||
}
|
||||
printf("PARALLEL_OK=%d\n", ok);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Logic to send 'raw commands' to the inverter..
|
||||
if (!rawcmd.empty()) {
|
||||
ups->ExecuteCmd(rawcmd);
|
||||
|
||||
Reference in New Issue
Block a user