android - 是否可以使用蓝牙作为接近探测器?
问题描述
演员:
服务器:是一个根植的 Android 设备,从不休眠(从不进入待机状态)
客户端:是许多无根智能手机、Android 或 IOS 之一
场景:
服务器固定在一个地方。
服务器需要知道某个客户端何时在附近,无需用户干预,识别该设备。客户端已打开,但可以处于待机状态(屏幕关闭)。
我可以将自定义应用程序安装到客户端和服务器。
实现目标:
当客户端靠近服务器时,服务器会知道,无需用户干预。
检测不需要用户干预,但可能是第一次用户必须做一些配置来注册服务器蓝牙。
问题:
有可能实现吗?
Android 和 IOS 客户端都适用吗?
我必须实施哪些解决方案?
先感谢您
解决方案
Just an idea but with ble you can do an advertisement with a packet of data.
- Have an app that advertises some data for the client app.
- Then on the server application receive these values by performing a ble scan.
Within this scan you can see the device address, scan record data(advertisement) and the RSSI. The rssi is the received power. From this you should be able to infer distance. As if the RSSI is lower then the device is further away thus a proximity detector. So if the RSSI is above a certain value add this device to a list to say they are in your detector range.
推荐阅读
- javascript - React Native 中的获取请求发布方法
- bigcommerce - Big Commerce - 按价格算法购物
- angular - 离子 - 照片查看器崩溃:“UIDocumentInteractionController:无效方案 https。”
- javascript - Node.js Passport Authentication - 日志未定义错误
- android - 尝试构建未签名的 APK 不断收到错误任务“:app:transformDexArchiveWithExternalLibsDexMergerForDebug”执行失败
- database - 用 kdb+q 中的随机数更新表
- google-bigquery - 如何在 BigQuery Variant Schema 中进行继承/传输查询
- spring-boot - JPA中包含和喜欢有什么区别?
- vue.js - 使用 Browserify 和 CommonJS 表达 Vue 依赖项
- javascript - 如何将 html 放入 Ext.each() 并在其中呈现值-EXTJS