0

I am developping a PoC Zwave using the project "Zwave Adapter Headless Host" and the program provided here

But trying this program, I have one problem and one question:
-When I remove my Zwave dongle, there is no change in the properties I see. Is it a normal behaviour?
-In my program, I would like to start pairing my dongle to another device by the code. Is it a possible thing? Thank you

labelle
  • 420
  • 4
  • 19
  • Don't you need to press the power button in order to pair the Z-Wave device? – Jackie Aug 03 '16 at 03:15
  • That's precisely what I don't want to do. In a previous version of my project I just had to push tje button "pair" in my soft and push the buttons on my sensor. I would like to keep this function. – labelle Aug 03 '16 at 06:40
  • I see. Maybe you can check this sample project, https://github.com/ms-iot/samples/tree/develop/AllJoyn/Samples/ZWaveAdapter. https://github.com/ms-iot/samples/blob/develop/AllJoyn/Samples/ZWaveAdapter/open-zwave/cpp/src/Driver.cpp seems to support "Add Device" command. – Jackie Aug 03 '16 at 07:24
  • Not sure if that's the right direction to go, I'll come back when I figure it out. – Jackie Aug 03 '16 at 07:24
  • Found it, the OpenZWave wiki page https://github.com/OpenZWave/open-zwave/wiki/Adding-Security-Devices-to-OZW https://github.com/OpenZWave/open-zwave/wiki/Adding-Security-Devices-to-OZW says Manager::Get()->BeginControllerCommand(homeId, Driver::ControllerCommand_AddDevice, callbackfn, context, true)); – Jackie Aug 03 '16 at 08:29
  • I'll try and tell you how it works – labelle Aug 03 '16 at 08:33
  • I tried to add the openZwave project to my sample project but I can't call any OpenZwave function as my project is a c# one. Do you have any suggestion? – labelle Aug 03 '16 at 11:50
  • I see. It is written in native c++ code. You need to have a C++/CLI layer. Try creating an windows runtime component project in C++, and see if it can be referenced by C# project. – Jackie Aug 03 '16 at 12:34
  • Did you get it to work? – Jackie Aug 04 '16 at 05:54
  • I'm working on it. I have an error when compiling OpenZwave as a runtime component : xsd.exe stopped with the code 1 – labelle Aug 04 '16 at 06:23
  • There's an Platform component project for your reference https://github.com/ms-iot/samples/tree/develop/AllJoyn/Samples/ZWaveAdapter/AdapterLib. You can directly use it in your C# project. – Jackie Aug 04 '16 at 07:08
  • This component is already included in my project but I still have to add OpenZwave to be able to use 'Manager::Get()->BeginControllerCommand(homeId, Driver::ControllerCommand_AddDevice, callbackfn, context, true))' no? In Addition, I'm not sure if this method is doing what I want now... I think i'll have the node ID for example to be able to add my node. The use I want is pushing button in the app, pushing the pairing button of the sensor ==> paired – labelle Aug 04 '16 at 07:33
  • There's void ZWaveAdapter::AddDevice(const uint32 homeId, const uint8 nodeId, bool bPending) and void ZWaveAdapter::RemoveDevice(const uint32 homeId, const uint8 nodeId, bool bMoveToPending) from ZWaveAdapter.cpp from AdapterLib, not sure if those do the same trick though. – Jackie Aug 04 '16 at 07:37
  • I have the same problem, AdapterLib is a C++ project so I can't call it directly... The error I am having now is : WinRT doesn't support #using for managed assembly. I'm looking more into it – labelle Aug 04 '16 at 09:08

1 Answers1

0

To answer your 2nd question :

Executing the function addNode(uint32 const _homeId, bool _doSecurity) make the Z-Wave controller to enter inclusion mode. Once you execute this function, you need to activate inclusion mode (physically) with your module (zwave light/sensor/...). In other word, you can enter your z-Wave controller into inclusion mode using code and function, however, you need to physically press button on your other z-wave module to make them enter inclusion mode.

Bonus : To remove a module from your z-wave network, use the following function : removeNode(uint32 const _homeId)

Ashbay
  • 1,641
  • 13
  • 20