Got rid of excess logging. Added logging of received data from subcommand
This commit is contained in:
@@ -21,12 +21,9 @@ void ModbusServiceWorker::Run()
|
||||
string protocol_id = header.substr(2, 2);
|
||||
int length = ((int)(unsigned char)header[5]) | (((int)(unsigned char)header[4]) << 8);
|
||||
string unit_identifier = header.substr(6, 1);
|
||||
log->LogString("Receiving modbus frame of length " + ToString(length));
|
||||
string data = s.Receive(length - 1);
|
||||
log->LogString("Received modbus frame of length " + ToString(length));
|
||||
string answer_data = "";
|
||||
int function = data[0];
|
||||
log->LogString("Processing function " + ToString(function));
|
||||
if (function == 3)
|
||||
{
|
||||
LockMutex(register_mutex);
|
||||
@@ -62,9 +59,7 @@ void ModbusServiceWorker::Run()
|
||||
string length_str = "";
|
||||
length_str += (char)((answer_data.length() >> 8) & 0xFF);
|
||||
length_str += (char)((answer_data.length()) & 0xFF);
|
||||
log->LogString("Sending answer");
|
||||
s.Send(transaction_id + protocol_id + length_str + answer_data);
|
||||
log->LogString("Answer sent");
|
||||
}
|
||||
}
|
||||
catch (string s)
|
||||
|
||||
Reference in New Issue
Block a user