fix: intrinsic alarm crash in the storage example (the "Hmm?" exception)#194
Merged
Conversation
Clicking the AnotherStorageImplementation device in YABE raised System.Exception "Hmm?"
from the core event-notification encoder. Root causes:
- Core: EncodeEventNotifyData threw a placeholder new Exception("Hmm?") in the
EVENT_CHANGE_OF_VALUE default branch. Replace it with a meaningful NotImplementedException.
- Example: AnalogObjectEvent reported analog high/low-limit alarms as EVENT_CHANGE_OF_VALUE
with no payload, which the encoder can't serialize. Send EVENT_OUT_OF_RANGE with the
proper payload (exceeding value, status flags, deadband, exceeded limit) - the correct
BACnet event for an analog limit alarm.
- Example: guard the thread-pool notification send with try/catch so a failed send logs
instead of taking down the device process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discovered while running
AnotherStorageImplementationand clicking the device in YABE: as soon as an object's intrinsic limit alarm fired, the device crashed with:Root causes
EncodeEventNotifyDatahad a leftover placeholderthrow new Exception("Hmm?")in theEVENT_CHANGE_OF_VALUEdefault branch. Replaced with a meaningfulNotImplementedException(matching the sibling switch one level up).AnalogObjectEventreported analog high/low-limit alarms asEVENT_CHANGE_OF_VALUEwith no payload, which the encoder can't serialize. It now sendsEVENT_OUT_OF_RANGEwith the proper payload (exceeding value, status flags, deadband, exceeded limit) — the correct BACnet event for an analog limit alarm.Verified
EVENT_OUT_OF_RANGEwith payload now encodes cleanly; an unsetCHANGE_OF_VALUEthrows the new meaningfulNotImplementedExceptioninstead of"Hmm?".Result: clicking the device in YABE now shows a proper Out-Of-Range alarm instead of crashing.