Allow application to indicate pending class events held in external storage (#419)#420
Allow application to indicate pending class events held in external storage (#419)#420jadamcrain wants to merge 1 commit intomainfrom
Conversation
Allows applications that buffer events in external storage upstream of the DNP3 stack to assert the CLASS_n_EVENTS IIN bits on outgoing responses even when the in-memory event buffer is empty. The new fields are OR'd with the buffer-derived bits in get_response_iin, so false is a no-op and true asserts the bit regardless of in-memory buffer state. The auto-generated all-fields ApplicationIin constructor in the C++/C#/ Java bindings goes from 4-arg to 7-arg; the no-arg constructor is unchanged (new fields default to false in the schema initializer). Closes #419
There was a problem hiding this comment.
Code Review
This pull request introduces class_1_events, class_2_events, and class_3_events fields to the ApplicationIin struct, allowing applications to signal pending events held in external storage. This is a breaking change for FFI all-fields constructors. The implementation includes updates to the IIN bitmask logic, FFI schema definitions, and comprehensive test coverage. Feedback was provided to use specific link syntax in the FFI documentation to ensure proper cross-referencing in generated bindings.
| .add( | ||
| class_1_events.clone(), | ||
| Primitive::Bool, | ||
| "IIN1.1 - Class 1 events available. Set this only if your application maintains an event queue upstream of the DNP3 event buffer and there are pending class 1 events not yet pushed in via a transaction. The stack already sets this bit automatically when the in-memory event buffer holds class 1 events; this field is OR'd with that bit, so false is a no-op. Most applications should leave this false.", |
There was a problem hiding this comment.
The documentation for class_1_events (and the subsequent class event fields) mentions transaction as plain text. To improve the generated documentation for FFI bindings (C++, C#, Java), you should use the oo-bindgen link syntax {method:outstation.transaction()}. This ensures that the documentation in the target languages correctly links to the relevant method, consistent with other parts of the schema.
| "IIN1.1 - Class 1 events available. Set this only if your application maintains an event queue upstream of the DNP3 event buffer and there are pending class 1 events not yet pushed in via a transaction. The stack already sets this bit automatically when the in-memory event buffer holds class 1 events; this field is OR'd with that bit, so false is a no-op. Most applications should leave this false.", | |
| "IIN1.1 - Class 1 events available. Set this only if your application maintains an event queue upstream of the DNP3 event buffer and there are pending class 1 events not yet pushed in via {method:outstation.transaction()}. The stack already sets this bit automatically when the in-memory event buffer holds class 1 events; this field is OR'd with that bit, so false is a no-op. Most applications should leave this false.", |
Closes #419.