diff --git a/ioc/singlesource.cpp b/ioc/singlesource.cpp index 024f676..28c0366 100644 --- a/ioc/singlesource.cpp +++ b/ioc/singlesource.cpp @@ -55,8 +55,7 @@ void subscriptionCallback(SingleSourceSubscriptionCtx* subscriptionContext, { DBLocker F(dbChannelRecord(subscriptionContext->info->chan)); - // TODO MappingInfo::nsecMask - IOCSource::get(currentValue, MappingInfo(), Value(), change, pChannel, pDbFieldLog); + IOCSource::get(currentValue, *subscriptionContext->info, Value(), change, pChannel, pDbFieldLog); } // Make sure that the initial subscription update has occurred on both channels before continuing diff --git a/test/testqsingle.cpp b/test/testqsingle.cpp index 04c060a..c971227 100644 --- a/test/testqsingle.cpp +++ b/test/testqsingle.cpp @@ -1009,6 +1009,25 @@ void testMonitorDBE(TestClient& ctxt) testEq(val["value"].as(), 43); } +void testMonitorNsecMask(TestClient& ctxt) +{ + testDiag("%s", __func__); + + TestSubscription sub(ctxt.monitor("test:nsec") + .maskConnected(true) + .maskDisconnected(true)); + + auto val(sub.waitForUpdate()); + + // nsec:lsb:8 clears the low 8 bits: 102030 -> 101888, userTag -> 142 + testFldEq(val, "timeStamp.nanoseconds", int32_t(101888)); +#if DBR_UTAG + testFldEq(val, "timeStamp.userTag", int32_t(142)); +#else + testSkip(1, "no UTAG"); +#endif +} + void testiocsh(TestClient& ctxt) { testDiag("%s", __func__); @@ -1061,7 +1080,7 @@ void testiocsh(TestClient& ctxt) MAIN(testqsingle) { - testPlan(116); + testPlan(118); testSetup(); pvxs::logger_config_env(); generalTimeRegisterCurrentProvider("test", 1, &testTimeCurrent); @@ -1106,6 +1125,7 @@ MAIN(testqsingle) testMonitorAIFilt(mctxt); testMonitorDBEAlarm(mctxt); testMonitorDBE(mctxt); + testMonitorNsecMask(mctxt); testiocsh(mctxt); } timeSim = false;