OpenZWave / openzwave-dotnet-uwp

An Open-ZWave wrapper for use with .NET or UWP apps
Apache License 2.0
45 stars 27 forks source link

Manager.GetGroupLabel() not implemented? #19

Closed yesyesuk closed 6 years ago

yesyesuk commented 6 years ago

Hi, I'm working on adding Group Associations to the ZWave port on my home automation system. I would like to display a list of groups a node supports so that the user can choose a group by name.

But it looks like Manager.GetGroupLabel() is not implemented in the .net wrapper. Is that correct? If so, is there another way to get the group names?

Thanks, Chris

dotMorten commented 6 years ago

Fixed! Thanks. Keep'em coming

yesyesuk commented 6 years ago

Excellent, thanks! That was quick.

Sorry for re-opening, but how do I get this change into my project now? Can I update this vis NuGet already or do I need to wait for a new build from you? I'm running VS2017, WinForms app, .NET4.5.2

dotMorten commented 6 years ago

You'd have to pull the source code and rebuild it yourself. I'm not planning on updating the nuget until openzwave makes the next official release

yesyesuk commented 6 years ago

hmmm, I might need a bit of help with that. I have never compiled someone else's DLL before. ;-)

I downloaded the source from here, found a file called "CompilingOpenZWave.aml" that said I should download the OZW dev branch and copy it to the "open-zwave" subfolder.

Then I opened \src\OpenZWaveDotNet.sln in VS2017 and did the suggested conversions. Then I tried to build with "ReleaseDLL" config. That failed in many ways. Then I build with just "Release" and that looked much better. But I still get 3 errors, all "unresolved external symbol"

Error   LNK2001 unresolved external symbol "public: void __thiscall OpenZWave::Localization::SetupCommandClass(class OpenZWave::CommandClass *)" (?SetupCommandClass@Localization@OpenZWave@@QAEXPAVCommandClass@2@@Z)  OpenZWaveDotNet U:\temp\openzwave-dotnet-uwp-master\src\OpenZWave\OpenZWave.lib(CommandClasses.obj) 1   

Error   LNK2001 unresolved external symbol "public: static class OpenZWave::Localization * __cdecl OpenZWave::Localization::Get(void)" (?Get@Localization@OpenZWave@@SAPAV12@XZ)    OpenZWaveDotNet U:\temp\openzwave-dotnet-uwp-master\src\OpenZWave\OpenZWave.lib(CommandClasses.obj) 1   

Error   LNK2001 unresolved external symbol "public: void __thiscall OpenZWave::Localization::SetupValue(class OpenZWave::Value *)" (?SetupValue@Localization@OpenZWave@@QAEXPAVValue@2@@Z)  OpenZWaveDotNet U:\temp\openzwave-dotnet-uwp-master\src\OpenZWave\OpenZWave.lib(ValueStore.obj) 1   

Looks like I'm still missing something. Any idea what that might be?

dotMorten commented 6 years ago

You only need to clone this repo, AND its submodule, and all you would need to do is open the solution and hit "build".

yesyesuk commented 6 years ago

OK, thanks so much! Without really knowing what exactly I'm doing I think I got it to compile properly now. ;-) I then copied the new DLL and XML file to \packages\OpenZWave.2.0.0-beta2\lib\net452, opened my project and then I was able to use Manager.GetGroupLabel() successfully.

By the way, there was one error left. It was in one of the samples. in \Samples\UWP\OZWAppx\ApplicationState.cs on line 61 it was complaining about activePorts.Remove(item.Id); I changed it to activePorts.Remove(item); and then it compiled. I don't use the samples, so I'm not sure this is a proper "fix". I just thought I'd mention it...