From 02a4bd719ec2607b67f94292eab457eaff7bfd5f Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 18 Aug 2020 17:23:33 -0700 Subject: [PATCH] Implement IOCsh pvxsr() --- ioc/iochooks.cpp | 7 +++++-- test/testioc.cpp | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ioc/iochooks.cpp b/ioc/iochooks.cpp index 51eeff5..c5c420f 100644 --- a/ioc/iochooks.cpp +++ b/ioc/iochooks.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -61,8 +62,10 @@ void pvxsr(int detail) { try { if(auto serv = instance.load()) { - // TODO - (void)serv; + std::ostringstream strm; + Detailed D(strm, detail); + strm<<*serv; + printf("%s", strm.str().c_str()); } } catch(std::exception& e) { fprintf(stderr, "Error in %s : %s\n", __func__, e.what()); diff --git a/test/testioc.cpp b/test/testioc.cpp index 1b82659..b850e83 100644 --- a/test/testioc.cpp +++ b/test/testioc.cpp @@ -25,7 +25,7 @@ namespace { MAIN(testioc) { - testPlan(3); + testPlan(4); testSetup(); testdbPrepare(); @@ -36,6 +36,7 @@ MAIN(testioc) testdbReadDatabase("testioc.dbd", nullptr, nullptr); testEq(0, testioc_registerRecordDeviceDriver(pdbbase)); + testEq(0, iocshCmd("pvxsr()")); testTrue(!!ioc::server());