Reporting Buffer Remaining
-
At present the only way to find out if there is space in the gcode buffer to send another command is by sending a rr_gcode command.
NetworkGCodeInput * const httpInput = reprap.GetGCodes().GetHTTPInput(); httpInput->Put(HttpMessage, GetKeyValue("gcode")); response->printf("{\"buff\":%u}", httpInput->BufferSpaceLeft());
would it be possible to add the "buff" value into an existing rr_status or to create another one?
Would the buffer just be read and not otherwise be affected by
NetworkGCodeInput * const httpInput = reprap.GetGCodes().GetHTTPInput();
response->printf("{"buff":%u}", httpInput->BufferSpaceLeft());I do not wish to move away from a standard build otherwise I would have a go at implementing the idea.
Thanks
-
I think it would make more sense to either report the buffer space left in the object model, or change HttpResponder so that if you send an empty command string with rr_gcode, it doesn't try to execute the command but just returns the buffer space. I'll make that second change in the next 3.01-RC release.
-
@CliveB For now you can send an empty rr_gcode request to get the remaining buffer space, e.g.
http://ormerod/rr_gcode?gcode=
is sufficient even though it looks a bit odd.But I agree it would make more sense to be able to omit the
gcode
key if it isn't used. -
@chrishamm said in Reporting Buffer Remaining:
@CliveB For now you can send an empty rr_gcode request to get the remaining buffer space, e.g.
http://ormerod/rr_gcode?gcode=
is sufficient even though it looks a bit odd.But I agree it would make more sense to be able to omit the
gcode
key if it isn't used.Currently, that will use up 1 byte of buffer space. I've changed it so that in future it won't. But if the buffer is full, it shouldn't matter anyway, the empty GCode line will get thrown away.
-
@chrishamm Thank you for the response, it will make life a lot easier
-
@dc42 Thank you, fully understood and will solve the problem.