设备、传感器和电源Devices, sensors, and power

为了向用户提供丰富的体验,你可能会发现有必要将外部设备或传感器集成到你的应用中。In order to provide a rich experience for your users, you may find it necessary to integrate external devices or sensors into your app. 下面是一些功能示例,你可以使用本部分所述技术将其添加到应用中。Here are some examples of features that you can add to your app using the technology described in this section.

  • 提供增强的打印体验Providing an enhanced print experience
  • 将动作和方向传感器集成到你的游戏中Integrating motion and orientation sensors into your game
  • 直接连接到设备或通过网络协议连接Connecting to a device directly or through a network protocol
主题Topic 说明Description
启用设备功能Enable device capabilities 本教程介绍如何在 Microsoft Visual Studio 中声明设备功能。This tutorial describes how to declare device capabilities in Microsoft Visual Studio. 这允许你的应用使用相机、麦克风、位置传感器以及其他设备。This enables your app to use cameras, microphones, location sensors, and other devices.
为 Windows IoT 启用用户模式访问Enable usermode access for Windows IoT 本教程介绍如何对 Windows 10 IoT 核心版上的 GPIO、I2C、SPI 和 UART 启用用户模式访问。This tutorial describes how to enable usermode access to GPIO, I2C, SPI, and UART on Windows 10 IoT Core.
枚举设备Enumerate devices 枚举命名空间可以让你找到内部连接到系统的、外部连接的或通过无线或网络协议可检测到的设备。The enumeration namespace enables you to find devices that are internally connected to the system, externally connected, or detectable over wireless or networking protocols.
设备配对Pair devices 某些设备需要先进行配对,然后才能使用。Some devices need to be paired before they can be used. Windows.Devices.Enumeration 命名空间支持三种配对设备的不同方式。The Windows.Devices.Enumeration namespace supports three different ways to pair devices.
服务点Point of Service 本部分介绍了如何与诸如条形码扫描仪、收据打印机、收银机等服务点外设进行交互。This section describes how to interact with point of service peripherals, such as barcode scanners, receipt printers, cash drawers, etc.
传感器Sensors 传感器使你的应用了解它周围的设备和外界之间的关系。Sensors let your app know the relationship between a device and the physical world around it. 传感器可以告知你的应用设备的方向、定位和移动。Sensors can tell your app the direction, orientation, and movement of the device.
蓝牙Bluetooth 本部分包含有关如何将蓝牙集成到通用 Windows 平台 (UWP) 应用的文章,包括如何使用 RFCOMM、GATT 和低功耗 (LE) 广告。This section contains articles on how to integrate Bluetooth into Universal Windows Platform (UWP) apps, including how to use RFCOMM, GATT, and Low Energy (LE) Advertisements.
打印和扫描Printing and scanning 本部分介绍了如何从你的通用 Windows 应用进行打印和扫描。This section describes how to print and scan from your Universal Windows app.
3D 打印3D printing 本部分介绍了如何在通用 Windows 应用中使用 3D 打印功能。This section describes how to utilize 3D printing functionality in your Universal Windows app.
创建 NFC 智能卡应用Create an NFC Smart Card app Windows Phone 8.1 支持的 NFC 卡仿真应用使用基于 SIM 卡的安全元素,但该模型需要安全付款应用与移动网络运营商 (MNO) 进行密切合作。Windows Phone 8.1 supported NFC card emulation apps using a SIM-based secure element, but that model required secure payment apps to be tightly coupled with mobile-network operators (MNO). 这限制了未与 MNO 密切合作的其他商户或开发人员提供的各种可能的支付解决方案。This limited the variety of possible payment solutions by other merchants or developers that are not coupled with MNOs. 在 Windows 10 移动版中,我们引入了称为主机卡仿真 (HCE) 的新的卡仿真技术。In Windows 10 Mobile, we have introduced a new card emulation technology called, Host Card Emulation (HCE). HCE 技术使你的应用可以直接与 NFC 读卡器通信。HCE technology allows your app to directly communicate with an NFC card reader. 本主题演示了主机卡仿真 (HCE) 在 Windows 10 移动版设备上的工作原理以及如何开发 HCE 应用,以便你的客户无需与 MNO 协作即可通过他们的手机而非物理卡访问你的服务。This topic illustrates how Host Card Emulation (HCE) works on Windows 10 Mobile devices and how you can develop an HCE app so that your customers can access your services through their phone instead of a physical card without collaborating with an MNO.
获取电池信息Get battery information 了解如何使用 Windows.Devices.Power 命名空间中的 API 获取电池的详细信息。Learn how to get detailed battery information using APIs in the Windows.Devices.Power namespace.