Reputation: 26766
I'm trying to communicate with some LIFX bulbs over the LAN.
They use their own protocol and instead of re-inventing the wheel, I decided to take advantage of LIFX.Lib. It seems like the most complete option.
The problem is, it's a PCL library and I'm having issues referencing the appropriate types to invoke methods.
The examples rely on a DatagramSocket which seems to be part of the Windows.Networking.Sockets namespace. As far as I can tell, it's a "Universal App"-only part of the framework. I can't find any way to reference it from my console application. The few documents I've found online just claim that it doesn't need a specific reference and is part of the core framework.
I tried starting a universal class library instead, but then was unable to load the nuget package (no supported targets)
I was under the impression that PCLs could only include references to libraries available on all supported platforms, so I'm a little confused as to why this isn't working.
Have I misunderstood how PCLs work, or is there an obvious way around this that I'm missing? Failing that, is anyone aware of another library that has similar capabilities?
Edit: Apologies, I should probably mention:
.Net 4.6.1 / C# / VS2015 Update 3 / Win 10
Upvotes: 0
Views: 211
Reputation: 15981
The example in the README page is UWP specific, but the library itself should be applicable to your .NET Framework application.
The PCL profile is 151, which means the library can target .NET Framework 4.5.1 and higher, Windows Phone (non-Silverlight) 8.1, Windows 8.1, UWP and Xamarin applications.
If you are developing for .NET Framework, you should be able to use the Socket
class or corresponding together with LIFX.Lib. Also note that the repository includes a console application which should be .NET Framework specific. This sample should give you further details on how to use LIFX.Lib in .NET Framework.
Upvotes: 1