Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrlPoint could not search for the device #53

Open
xinruoshinian opened this issue Nov 5, 2024 · 2 comments
Open

ctrlPoint could not search for the device #53

xinruoshinian opened this issue Nov 5, 2024 · 2 comments

Comments

@xinruoshinian
Copy link

I use both the renderer and ctrlPoint services on the same device, the renderer function is normal, but ctrlPoint can't search for the device on the current network。 Can someone tell me why? the code is as follows:

class MyCtrlPointListener : public PLT_CtrlPointListener {
public:
	virtual ~MyCtrlPointListener() {}
	virtual NPT_Result OnDeviceAdded(PLT_DeviceDataReference& device) {
		return NPT_SUCCESS;
	}
	virtual NPT_Result OnDeviceRemoved(PLT_DeviceDataReference& device) {
		return NPT_SUCCESS;
	}
	virtual NPT_Result OnActionResponse(NPT_Result res, PLT_ActionReference& action, void* userdata) {
        return NPT_SUCCESS;
	};
	virtual NPT_Result OnEventNotify(PLT_Service* service, NPT_List<PLT_StateVariable*>* vars) {
		return NPT_SUCCESS;
	};
};

s_upnp.SetIgnoreLocalUUIDs(true);
PLT_CtrlPointReference ctrlPoint(new PLT_CtrlPoint());
MyCtrlPointListener* listener = new MyCtrlPointListener();
ctrlPoint->AddListener(listener);

if (NPT_SUCCEEDED(s_upnp.AddCtrlPoint(ctrlPoint)))
{
std::cout << "add ctrlPoint." << std::endl;
}

if (NPT_SUCCEEDED(s_upnp.AddDevice(device)))
{
device.Detach();
device = NULL;
if (NPT_SUCCEEDED(s_upnp.Start()))
{
	return true;
}
@xinruoshinian
Copy link
Author

The interface of the MyCtrlPointListener class has never been triggered, and I'm sure my network is there a device in operation

@c0diq
Copy link
Member

c0diq commented Nov 19, 2024

You need to discover or search for devices. See https://github.com/plutinosoft/Platinum/blob/master/Source/Apps/MicroMediaController/main.cpp as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants