Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Heating/Sensors/RemoteSensor.cpp')
-rw-r--r--src/Heating/Sensors/RemoteSensor.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Heating/Sensors/RemoteSensor.cpp b/src/Heating/Sensors/RemoteSensor.cpp
index 0806f783..4ae68a3d 100644
--- a/src/Heating/Sensors/RemoteSensor.cpp
+++ b/src/Heating/Sensors/RemoteSensor.cpp
@@ -28,7 +28,19 @@ GCodeResult RemoteSensor::Configure(GCodeBuffer& gb, const StringRef& reply)
{
return GCodeResult::error;
}
- return cons.SendAndGetResponse(CanMessageType::m308, boardAddress, reply);
+ const GCodeResult ret = cons.SendAndGetResponse(CanMessageType::m308, boardAddress, reply);
+ if ((ret == GCodeResult::ok || ret == GCodeResult::warning) && StringStartsWith(reply.c_str(), "type "))
+ {
+ // It's just a query for the sensor parameters, so prefix the sensor number and name
+ String<StringLength50> temp;
+ temp.printf("Sensor %u ", GetSensorNumber());
+ if (GetSensorName() != nullptr)
+ {
+ temp.catf("(%s) ", GetSensorName());
+ }
+ reply.Insert(0, temp.c_str());
+ }
+ return ret;
}
void RemoteSensor::UpdateRemoteTemperature(CanAddress src, const CanSensorReport& report) noexcept