Skip to content

Commit

Permalink
Correct "choices" for DEVICE/MENU fields of enum record (epics-rip#8)
Browse files Browse the repository at this point in the history
When creating a pvAccess channel to a field of a record with a VAL field
of type DBF_ENUM whose DBF type is DBF_DEVICE or DBF_MENU, for example,
the DTYP or SCAN fields of a bi/bo/mbbi/mbbo record, and performing an
operation involving its "values.choices" field (Channel Get, Put or
Monitor) the "choices" field is filled in incorrectly with the values from the
record's "VAL" field. Fix this for EPICS base R3.14. Add equivalent
change for R3.15 which will also require fix for epics-rip#17.

Fixes epics-rip#8
  • Loading branch information
dhickin committed Sep 13, 2015
1 parent 6bdfe0a commit a85825b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dbPv/3.14/dbUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ PVStructurePtr DbUtil::createPVStructure(
}
struct dbr_enumStrs enumStrs;
struct rset *prset = dbGetRset(&dbAddr);
if(prset && prset->get_enum_strs) {
if(dbAddr.field_type==DBF_ENUM && prset && prset->get_enum_strs) {
get_enum_strs get_strs;
get_strs = (get_enum_strs)(prset->get_enum_strs);
get_strs(&dbAddr,&enumStrs);
Expand Down
3 changes: 2 additions & 1 deletion src/dbPv/3.15/dbUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ PVStructurePtr DbUtil::createPVStructure(
}
struct dbr_enumStrs enumStrs;
struct rset *prset = dbGetRset(&dbChan->addr);
if(prset && prset->get_enum_strs) {
if(dbChannelFinalFieldType(dbChan) == DBF_ENUM &&
prset && prset->get_enum_strs) {
get_enum_strs get_strs;
get_strs = (get_enum_strs)(prset->get_enum_strs);
get_strs(&dbChan->addr, &enumStrs);
Expand Down

0 comments on commit a85825b

Please sign in to comment.