Does ohnet support Embedded devices?
|
24-06-2015, 02:14 PM
Post: #11
|
|||
|
|||
RE: Does ohnet support Embedded devices?
That sequence of actions (create a device, advertise it on the network, wait, delete device) should be supported. It also works in local tests for me.
Can you post a full example app that demonstrates the failure and that I'll be able to run please? |
|||
24-06-2015, 03:30 PM
Post: #12
|
|||
|
|||
RE: Does ohnet support Embedded devices?
I attached zip where is Xcode project.
All you need to make it compile is add libohNet.a to /libs/ohnet/lib/ for architecture which you'd like to run. On my computer I've lib for x86, armv7 and arm64 but it's 80MB I hope this code will help you. |
|||
24-06-2015, 03:49 PM
Post: #13
|
|||
|
|||
RE: Does ohnet support Embedded devices?
Thanks. Looking at the code, I think I see the issue.
Calling device->AddDevice(device1); passes ownership of device1 to device. This means that delete device; will also delete device1. So, your test should work if you remove the line delete device1;. (As a general rule, most of our C++ APIs that pass objects by pointer are transferring ownership. If we only want to allow objA to access objB, we normally pass objB by reference.) |
|||
25-06-2015, 08:17 AM
Post: #14
|
|||
|
|||
RE: Does ohnet support Embedded devices?
You're right. That's solve my problem.
Lesson from my situation is that when I'm tired I should go home and not debug code. I made lots of mistakes which hide me solution. Thank you for clarify this. |
|||
26-06-2015, 02:35 PM
(This post was last modified: 26-06-2015 02:37 PM by SiMet.)
Post: #15
|
|||
|
|||
RE: Does ohnet support Embedded devices?
So question from Control Point side.
I made: root device with two embedded devices. (one of them has ContentDirectory service) Then I'm tring to discover them: CpDeviceListCppUpnpAll return me only root device CpDeviceListCppUpnpServiceType("schemas-upnp-org","ContentDirectory",1,..,..) doesn't discover any Device. I had also made test for ServiceType with Intel Tools. I started my Control Point with Code: CpDeviceListCppUpnpServiceType("schemas-upnp-org", "ContentDirectory", 1, MakeFunctorCpDeviceCpp(*this,&MyClass::DeviceFound),MakeFunctorCpDeviceCpp(*this,&MyClass::DeviceLost)); Then started AV Media Server. In wireshark I see ALIVE on start: Code: NOTIFY * HTTP/1.1 however Control Point doesn't get know that new device appeared in network. Using CpDeviceListCppUpnpAll DeviceFound method is called when Media Server appears on network. In this post I have few questions: 1) Does Embedded devices should be also discovered? 2) How to get embedded devices when I discovered root device? 3) Does CpDeviceListCppUpnpServiceType works well (In wireshark I noticed M-Search which looks good) 4) How to fetch list of services from CpDeviceCpp ? |
|||
26-06-2015, 04:15 PM
Post: #16
|
|||
|
|||
RE: Does ohnet support Embedded devices?
Embedded devices and their services should be discovered. TestDviDiscovery attempts to confirm this.
Can you show how you're setting up the devices in your test please? |
|||
30-06-2015, 07:43 AM
(This post was last modified: 30-06-2015 08:04 AM by SiMet.)
Post: #17
|
|||
|
|||
RE: Does ohnet support Embedded devices?
(26-06-2015 04:15 PM)simonc Wrote: Embedded devices and their services should be discovered. TestDviDiscovery attempts to confirm this.Embedded devices are discovered but not by ohNet control point stack. Code: #include <stdio.h> Output after run this code is: Code: 2015-06-30 09:37:22.304 ohnetTest[9125:835697] Device 1 DEA6FC4C-181D-48F8-A22E-032DE4EE583B Is is bug or expected behaviour? If it's expected how can I get instance of embedded CpDevice? Next interesting behaviour I noticed is when I set device2 enabled or not. When device2 is not enabled I can see it in deviceSpy but cannot detect by new CpDeviceListCppUpnpDeviceType("2","2",1,MakeFunctorCpDeviceCpp(*listener,&CpListener::DeviceFound),MakeFunctorCpDeviceCpp(*listener,&CpListener::DeviceLost)); when device2 is enabled I see it in DeviceSpy and could discover it with above method. And next interesting bug: when I changed @"Upnp.Domain" to "schemas-upnp-org" and try discover with deviceType new CpDeviceListCppUpnpDeviceType("schemas-upnp-org","2",2... I don't discover device. Change to schemas_upnp_org makes that device is discovered again. Why this dash is so magical? |
|||
01-07-2015, 01:17 PM
Post: #18
|
|||
|
|||
RE: Does ohnet support Embedded devices?
(30-06-2015 07:43 AM)SiMet Wrote: Embedded devices are discovered but not by ohNet control point stack. This is not expected behaviour. It's also behaviour I can't reproduce. See ohNet's test file TestDviDiscovery.cpp for an example of a control point that manages to discover embedded devices. I suggest you use this as a template to update your code. (30-06-2015 07:43 AM)SiMet Wrote: Next interesting behaviour I noticed is when I set device2 enabled or not. Do you mean that devices that are disabled are still discoverable? This would be a bug. If a device is not enabled, it should never send out ALIVE announcements and should not respond to MSEARCH requests. (30-06-2015 07:43 AM)SiMet Wrote: And next interesting bug: You should provide the 'real' domain for device lists, not a UPnP representation. So, for services/devices defined by the UPnP forum, use "upnp.org" as the domain throughout your code. |
|||
02-07-2015, 01:19 PM
(This post was last modified: 02-07-2015 01:20 PM by SiMet.)
Post: #19
|
|||
|
|||
RE: Does ohnet support Embedded devices?
(01-07-2015 01:17 PM)simonc Wrote:are we talk about this file: TestDviDiscovery?(30-06-2015 07:43 AM)SiMet Wrote: Embedded devices are discovered but not by ohNet control point stack. Here you do not use CpDeviceListCpp and in this class (exactly in CpDeviceListCppUpnpAll) is probably bug. (01-07-2015 01:17 PM)simonc Wrote:This device doesn't send ALIVE and not respond to M-Search. However, It's still visible in device description. I'm not sure (my friend also) if it's bug from according to upnp specs.(30-06-2015 07:43 AM)SiMet Wrote: Next interesting behaviour I noticed is when I set device2 enabled or not. (01-07-2015 01:17 PM)simonc Wrote:(30-06-2015 07:43 AM)SiMet Wrote: And next interesting bug: Here I could not agree with you. Upnp specify in their documents (for example http://upnp.org/specs/av/UPnP-av-Content...ervice.pdf or http://upnp.org/specs/av/UPnP-av-MediaSe...evice.pdf) that ContentDirectory service have serviceType: "urn:schemas-upnp-org:service:ContentDirectory:1" and MediaServer deviceType is "urn:schemas-upnp-org:device:MediaServer:1". If I'd like make valid MediaServer with ContentDirectory which pass UCTT tests. This types have to be as above and it's my scenario. |
|||
02-07-2015, 02:39 PM
Post: #20
|
|||
|
|||
RE: Does ohnet support Embedded devices?
(02-07-2015 01:19 PM)SiMet Wrote: are we talk about this file: TestDviDiscovery? Yes, that's the file. The amount of code in CpDeviceListCpp and CpDeviceListCppUpnpAll is very small. The latter is just a thin wrapper around CpiDeviceListUpnpAll which is used by TestDviDiscovery. It seems very unlikely that the bug is in the C++ bindings. They contain very little code and don't do anything to check for embedded devices. I still think a subtle bug in your test code is the most likely cause of problems. (02-07-2015 01:19 PM)SiMet Wrote: This device doesn't send ALIVE and not respond to M-Search. However, It's still visible in device description. I'm not sure (my friend also) if it's bug from according to upnp specs. Thanks, I understand now. This behaviour isn't deliberate. It is a bug but is hopefully a very minor bug. Well-behaved control points will always start with a MSEARCH. If there is no response to this, they'll have no reason to try a GET for device xml. I've raised a bug about this. Given that it would only cause problems for poorly written control points, it may take a while before we fix it. (02-07-2015 01:19 PM)SiMet Wrote:(01-07-2015 01:17 PM)simonc Wrote: You should provide the 'real' domain for device lists, not a UPnP representation. So, for services/devices defined by the UPnP forum, use "upnp.org" as the domain throughout your code. I agree that we need to send "schemas-upnp-org" over the wire. You shouldn't specify this when calling device lists however. If you specify "upnp.org" as the domain of a device list, it'll convert this as required for network requests. |
|||
« Next Oldest | Next Newest »
|