From 1380b2f21ba2a6a6d292a6e15b2ace76c83c642a Mon Sep 17 00:00:00 2001 From: Rob Giseburt Date: Tue, 13 Dec 2016 17:09:31 -0600 Subject: [PATCH] Finished muted devices capability. --- g2core/controller.cpp | 5 ++++- g2core/xio.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/g2core/controller.cpp b/g2core/controller.cpp index 34927f08..70fb3378 100755 --- a/g2core/controller.cpp +++ b/g2core/controller.cpp @@ -200,7 +200,7 @@ static stat_t _dispatch_control() static stat_t _dispatch_command() { if (cs.controller_state != CONTROLLER_PAUSED) { - devflags_t flags = DEV_IS_BOTH; + devflags_t flags = DEV_IS_BOTH | DEV_IS_MUTED; // expressly state we'll handle muted devices if ((!mp_planner_is_full()) && (cs.bufp = xio_readline(flags, cs.linelen)) != NULL) { _dispatch_kernel(flags); } @@ -217,6 +217,9 @@ static void _dispatch_kernel(const devflags_t flags) nv_reset_nv_list(); // get a fresh nvObj list nv_add_string((const char *)"msg", "lines from muted devices are ignored"); nv_print_list(status, TEXT_NO_PRINT, JSON_RESPONSE_TO_MUTED_FORMAT); + + // It's possible to let some stuff through, but that's not happening yet. + return; } while ((*cs.bufp == SPC) || (*cs.bufp == TAB)) { // position past any leading whitespace diff --git a/g2core/xio.cpp b/g2core/xio.cpp index 7678899b..9de46fed 100755 --- a/g2core/xio.cpp +++ b/g2core/xio.cpp @@ -363,8 +363,8 @@ struct xio_t { // We only do this second pass if this is not a CTRL-only read if (!checkForCtrlOnly(limit_flags)) { for (uint8_t dev=0; dev < _dev_count; dev++) { -// if (!DeviceWrappers[dev]->isActive()) -// continue; + if (!DeviceWrappers[dev]->isActive()) + continue; ret_buffer = DeviceWrappers[dev]->readline(limit_flags, size);