From 52af010493f5bfe9dc9e233de08a07378e65ffef Mon Sep 17 00:00:00 2001 From: John Date: Wed, 13 Nov 2024 07:14:59 +0100 Subject: [PATCH] fix read/write response on tcp client --- src/ebusd/mainloop.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ebusd/mainloop.cpp b/src/ebusd/mainloop.cpp index 419b8f45..7de1313b 100644 --- a/src/ebusd/mainloop.cpp +++ b/src/ebusd/mainloop.cpp @@ -805,7 +805,7 @@ result_t MainLoop::executeRead(const vector& args, const string& levels, ret = message->storeLastData(master, slave); ostringstream result; if (ret == RESULT_OK) { - ret = message->decodeLastData(pt_any, false, nullptr, -1, OF_NONE, &result); + ret = message->decodeLastData(pt_slaveData, false, nullptr, -1, OF_NONE, &result); } if (ret >= RESULT_OK) { logInfo(lf_main, "read hex %s %s cache update: %s", message->getCircuit().c_str(), message->getName().c_str(), @@ -876,7 +876,7 @@ result_t MainLoop::executeRead(const vector& args, const string& levels, if (verbosity & OF_NAMES) { *ostream << cacheMessage->getCircuit() << " " << cacheMessage->getName() << " "; } - ret = cacheMessage->decodeLastData(pt_any, false, fieldIndex == -2 ? nullptr : fieldName.c_str(), fieldIndex, + ret = cacheMessage->decodeLastData(pt_slaveData, false, fieldIndex == -2 ? nullptr : fieldName.c_str(), fieldIndex, verbosity, ostream); if (ret < RESULT_OK) { logError(lf_main, "read %s %s cached: decode %s", cacheMessage->getCircuit().c_str(), @@ -916,7 +916,7 @@ result_t MainLoop::executeRead(const vector& args, const string& levels, if (verbosity & OF_NAMES) { *ostream << message->getCircuit() << " " << message->getName() << " "; } - ret = message->decodeLastData(pt_any, false, fieldIndex == -2 ? nullptr : fieldName.c_str(), fieldIndex, verbosity, + ret = message->decodeLastData(pt_slaveData, false, fieldIndex == -2 ? nullptr : fieldName.c_str(), fieldIndex, verbosity, ostream); if (ret < RESULT_OK) { logError(lf_main, "read %s %s: decode %s", message->getCircuit().c_str(), message->getName().c_str(), @@ -1050,7 +1050,7 @@ result_t MainLoop::executeWrite(const vector& args, const string levels, ret = message->storeLastData(master, slave); ostringstream result; if (ret == RESULT_OK) { - ret = message->decodeLastData(pt_any, false, nullptr, -1, verbosity, &result); + ret = message->decodeLastData(pt_slaveData, false, nullptr, -1, verbosity, &result); } if (ret >= RESULT_OK) { logInfo(lf_main, "write hex %s %s cache update: %s", message->getCircuit().c_str(), @@ -1113,7 +1113,7 @@ result_t MainLoop::executeWrite(const vector& args, const string levels, } dstAddress = message->getLastMasterData()[1]; - ret = message->decodeLastData(pt_any, false, nullptr, -1, verbosity, ostream); // decode data + ret = message->decodeLastData(pt_slaveData, false, nullptr, -1, verbosity, ostream); // decode data if (ret < RESULT_OK) { logError(lf_main, "write %s %s: decode %s", message->getCircuit().c_str(), message->getName().c_str(), getResultCode(ret));