roblans / ZWave4Net

ZWave4Net is a .NET library that interfaces with the Aeotec / Aeon Labs Z-Stick.
MIT License
41 stars 34 forks source link

How to add support for NODE_NEIGHBOR_UPDATE_REQUEST #16

Closed richardthombs closed 6 years ago

richardthombs commented 6 years ago

I've moved all my zwave devices around the house and I need to get them to update their routing tables. I don't think this functionality exists in zwave4net yet does it?

I've found what I think is the right part of the spec (page 70 of the Network Protocol Command Class spec), which shows this payload:

image

I've tried implementing a command class to send what I think is the right payload, but I always get a CompleteNoAcknowledge back.

I'm a bit confused by the spec, because it seems to require that the target NodeID is part of the payload, so when I've been using Channel.Send, I end up including the NodeID twice - like this:

Channel.Send(Node.NodeID, new Command(Class, command.NodeNeighborUpdateRequest, seq, Node.NodeID));

Not sure if that is right or not? I've been using 0x34 as the Command Class and 0x0B as the command.

Also, it seems like the method overloads that let me specify the payload I want are all void, so I can't get the response.

Any pointers would be very gratefully received!

roblans commented 6 years ago

The correct call is:

Channel.Send(Function.RequestNodeNeighborUpdate, NodeID)

Unfortunately this call will lead to an timeout because the response is different from other Functions and is not handled properly yet.

You can also use the zensys tools to execute the NodeNeighborUpdateRequest action. http://www.axialcontrol.com/zensys-tools.zip

Regards,

Rob.

richardthombs commented 6 years ago

Thanks Rob, am I looking at the wrong bit of spec? I don't see how this Function.RequestNodeNeighborUpdate relates to the spec above. I'm sure you're right, but I just don't understand where that comes from.

roblans commented 6 years ago

This function (and others, like inclusion and exclusion of nodes) are not part of the Sigma Designs ZWave protocol. They are controller specific for the Aeotec / Aeon Labs Z-Stick, this SerialAPI protocol has not been released into the public domain.

richardthombs commented 6 years ago

Ah thanks Rob!

So it looks like I would need to update the Send function so the WaitForResponse predicate can recognise the response message and do something more advanced than just assuming that the response is a ControllerFunctionCompleted when getting the payload.

I'll have a crack at it.

Cheers,

R.

richardthombs commented 6 years ago

What do you think of #18 ?