Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get IP address of CPDevices
12-03-2013, 02:29 PM
Post: #1
Get IP address of CPDevices
Hi,

I found a post named "Device access to client's IP address"
There was some change to get the Client IP address..

I like to get the IP address of any device found by my ControlPoint
The IP addresses are not listed in the service or device XML spec.
Is there a way to get the IP address of e.g. a Renderer in the ControlPoint Stack?

Thanks!
Find all posts by this user
12-03-2013, 02:49 PM
Post: #2
RE: Get IP address of CPDevices
(12-03-2013 02:29 PM)ChriD Wrote:  I like to get the IP address of any device found by my ControlPoint
The IP addresses are not listed in the service or device XML spec.
Is there a way to get the IP address of e.g. a Renderer in the ControlPoint Stack?

You can do this but is isn't entirely straightforward...

Given a CpDevice, you can call GetAttribute with key "Upnp.Location". The string this returns will be of the form http://[host]:[port]/[folders]/[device xml]. You'd need to parse this string to extract the host portion. You might then need to resolve a host name to an IP address. Depending on which language bindings you use, there may be system libraries to do some/all of this for you.

It's not easy to find the address of each device because we've never found a need for this from a UPnP control point. Out of interest, why do you need the addresses?
Find all posts by this user
12-03-2013, 03:05 PM
Post: #3
RE: Get IP address of CPDevices
Thanks for the info.
I need the IP address from the device where the Media Server runs. The media server itself is on a host which has some http requests to call. (change settings for the media server eg.: add shares as resources or force rescanning the shares, aso.)
Find all posts by this user


Forum Jump: