ebusd_scan: scanVaillant reworked.
This commit is contained in:
+5
-11
@@ -109,8 +109,8 @@ void define_args()
|
|||||||
|
|
||||||
void scanVaillant(TCPSocket* socket, const std::string address)
|
void scanVaillant(TCPSocket* socket, const std::string address)
|
||||||
{
|
{
|
||||||
std::cout << " s/n: '";
|
Decode* help = NULL;
|
||||||
std::string article;
|
std::ostringstream sstr;
|
||||||
|
|
||||||
for (int i = 24; i < 28; i++) {
|
for (int i = 24; i < 28; i++) {
|
||||||
// build message
|
// build message
|
||||||
@@ -132,18 +132,12 @@ void scanVaillant(TCPSocket* socket, const std::string address)
|
|||||||
|
|
||||||
std::string item(data);
|
std::string item(data);
|
||||||
|
|
||||||
std::ostringstream serial;
|
|
||||||
Decode* help = NULL;
|
|
||||||
|
|
||||||
help = new DecodeSTR(item.substr(18,18));
|
help = new DecodeSTR(item.substr(18,18));
|
||||||
serial << help->decode();
|
sstr << help->decode();
|
||||||
delete help;
|
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[])
|
int main(int argc, char* argv[])
|
||||||
|
|||||||
Reference in New Issue
Block a user