Skip to content

Using dbr_field_type instead of field_type in SR_get_array #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025

Conversation

KaushikMalapati
Copy link

Copied from slac-epics#2

Currently, autosave requests for long links (e.g., an input link with $ at the end) will never have any values in their sav files. This is because in SR_get_array, paddr->field_type is passed as as dbrType to dbGet.
https://github.com/slac-epics/autosave/blob/a98b30c7af7d7d93506786a7de61a75d31d15664/asApp/src/dbrestore.c#L1301C26-L1301C43
For DBF_INLINKS, DBF_OUTLINKS, and DBF_FWDLINKS, dbGet calls getLinkValue which also takes in dbrType as input. If you instead pass the DBF value for any link, you fall into this case that returns an error code and does not set your buffer to the value of the PV
https://github.com/slac-epics/epics-base/blob/308e234c41f59b9103b6d309f3256262a3175da2/modules/database/src/ioc/db/dbAccess.c#L819-L821

I have modified SR_get_array to instead use dbr_field_type, which is the value that I believe dbGet expects. For most types, dbr_field_type and field_type are the same, but not for links, which are mapped to DBR_STRING, and DBF_MENU and DBF_DEVICE, which are both mapped to DBR_ENUM.
https://github.com/slac-epics/epics-base/blob/308e234c41f59b9103b6d309f3256262a3175da2/modules/database/src/ioc/db/dbAccess.c#L75-L94

@keenanlang keenanlang merged commit 7874ba5 into epics-modules:master May 16, 2025
0 of 4 checks passed
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.

2 participants