Fail to get units even if leaf->flags & LYS_SET_UNITS get true #2473
-
|
The Yang definition: leaf instant {
type decimal64 {
fraction-digits 1;
}
units celsius;
description
"The instantaneous value of the statistic.";
}My code like: if (node->nodetype == LYS_LEAF) {
const auto *leaf = (const lysc_node_leaf *)node;
if (leaf->flags & LYS_SET_UNITS) {
cout << "units is: " << leaflist->units << endl;
}
}leaflist->units is always NULL. And (leaf->flags & LYS_SET_UNITS) works. |
Beta Was this translation helpful? Give feedback.
Answered by
michalvasko
Jan 19, 2026
Replies: 1 comment 2 replies
-
|
For such a purpose, ignore |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right, there was a bug that caused
unitsto always beNULL. Please try the latest libyangdevel, it should now work.