I have just uploaded the Latest and Greatest of my changes.
The new Project includes 2 more examples:
- DLNA_Control_Panel (Still under construction) A Control panel that allows you to see State Variables and execute service actions.
- DLNALib - A command line application that allows you to execute Actions in the API from a command line.
The other examples have been upgraded to use the new API structure.
I am currently working on changing the Wiki information, and will be creating pages for the new examples as well.
This is still not a release, but an update to get this out there for testing and comments from users.
Please keep in mind that the structure is completely different than that in v5.1, so if you created any applications using this library, you will have to update your code.
The biggest differences in the structure is that UPnP/DLNA service Actions and State Variables have been added.
So, some methods and properties are located in different classes now, or may not be used at all any more!
For example, this is no longer a valid command:
myDevice.send_IRCC("AABBCCDDEEFFGG==")
Since this is an Action of the IRCC service, you will have to execute it using the API IRCC service.
For example:
mySonyLib.ircc1.XSendIRCC(myDevice, "AABBCCDDEEFFGG==")
The next biggest difference is how devices are discovered, created, built, saved and loaded.
This version now uses the devices Description Document URL.
All UPnP/DLNA devices have one of these, and is returned when using the LocateDevices() method. (The sonyDiscovery() method is NO longer used)
So now, the only thing required to build a device object, is it's Decription Documnet Url.
An example would look like this:
To find these on your network, use the new locateDevices() method found in the Locator class of the library. (The SonyDiscovery() method is no longer used.)
The locateDevices() method will return a String List of description Document URL's found on the network.
here is a simple example of how you can do this:
List<string> foundDevices = mySonyLib.Locator.locateDevices();
int x = foundDevices.Count;
SonyDevice myDevice = new SonyDevice();
myDevice.BuildFromDocumnet(new Uri(foundDevices[0].value.toString()));
Once you know the Description Document URL, you can build a device using the "BuildFromDocument(new Uri(Path))" method
For example:
Also, Generation 3 devices will now save the cookie to the C:\ProgramData\Sony folder.
This will allow one cookie to be used with all examples and command line applications.
If you are upgrading, and already have a valid cookie, copy it to the C:\ProgramData\Sony folder.
You will also have to add the device name to the beginning of the cookie file name.
For example: BRAVIA KDL-42W828B_cookie.json
Once you have built and registered your device, you can save it to a file for later use.
mySonyLib.Locator.DeviceSave(@"c:\mydevices\BRAVIA KDL-42W828B.xml",myDevice);
Once you have a Device file saved, you can use it to create a device object. This greatly increases execution speed, as the API does not have to communicate with the device.
to create a device object from a saved file, simply use the Locators DeviceLoad(Path) method.
myDevice = mySonyLib.Locator.DeviceLoad(@"c:\mydevices\BRAVIA KDL-42W828B.xml")
Anyhow, please let me know if anyone has any questions or issues!