MCPcopy Create free account
hub / github.com/bdring/FluidNC / flush

Method flush

FluidNC/src/JSONEncoder.cpp:17–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void JSONencoder::flush() {
18 if (_linebuf.length()) {
19 if (_channel) {
20 if (_json_tag) {
21 // Output to channels is encapsulated in [MSG:JSON:...]
22 _channel->out_acked(_linebuf, "JSON:");
23 } else {
24 log_stream(*_channel, _linebuf);
25 }
26
27 } else {
28 _callback(_linebuf.c_str());
29 }
30 _linebuf.clear();
31 }
32}
33void JSONencoder::add(char c) {
34 _linebuf += c;
35 if (_channel && _linebuf.length() >= 100) {

Callers

nothing calls this directly

Calls 4

lengthMethod · 0.80
c_strMethod · 0.80
out_ackedMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected