简体   繁体   English

如何获取蓝牙连接设备的电池电量

[英]How to get the battery level of bluetooth connected devices

iOS 9's battery widget in notification enter shows the battery level of the device itself, and other peripherals connected via bluetooth. 通知输入中的iOS 9电池小部件显示了设备本身以及通过蓝牙连接的其他外围设备的电池电量。 (Apple pencil / Apple watch / BT speakers / BT headphones) (Apple Pencil / Apple Watch / BT扬声器/ BT耳机)

how to get those numbers in iOS? 如何在iOS中获取这些数字?

In my opinion the possible method is to use CoreBluetooth and discover the connected devices. 我认为可能的方法是使用CoreBluetooth并发现连接的设备。 Connect to the Apple Watch and subscribe to it's service which shows the battery level of the device. 连接到Apple Watch并订阅它的服务,该服务显示设备的电池电量。 This is a possible way for connected peripherials through bluetooth. 这是通过蓝牙连接外围设备的一种可能方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM