Commit 973cc81
authored
fix(di): accept FunctionalGroupType subtypes in BrowseFunctionalGroupsAsync (#4032)
### Summary
This PR makes `DiDeviceClient.BrowseFunctionalGroupsAsync()` accept
`FunctionalGroupType` subtypes instead of requiring an exact
type-definition match and adds a regression test that verifies derived
functional groups are included in the returned results.
### Problem
In OPC UA DI, functional groups may be modeled as instances of
`FunctionalGroupType` or of any subtype derived from it. A client helper
that enumerates functional groups therefore needs to follow the OPC UA
type hierarchy instead of requiring the object's `TypeDefinition` to be
exactly `FunctionalGroupType`.
Previously, `BrowseFunctionalGroupsAsync()` filtered browse results
through a helper named `IsSubtypeOf()`, but that helper only compared
`typeDefinition == expectedType`. As a result, any device that exposed
functional groups through a legal subtype of `FunctionalGroupType` would
have those groups silently filtered out even though they were valid DI
functional-group objects.
### Changes
- Replace the exact type-definition comparison in
`BrowseFunctionalGroupsAsync()` with a real subtype check based on
`Session.NodeCache.IsTypeOfAsync(...)`.
- Preserve the existing filtering behaviour for non-functional-group
objects.
- Add a regression test that verifies a derived functional-group type is
returned while an unrelated object is still excluded.1 parent 8602d40 commit 973cc81
2 files changed
Lines changed: 82 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
296 | 299 | | |
297 | 300 | | |
298 | 301 | | |
| |||
394 | 397 | | |
395 | 398 | | |
396 | 399 | | |
397 | | - | |
| 400 | + | |
398 | 401 | | |
399 | | - | |
| 402 | + | |
| 403 | + | |
400 | 404 | | |
401 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
402 | 409 | | |
403 | 410 | | |
404 | 411 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
241 | 312 | | |
242 | 313 | | |
243 | 314 | | |
| |||
0 commit comments