ebusd_scan: scanVaillant reworked.

This commit is contained in:
Roland Jax
2014-06-09 09:38:50 +02:00
parent 8bdbb925a7
commit 5ce18994d5
+5 -11
View File
@@ -109,8 +109,8 @@ void define_args()
void scanVaillant(TCPSocket* socket, const std::string address)
{
std::cout << " s/n: '";
std::string article;
Decode* help = NULL;
std::ostringstream sstr;
for (int i = 24; i < 28; i++) {
// build message
@@ -132,18 +132,12 @@ void scanVaillant(TCPSocket* socket, const std::string address)
std::string item(data);
std::ostringstream serial;
Decode* help = NULL;
help = new DecodeSTR(item.substr(18,18));
serial << help->decode();
sstr << help->decode();
delete help;
if (i == 25)
article = serial.str();
std::cout << serial.str();
}
std::cout << "' item: '" << article << "'";
std::cout << " s/n: '" << sstr.str().substr(1,28) << "' item: '" << sstr.str().substr(7,10) << "'";
}
int main(int argc, char* argv[])