简体   繁体   English

从设备到智能手机的 BLE 文件传输

[英]BLE File Transfer from a Device to a Smartphone

There is a device and a smartphone with the following requirements:有具有以下要求的设备和智能手机:

  • User taps the device, says something and their speech is transferred to the smartphone用户点击设备,说一些话,然后他们的讲话被传输到智能手机
  • The smartphone receives speeches and some other device status information智能手机接收语音和其他一些设备状态信息
  • Smartphone is iOS device at the beginning (Android and WP devices are considered later)智能手机一开始是iOS设备(后面考虑Android和WP设备)

I'm trying to figure out what is the best way to go using Bluetooth to archive that:我试图找出使用蓝牙存档的最佳方法是什么:

  1. Standard BT profiles: HFP & HID.标准 BT 配置文件:HFP 和 HID。 iOS SDK doesn't allow direct communication with devices via these profiles. iOS SDK 不允许通过这些配置文件与设备直接通信。 So it's seemed to me very awkward to go this way.所以我觉得走这条路很尴尬。

  2. BT Low Energy. BT 低能耗。 Is it possible to sent files using BLE?是否可以使用 BLE 发送文件? I'm thinking about 50-100K file sizes.我在考虑 50-100K 的文件大小。 If it is, how slow it can be?如果是,它可以慢到什么程度?

  3. MFI.小额信贷机构。 This is the last resort.这是最后的手段。 If I go this way, would I have problems with Android and WP smartphones?如果我这样做,Android和WP智能手机会不会有问题?

Update : My original plan was to go with HID (to make app know that device is initiating streaming + other status info) + HFP (to stream).更新:我最初的计划是使用 HID(让应用知道设备正在启动流媒体 + 其他状态信息)+ HFP(流媒体)。 But my concerns were:但我的担忧是:

1.1. 1.1. can the app handle HID messages (keypress,for example) while is in background应用程序是否可以在后台处理 HID 消息(例如按键)

1.2. 1.2. can these two profiles work together?这两个配置文件可以一起工作吗?

1.3. 1.3. what pitfalls if another headset is connected (as I understood the latest connected will be streaming)?如果连接了另一个耳机(据我所知,最新连接的耳机将是流式传输)有什么陷阱?

Will try and go through these one by one:将尝试一一完成这些:

  1. Standard BT:标准蓝牙:
    Apple: Apple will allow you to use the standard Audio protocols for free. Apple:Apple 将允许您免费使用标准音频协议。 So you could use A2DP to stream Audio, but that is about it.所以你可以使用 A2DP 来流式传输音频,但仅此而已。 If you want to use SDP to transfer data you will need to get the authentication chip in your device.如果您想使用 SDP 传输数据,您需要在您的设备中安装认证芯片。
    Android: All the protocols are free to access. Android:所有协议均可免费访问。

  2. BLE:低功耗:
    Apple: BLE is free to use, but I am not sure how Apple will react to you trying to send large amounts of data over the protocol. Apple:BLE 可以免费使用,但我不确定 Apple 会如何应对您尝试通过该协议发送大量数据。 BLE is very fast for small data (20 bytes) but slows down as you go bigger. BLE 对于小数据(20 字节)来说非常快,但随着数据变大而变慢。 A lot is going to depend on your accessory, but I believe Apple has a cap on how fast you can transmit.很大程度上取决于您的配件,但我相信 Apple 对您的传输速度有限制。 I have seen speeds of around 5KB/s.我见过大约 5KB/s 的速度。
    Android: Same thing applies to Android, but you can go faster if your device supports it, I have seen speeds up to 10KB/s. Android:同样的事情适用于 Android,但如果您的设备支持它,您可以更快,我已经看到速度高达 10KB/s。

  3. MFI:小额信贷机构:
    Apple: Supported by Apple苹果:由苹果支持
    Android: The keys that Apple used for Airplay were reverse engineered a while ago, and you might be able to use them but its a gamble. Android:Apple 用于 Airplay 的键不久前被逆向工程,您也许可以使用它们,但这是一场赌博。 There might be better libraries out there I am not aware of.可能有我不知道的更好的图书馆。

When it comes to Windows Phone, I don't know much accept that they did announce something about a BLE api at the BUILD conference that happened a couple of days ago.说到 Windows Phone,我不太相信他们确实在几天前举行的 BUILD 会议上宣布了有关 BLE api 的一些内容。

Hope this helps!希望这可以帮助!

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

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