Closed richardthombs closed 6 years ago
Hi Richard,
I've done some refactoring on this one, and I think I've got a good and generic solution: I seems that the RequestNodeNeighborUpdate function sends multiple eventmessages during execution (Started, Done and Failed). So I added a new messagetype ControllerFunctionEvent
which represents this message (no more UnknownMessage on this one).
I've implemented this mechanism om RequestNeighborUpdate:
var report = await node.RequestNeighborUpdate();
or if you want progress:
var result = await node.RequestNeighborUpdate((progress) => LogMessage($"RequestNeighborUpdate: {progress} "));
https://github.com/roblans/ZWave4Net/commit/ea1026bb06e9a9c24898d7413e14481c1afe86c8
Thanks Rob!
Hi Rob,
This is my first attempt at getting RequestNodeNeighborUpdate to work. In order to get the Send method to be able to return the appropriate payload, I added an IMessageWithPayload interface which both ControllerFunctionCompleted and UnknownMessage implement (it just returns the payload byte array).
I know it's not very elegant to just return UnknownMessage and I'm happy to do something else instead. Also, I know the way of recognising the return message isn't very pretty either, and again I'm happy to do something else.
Cheers,
R.