Issues Creating a Provider - C++
|
10-01-2015, 07:45 PM
(This post was last modified: 10-01-2015 07:53 PM by Trolley01.)
Post: #1
|
|||
|
|||
Issues Creating a Provider - C++
I've got all of ohNet built and have started building up a test project to see how I get on. I have managed to create a device, but I get errors when creating a provider. The function is protected, so is erroring when building.
The errors that I am getting are: Code: ohNet/Build/Include/OpenHome/Net/Cpp/DvAvOpenhomeOrgProduct1.h:288:5: error: ‘OpenHome::Net::DvProviderAvOpenhomeOrgProduct1Cpp::DvProviderAvOpenhomeOrgProduct1Cpp(OpenHome::Net::DvDeviceStd&)’ is protected I am building in CodeLite. Am I using the right header files for the project, and am I creating the providers in the right way? The code I have is below: Code: #include <iostream> I am new to coding with C++, so any guidance or suggestions appreciated. |
|||
11-01-2015, 04:32 PM
Post: #2
|
|||
|
|||
RE: Issues Creating a Provider - C++
You can't directly instantiate a generated provider class. They're designed to be derived from instead.
When you derive a provider class, you need to override one function for each action you want to implement (these functions have the same name as the actions they implement). You also need to enable these actions in your constructor and enable/set each property (state variable) you want to implement. See ProviderTestBasic in ohNet/OpenHome/Net/Device/Tests/TestBasicDv.* for an example. |
|||
12-01-2015, 12:19 PM
Post: #3
|
|||
|
|||
RE: Issues Creating a Provider - C++
Thanks Simon, got that all now.
|
|||
« Next Oldest | Next Newest »
|