简体   繁体   English

如何通过中央模式向外围设备发送数据?

[英]How to send data through central mode to peripheral?

我正在开发一个应用程序,其中客户端应用程序以“中央”模式启动BLE扫描,并且有一个充当“外围设备”的扫描仪应用程序,客户端将继续扫描具有特定ID的扫描仪(信标)(其中扫描仪广告相同)。 id)当两个id匹配数据都通过BLE发送到扫描仪应用程序时,我有一个示例代码 ,该代码从外围设备到中央设备都可以正常工作,但是我不知道我的机箱如何工作。

The Demo which you are following is the correct one for a beginner. 您要关注的演示是适合初学者的演示。 In this Demo, app is sending text data from TextView. 在此演示中,应用程序正在从TextView发送文本数据。 The text data is passed in octet form, in iOS it is considered as Data (.utf8). 文本数据以八位字节形式传递,在iOS中被视为数据(.utf8)。

Now, question is, which type of data you want to send from Central to Peripheral. 现在,问题是,您要从Central到Peripheral发送哪种类型的数据。

The General flow is: 1. Central will proximate peripheral so that other Bluetooth manager can scan it. 常规流程为:1.中心将靠近外围设备,以便其他Bluetooth管理器可以对其进行扫描。 2. Once anyone try to connect with that peripheral, then on successful connection, it will return available Services and Characteristics inside of those each services. 2.一旦有人尝试与该外围设备连接,然后成功连接,它将在每个服务内部返回可用的服务和特征。 3. Based on characteristic, you can write your own logic to send text, images, audio, video or anyother data from Central to Peripheral. 3.根据特性,您可以编写自己的逻辑以从中央到外围设备发送文本,图像,音频,视频或任何其他数据。

Just follow the Demo link which you are following. 只需点击您正在关注的演示链接即可。 Thanks. 谢谢。

暂无
暂无

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

相关问题 iPhone corebluetooth中央管理器向外设发送数据 - iPhone corebluetooth central Manager send data to peripheral 在iOS中以后台模式将数据从中央传输到外围设备 - Transferring Data from Central to peripheral in Background mode in iOS 蓝牙LE无法从中央向外围设备发送数据 - Bluetooth LE can't send data from central to peripheral iOS BLE 中央如何在通知模式下从外围设备接收超过 182 个字节? - How can an iOS BLE central receive more than 182 bytes from a peripheral in notify mode? iOS CoreBluetooth:从中央发送数据并从外围设备获取响应 - iOS CoreBluetooth:Sending data from central and getting response from peripheral CoreBluetooth Central - >外围设备 - CoreBluetooth Central --> Peripheral 当iPhone在外围模式下运行时,如何在后台从应用程序向LE配件发送电池更新? - How to send battery updates to LE accessory from app in background when iPhone operate in peripheral mode? 如何通过中央didDiscoverPeripheral方法每次读取大量(28个字符)的Bluetooth LE外围设备名称密钥广告数据? - how to read large amount (28 characters) of Bluetooth LE peripheral name-key ad data every time by central didDiscoverPeripheral method? iOS BLE外设/广告数据在后台模式 - iOS BLE peripheral / advertisement data in background mode CoreBluetooth:外围经理如何知道中央收到指示? - CoreBluetooth: How can the peripheral manager know that the central received an indication?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM