访问相同BLE外设的iOS应用:如何区分? [英] iOS Apps that access the same BLE peripheral: How to distinguish?

本文介绍了访问相同BLE外设的iOS应用:如何区分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须遵循以下情形:
我的应用程序请求并从BLE外设(血糖仪)接收数据。用户可能安装了另一个应用程序(来自另一个开发人员),该应用程序也与外围设备通信。我注意到我的应用程序收到其他应用程序发起的请求的特征通知。这会导致我的应用两次接收到一些数据。

I have to following scenario: My app requests and receives data from an BLE peripheral (a glucometer). It it possible that the user has another app (from another developer) installed, that also communicates with the peripheral. I noticed that my app receives characteristic notifications for requests that where initiated by the other app. This causes my app to receive some data twice.

有什么方法可以区分对我的请求的响应和由另一个应用引起的响应吗?还是我该如何处理?

Is there any way to distinguish between responses to my request and responses that are caused by another app? Or how can I handle it?

推荐答案

虽然堆栈显然知道某个(读,写)响应属于哪个应用(因为可能只有一个待处理的请求,并且知道是谁发送了请求,所以没有逻辑或合理的理由为什么它应该向单个应用程序(在启用了通知的用户中)发送通知。

While the stack obviously knows which app a certain (read, write) response belongs to (because there may only be one pending request, and it knows who sent the request), there is no logical or sound reason why it should dispatch a notification to a single app (among those who have enabled notifications).

请注意,GATT规范未定义每个链接有多个gatt客户端,只有一个客户端,因此外围设备甚至不知道可能有两个应用在与之通信。因此,当它发送通知时,它不包含目标应用程序字段。

Note that the GATT specification does not define "multiple gatt clients per link", there is only one client, so the peripheral doesn't even know there might be two apps talking to it. Hence when it sends a notification, it doesn't include a "target app" field.

iOS和Android具有将多个应用程序复用到同一GATT连接的功能团队等提出了建议。

The feature of multiplexing multiple apps to the same GATT connection is something iOS and Android teams etc. came up with.

这篇关于访问相同BLE外设的iOS应用:如何区分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆