Control Bluetooth audio device with iPhone

情到浓时终转凉″ 提交于 2019-12-03 08:00:38

You can do it using CoreBluetooth if your device (CD Player) is Bluetooth 4.0 LE compliant

Most likely you shall not be able to do it even if your car CD player has BLE 4.0.

With Core Bluetooth devices act as "Central" (client) or "Peripheral" (server), the peripheral "has data" and expose services with characteristics (variables). The central (client) reads data from the peripheral or subscribe for notifications.

Your only chance is to connect to the CD player as peripheral (server) and your iPhone being the central (client). In this case the CD player must expose services that allow you to control it. To be honest I do not know how this can be done, since the central (the iPhone) will read data and receive notifications from the peripheral, not vice versa.

Reversing roles, implementing iPhone as peripheral makes sense, but there is no predefined Bluetooth LE service for remote control, so your car CD player does not know what service to expect from you. It might work using HID service (Human Interface Device), used in general for keyboards and mouse, but according to this post the HID is forbidden by Apple on iOS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!