UPnP编程入门:Intel SDK中文指南

5星 · 超过95%的资源 需积分: 27 22 下载量 167 浏览量 更新于2024-10-23 1 收藏 376KB PDF 举报
"UPnP编程指南中文版,涵盖了UPnP协议的基础知识、设备与控制点的交互、SDK架构、设备编写等内容,适用于UPnP技术的入门和实践。" UPnP(Universal Plug and Play,通用即插即用)是一种网络通信协议,旨在让网络设备能够自动发现并相互交互,简化了家庭和小型办公网络中的设备连接和控制过程。本编程指南由Intel提供,适用于UPnP Devices Version 1.2.1,虽然文档标记版本为1.2.1,但内容可能适用于更高版本。 1、概述 UPnP协议包括五个关键组成部分: - 发现(Discovery):设备通过SSDP(Simple Service Discovery Protocol)广播自身存在,使其他设备能发现它们。 - 描述(Description):设备使用XML文件(如Device Description XML)提供自身信息,包括功能、服务和接口等。 - 控制(Control):使用SOAP(Simple Object Access Protocol)协议,允许控制点(如PC或智能手机)发送指令给设备执行特定操作。 - 事件(Eventing):设备通过GENA(Generic Eventing Architecture)通知控制点状态变化。 - 表示(Presentation):通过内置的迷你Web服务器提供用户界面或状态信息。 1.2、SDK架构 Intel SDK for UPnP Devices 提供了设备和控制点开发所需的组件: - 设备/控制点程序:包含创建设备实例和控制点应用的代码框架。 - SDK API:一组接口,用于处理UPnP协议的不同方面,如设备注册、事件订阅等。 - SSDP:支持设备发现和通知。 - 迷你Web服务器:托管设备描述文件和表示页面。 - GENA:处理设备事件。 - SOAP:实现控制消息的发送和接收。 - HTTP:基础网络通信协议。 - 迷你服务器:轻量级服务器组件。 - ThreadUtil库:线程管理工具。 2、编写一个UPnP设备 指南详细介绍了如何使用SDK创建UPnP设备,包括初始化SDK、设置根目录、注册根设备等步骤,是开发者实际动手实现UPnP设备功能的起点。 这份指南对于想要了解和开发UPnP设备的程序员来说是一份宝贵的资源,它不仅提供了理论知识,还包含了实用的编程细节,有助于快速上手UPnP编程。
2012-11-22 上传
UPnP_Programming_Guide Intel® SDK for UPnP™ Devices 1 Overview .................................................................................................................................... 1 1.1 UPnP Overview................................................................................................................1 1.1.1 Discovery.............................................................................................................1 1.1.2 Description...........................................................................................................2 1.1.3 Control ................................................................................................................2 1.1.4 Eventing ..............................................................................................................2 1.1.5 Presentation .........................................................................................................3 1.1.6 Control Point and Device Interaction .....................................................................3 1.2 SDK Architecture .............................................................................................................5 1.2.1 Device/Control Point Application ..........................................................................5 1.2.2 SDK API .............................................................................................................5 1.2.3 SSDP...................................................................................................................6 1.2.4 Mini Web Server ..................................................................................................6 1.2.5 GENA .................................................................................................................6 1.2.6 SOAP ..................................................................................................................6 1.2.7 HTTP ..................................................................................................................6 1.2.8 Mini Server ..........................................................................................................6 1.2.9 ThreadUtil Library................................................................................................7 1.2.10 XML Parser .........................................................................................................7 1.2.11 BSD Socket Layer................................................................................................7 1.3 Virtual Directories ............................................................................................................8 2 Writing a UPnP Device ............................................................................................................ 10 2.1 Setup and Initialization ................................................................................................... 10 2.1.1 Initializing the SDK ............................................................................................ 10 2.1.2 Setting a Root Directory ...................................................................................... 11 2.1.3 Registering a Root Device................................................................................... 11 2.1.4 Device Specific Initialization ............................................................................... 12 2.1.5 Advertising the Device........................................................................................ 12 2.2 Handling Requests.......................................................................................................... 12 2.2.1 Subscription Requests ......................................................................................... 13 2.2.2 Get Variable Requests ......................................................................................... 14 2.2.3 Action Requests ................................................................................................. 16 2.3 Sending Events............................................................................................................... 17 2.4 Shutting Down ............................................................................................................... 18 3 Writing a UPnP Control Point................................................................................................. 19 3.1 Setup and Initialization ................................................................................................... 19 3.1.1 SDK Initialization............................................................................................... 19 3.1.2 Control Point Application Specific Initia lization ................................................... 20 3.1.3 Control Point Registration ................................................................................... 20 3.2 Searching for Something Interesting ................................................................................ 20 3.3 Retrieving Descriptions ................................................................................................... 22 3.4 Watching for Events ....................................................................................................... 23 iv Intel® SDK for UPnP™ Devices Version 1.2.1 3.5 Invoking Actions ............................................................................................................ 24 3.6 Shutting Down ............................................................................................................... 26