두근두근이야기

upnp in linux 본문

IT/IT ::Projects

upnp in linux

골든 2013. 10. 28. 16:45

http://madraziw.blogspot.kr/2010/08/first-download-libupnp-source-code.html




How to use libupnp sample code

First, download the libupnp source code

http://sourceforge.net/projects/pupnp/files/

version is libupnp-1.6.6

now we extract and compiler it


mad@mad-desktop:~$ tar -jxvf libupnp-1.6.6.tar.bz2
mad@mad-desktop:~$ cd libupnp-1.6.6/
mad@mad-desktop:~/libupnp-1.6.6$ ./configure
mad@mad-desktop:~/libupnp-1.6.6$ make


now we compiler sample code


mad@mad-desktop:~/libupnp-1.6.6$ cd upnp/
mad@mad-desktop:~/libupnp-1.6.6/upnp$ cd sample/
mad@mad-desktop:~/libupnp-1.6.6/upnp/sample$ make check


now you can see the execute file.upnp_tv_ctrlpt and upnp_tv_device
upnp_tv_ctrlpt is UPnP control point and
upnp_tv_device is upnp virtual device
we execute it


mad@mad-desktop:~/libupnp-1.6.6/upnp/sample$ ./upnp_tv_device


you can see upnp virtual device information


mad@mad-desktop:~/LAB/libupnp/libupnp-1.6.6/upnp/sample$ ./upnp_tv_device
Initializing UPnP Sdk with
ipaddress = (null) port = 0
UPnP Initialized
ipaddress= 192.168.0.123 port = 49154
Specifying the webserver root directory -- ./web
Registering the RootDevice
with desc_doc_url: http://192.168.0.123:49154/tvdevicedesc.xml
RootDevice Registered
Initializing State Table
Found service: urn:schemas-upnp-org:service:tvcontrol:1
serviceId: urn:upnp-org:serviceId:tvcontrol1
Found service: urn:schemas-upnp-org:service:tvpicture:1
serviceId: urn:upnp-org:serviceId:tvpicture1
State Table Initialized
Advertisements Sent

>>


you can see the device's service at the url
http://192.168.0.123:49154/tvdevicedesc.xml



and then you execute control point

mad@mad-desktop:~/LAB/libupnp/libupnp-1.6.6/upnp/sample$ ./upnp_tv_ctrlpt


mad@mad-desktop:~/LAB/libupnp/libupnp-1.6.6/upnp/sample$ ./upnp_tv_ctrlpt
Initializing UPnP Sdk with
ipaddress = (null) port = 0

UPnP Initialized
ipaddress= 192.168.0.123 port = 49153

Registering Control Point
Control Point Registered




then you can see virtual device's discovery



======================================================================

----------------------------------------------------------------------

UPNP_DISCOVERY_SEARCH_RESULT

ErrCode = 0

Expires = 100

DeviceId = uuid:Upnp-TVEmulator-1_0-1234567890001

DeviceType = urn:schemas-upnp-org:device:tvdevice:1

ServiceType =

ServiceVer =

Location = http://192.168.0.123:49155/tvdevicedesc.xml

OS = Linux/2.6.28-18-generic, UPnP/1.0, Portable SDK for UPnP devices/1.6.6

Ext =

----------------------------------------------------------------------

======================================================================


'IT > IT ::Projects' 카테고리의 다른 글

오드로이드 우분투 plymounthd 에러 (ply-terminal.c 611: ...)  (0) 2013.11.29
upnp 자료  (0) 2013.10.29
ubuntu odroidx2  (0) 2013.10.24
odroid ubuntu  (0) 2013.10.23
[해결]boot.txt가 없어서... 어케할까 고민.. 해결중임.  (0) 2013.10.23