Skip to content

Commit

Permalink
Merge pull request #28 from kostyanf14/fixes
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
manio authored Jul 1, 2024
2 parents 23365ea + 999ad68 commit 126b5e3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion inputparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ bool InputParser::cmdOptionExists(const std::string &option) const {
!= this->tokens.end();
}

std::vector <std::string> tokens;
std::vector <std::string> tokens;
2 changes: 1 addition & 1 deletion inputparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class InputParser {
bool cmdOptionExists(const std::string &option) const;
};

#endif // ___INPUTPARSER_H
#endif // ___INPUTPARSER_H
4 changes: 2 additions & 2 deletions inverter.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ amperage_factor=1.0
# reading compared to measurement tools. Normally this will remain '1'
watt_factor=1.01

# Depending on the protocol version used and your device,
# Depending on the protocol version used and your device,
# you might need to change the following parameters

#### For Axpert VM3 inverter like, use those values ###
# This allows you to modify the buffersize for the qpiri command
# This allows you to modify the buffersize for the qpiri command
qpiri=98

# This allows you to modify the buffersize for the qpiws command
Expand Down
6 changes: 3 additions & 3 deletions inverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ bool cInverter::query(const char *cmd) {
cfsetspeed(&settings, baud); // baud rate
settings.c_cflag &= ~PARENB; // no parity
settings.c_cflag &= ~CSTOPB; // 1 stop bit
settings.c_cflag &= ~CSIZE; // Clear all bits that set the data size
settings.c_cflag &= ~CSIZE; // Clear all bits that set the data size
settings.c_cflag |= CS8 | CLOCAL; // 8 bits

settings.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars)
settings.c_lflag &= ~ICANON;
settings.c_lflag &= ~ICANON;
settings.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl
settings.c_lflag &= ~ISIG;
settings.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed
Expand Down Expand Up @@ -135,7 +135,7 @@ bool cInverter::query(const char *cmd) {
if (buf[j] == 0x0d){
reading = false;
replysize = j+1;
printf("INVERTER: stop byte detected, buffersize might be %d for %s ", replysize, cmd);
lprintf("INVERTER: stop byte detected, buffersize might be %d for %s ", replysize, cmd);
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions inverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <thread>
#include <mutex>

#include <string>

using namespace std;

class cInverter {
Expand Down

0 comments on commit 126b5e3

Please sign in to comment.