简体   繁体   中英

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. The text data is passed in octet form, in iOS it is considered as Data (.utf8).

Now, question is, which type of data you want to send from Central to Peripheral.

The General flow is: 1. Central will proximate peripheral so that other Bluetooth manager can scan it. 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. 3. Based on characteristic, you can write your own logic to send text, images, audio, video or anyother data from Central to Peripheral.

Just follow the Demo link which you are following. Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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