Skip to content

Add -S option to pvget/pvmonitor to stringify byte arrays#105

Open
JJL772 wants to merge 1 commit into
epics-base:masterfrom
JJL772:pr-pvget-S-option
Open

Add -S option to pvget/pvmonitor to stringify byte arrays#105
JJL772 wants to merge 1 commit into
epics-base:masterfrom
JJL772:pr-pvget-S-option

Conversation

@JJL772

@JJL772 JJL772 commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

This emulates the behavior of the caget -S option. Byte arrays are displayed as strings.

Example (without -S):

$ pvget SIOC:TST:SYS0:APP_DIR
SIOC:TST:SYS0:APP_DIR 2026-03-17 23:09:56.242  [47,109,101,100,105,97,47,66,105,103,68,114,105,118,101,47,80,114,111,106,101,99,116,115,47,101,112,105,99,115,47,105,111,99,47,97,116,108,97,115,45,103,105,116,47,105,111,99,66,111,111,116,47,115,105,111,99,45,116,115,116,45,115,121,115,48,0]

Example (with -S):

$ pvget -S SIOC:TST:SYS0:APP_DIR
SIOC:TST:SYS0:APP_DIR 2026-03-17 22:39:05.669  /media/BigDrive/Projects/epics/ioc/atlas-git/iocBoot/sioc-tst-sys0

pvAccess PR: epics-base/pvAccessCPP#222

@AppVeyorBot

Copy link
Copy Markdown

Build pvDataCPP 1.0.72 failed (commit ec43e93fce by @JJL772)

@AppVeyorBot

Copy link
Copy Markdown

Build pvDataCPP 1.0.72 failed (commit ec43e93fce by @JJL772)

@AppVeyorBot

Copy link
Copy Markdown

Build pvDataCPP 1.0.72 failed (commit ec43e93fce by @JJL772)

@AppVeyorBot

Copy link
Copy Markdown

Build pvDataCPP 1.0.72 failed (commit ec43e93fce by @JJL772)

@anjohnson

Copy link
Copy Markdown
Member

Appveyor builds with older VMs need a newer version of pip. Nothing to do with this PR, I think we need to fix the CI in Base.

@ralphlange

Copy link
Copy Markdown
Contributor

Nothing to do with this PR - agreed.

The CI builds of Base don't have this issue - it's the CI configuration of this module that needs fixing.

@JJL772

JJL772 commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Just realized I forgot to open the corresponding PR in pvAccess to actually add the -S option...: epics-base/pvAccessCPP#222

Comment thread src/pv/pvData.h

FORCE_INLINE Formatter& format(format_t f) { xfmt = f; return *this; }

FORCE_INLINE Formatter& asString(bool b) { xstring = b; return *this; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asString() seems too generic for this quite specific "treat byte array as string" modifier.

This emulates the behavior of the caget -S option. Byte arrays are
displayed as strings.
@JJL772 JJL772 force-pushed the pr-pvget-S-option branch from 60e46ee to c49b615 Compare May 28, 2026 23:59
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@AppVeyorBot

Copy link
Copy Markdown

Build pvDataCPP 1.0.75 failed (commit f0ac7e2c61 by @JJL772)

@AppVeyorBot

Copy link
Copy Markdown

Build pvDataCPP 1.0.75 completed (commit f0ac7e2c61 by @JJL772)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants