In the previous tutorial within this series covering our recently-released NanoBeacon BLE Scanner mobile app, we covered an overview of the mobile app, where to install it from, how to use it to import an IN100 configuration from the NanoBeacon Config Tool desktop app, and more.
在本系列的上一篇教程中,我們介紹了最近發(fā)布的NanoBeacon BLE掃描器移動(dòng)應(yīng)用程序,包括移動(dòng)應(yīng)用程序的概述、從哪里安裝、如何使用它從NanoBeacon 配置工具桌面應(yīng)用程序?qū)隝N100配置等。
In this tutorial, we will cover the following:
在本教程中,我們將介紹以下內(nèi)容:
A detailed look into device filters
對(duì)設(shè)備過(guò)濾器的詳細(xì)了解
Differences between the iOS and Android versions of the app
該應(yīng)用程序的iOS和Android版本之間的差異
Let’s get started!
讓我們開始吧!
Device Filters設(shè)備過(guò)濾器
Here’s a look at the various filters available within the app for filtering for specific devices:
下面我們來(lái)看看應(yīng)用程序中可用于過(guò)濾特定設(shè)備的各種過(guò)濾器:
To recap, the available filters are:
簡(jiǎn)而言之,可用的過(guò)濾器是:
Name: this allows you to filter by device name.
名稱:這允許你按設(shè)備名稱過(guò)濾。
Advanced: allows you to filter by raw data included in the advertising data, company name, etc.
高級(jí):允許你按廣播數(shù)據(jù)中包含的原始數(shù)據(jù)、公司名稱等進(jìn)行過(guò)濾。
On Android, filtering by Bluetooth Address is possible (iOS does not expose the device’s Bluetooth address).
在安卓系統(tǒng)上,可以通過(guò)藍(lán)牙地址進(jìn)行過(guò)濾(iOS系統(tǒng)不暴露設(shè)備的藍(lán)牙地址)。
Minimum RSSI: this allows you to filter out devices that are discovered with an RSSI lower than the set value.
最小RSSI:這允許你過(guò)濾掉那些發(fā)現(xiàn)的RSSI低于設(shè)定值的設(shè)備。
Hide unnamed devices: this allows you to hide devices that donotadvertise a device name.
隱藏未命名的設(shè)備:這允許你隱藏那些沒(méi)有公布設(shè)備名稱的設(shè)備。
Only show project configuration matches:this allows you to show only devices that match the imported IN100 configuration (via scanning the QR code from the NanoBeacon Config Tool app).
只顯示項(xiàng)目配置匹配:這允許你只顯示與導(dǎo)入的IN100配置匹配的設(shè)備(通過(guò)掃描NanoBeacon配置工具應(yīng)用程序的QR碼)。
Sort by RSSI: this allows you to sort the list of devices by detected RSSI (starting with the device with the strongest signal).
按RSSI排序: 這允許你按檢測(cè)到的RSSI對(duì)設(shè)備列表進(jìn)行排序(從信號(hào)最強(qiáng)的設(shè)備開始)。
Type:allows you to show any combination of iBeacon, Eddystone UID, and Eddystone TLM advertising devices (while excluding other non-selected devices), as shown below:
類型:允許你顯示iBeacon、Eddystone UID和Eddystone TLM廣播設(shè)備的任何組合(同時(shí)排除其他未選擇的設(shè)備),如下所示:
Let’s dig into each of these in more detail.
讓我們更詳細(xì)地挖掘其中的每一點(diǎn)。
Device Name and Unnamed Devices
設(shè)備名稱和未命名的設(shè)備
When scanning for advertising BLE devices, you will typically see dozens of devices being discovered. This can make it challenging to find the device of interest. To address this (and if you know the device name), you can type in a portion of the device name (case-sensitive), and the scanner will only display the devices that match the entered device name.
在掃描廣播BLE設(shè)備時(shí),你通常會(huì)看到有幾十個(gè)設(shè)備被發(fā)現(xiàn)。這可能會(huì)使找到感興趣的設(shè)備成為一種挑戰(zhàn)。為了解決這個(gè)問(wèn)題(如果您知道設(shè)備名稱),您可以輸入設(shè)備名稱的一部分(區(qū)分大小寫),掃描器將只顯示與輸入的設(shè)備名稱相符的設(shè)備。
For example, here I’ve set up an IN100 with one advertising set (custom data type), and I’ve set the device name to be “IN100”:
例如,在這里我設(shè)置了一個(gè)IN100的廣播集(自定義數(shù)據(jù)類型),我將設(shè)備名稱設(shè)置為 "IN100":
In the scanner view, the device will show up but among tens of other devices, making it challenging to find. Let’s add a device name filter to make it easier to find:
在掃描器視圖中,該設(shè)備將顯示出來(lái),但在幾十個(gè)其他設(shè)備中,使其難以找到。讓我們添加一個(gè)設(shè)備名稱過(guò)濾器,使其更容易找到:
Once we enter the device name filter, we can click to the filter icon to go back to the scanner view. In the scanner view, we should be able to see the device now without all the other devices:
一旦我們輸入了設(shè)備名稱過(guò)濾器,我們就可以點(diǎn)擊過(guò)濾器圖標(biāo)回到掃描儀視圖。在掃描器視圖中,我們現(xiàn)在應(yīng)該能夠看到這個(gè)設(shè)備,而沒(méi)有其他所有的設(shè)備:
This also works by entering partial strings, for example “IN”.
這也可以通過(guò)輸入部分字符串來(lái)實(shí)現(xiàn),例如 "IN"。
Another useful filter is the “Hide unnamed devices” checkbox. Once that’s checked, the scanner will only display devices that have included a device name in the advertising data:
另一個(gè)有用的過(guò)濾器是 "隱藏未命名的設(shè)備 "復(fù)選框。一旦選中,掃描器將只顯示在廣播數(shù)據(jù)中包含設(shè)備名稱的設(shè)備:
Sorting by RSSI and Min RSSI
按RSSI和最小RSSI排序
Two other useful filters are the “Sort by RSSI” and “Minimum RSSI” filters.
另外兩個(gè)有用的過(guò)濾器是 "按RSSI排序 "和 "最小RSSI "過(guò)濾器。
“Minimum RSSI” is helpful for filtering out devices that are too far and that typically add clutter to the scan results. For relatively nearby devices, we recommend discovering devices with an RSSI of -70 or greater. This will ensure you are only looking at devices that are in proximity to your smartphone.
"最小RSSI "有助于過(guò)濾掉太遠(yuǎn)的設(shè)備,這些設(shè)備通常會(huì)給掃描結(jié)果帶來(lái)混亂。對(duì)于相對(duì)較近的設(shè)備,我們建議發(fā)現(xiàn)RSSI為-70或更高的設(shè)備。這將確保你只看到與你的智能手機(jī)相近的設(shè)備。
Once you’ve set the minimum RSSI, it is also helpful to utilize the “Sort by RSSI” filter, which allows you to see a sorted list of discovered devices starting with the highest RSSI.
一旦你設(shè)置了最低RSSI,利用 "按RSSI排序 "過(guò)濾器也是很有幫助的,它可以讓你看到一個(gè)從最高RSSI開始的已發(fā)現(xiàn)設(shè)備的排序列表。
Here’s an example screenshot showing the results:
下面是一個(gè)顯示結(jié)果的屏幕截圖示例:
As you can see, the devices are sorted by RSSI in descending order.
你可以看到,設(shè)備是按RSSI降序排序的。
Type Filter類型過(guò)濾器
With the “Type” filter, you can ensure that only specific devices (iBeacon, Eddystone TLM, and Eddystone UID) are being listed in scanner view. You can select one or more of these types to show matching devices. The selected type is the only one that will be matched in the list. For example, selecting “Eddystone TLM” will only show Eddystone TLM advertising devices.
通過(guò) "類型 "過(guò)濾器,你可以確保只有特定的設(shè)備(iBeacon、Eddystone TLM和Eddystone UID)被列在掃描儀視圖中。你可以選擇這些類型中的一個(gè)或多個(gè)來(lái)顯示匹配的設(shè)備。所選的類型是列表中唯一會(huì)被匹配的類型。例如,選擇 "Eddystone TLM "將只顯示Eddystone TLM廣播設(shè)備。
Note that all configured filters will be applied to the scan results. Also, there are certain restrictions on discovered iBeacon devices in the iOS version of the app. We’ll cover more on that in a later section within the tutorial.
請(qǐng)注意,所有配置的過(guò)濾器都將應(yīng)用于掃描結(jié)果。另外,在iOS版本的應(yīng)用程序中,對(duì)發(fā)現(xiàn)的iBeacon設(shè)備有一定的限制。我們將在本教程的后面一節(jié)中詳細(xì)介紹。
“Only show project configuration matches” Filter
"僅顯示項(xiàng)目配置匹配 "過(guò)濾器
The “Only show project configuration matches” filter is a unique feature of our NanoBeacon BLE Scanner mobile app. It allows you to only show devices that match the imported configuration from the NanoBeacon Config Tool.
"僅顯示項(xiàng)目配置匹配 "過(guò)濾器是我們的NanoBeacon BLE掃描器移動(dòng)應(yīng)用程序的一個(gè)獨(dú)特功能。它允許你只顯示與從NanoBeacon配置工具導(dǎo)入的配置相匹配的設(shè)備。
This is a very powerful filter that will not only let you focus on analyzing your IN100 device’s advertising data but also view it in a human-readable format, which no other mobile app on the market can do!
這是一個(gè)非常強(qiáng)大的過(guò)濾器,不僅可以讓你專注于分析IN100設(shè)備的廣播數(shù)據(jù),還可以以人類可讀的格式查看,這是市場(chǎng)上其他移動(dòng)應(yīng)用程序所不能做到的!
We covered how to import configurations via the QR code scan functionality in theprevious tutorial in this series.
我們?cè)诒鞠盗械纳弦黄坛讨薪榻B了如何通過(guò)二維碼掃描功能導(dǎo)入配置。
After importing the configuration and selecting this filter, the scanner will only show your device:
導(dǎo)入配置并選擇該過(guò)濾器后,掃描儀將只顯示你的設(shè)備:
And to make things even more user-friendly, you can navigate into each of the discovered advertising sets to view the detailed parsed advertising data:
為了使事情變得更加方便,你可以導(dǎo)航到每一個(gè)被發(fā)現(xiàn)的廣播集,以查看詳細(xì)的解析廣播數(shù)據(jù):
Advanced Filters 高級(jí)過(guò)濾器
The last filter we want to cover is the “Advanced” entry field. This allows us to filter by:
我們要介紹的最后一個(gè)過(guò)濾器是 "高級(jí) "條目欄。這使我們可以通過(guò)以下方式進(jìn)行過(guò)濾:
Raw bytes in the advertising data (hex values)
廣播數(shù)據(jù)中的原始字節(jié)(十六進(jìn)制值)
Company ID (hex values)
公司ID (十六進(jìn)制值)
Company Name (string values)
公司名稱(字符串值)
Device Name as well (string values)
設(shè)備名稱也是(字符串值)
Let’s take a look at an example of a discovered device and which parts can be matched using the Advanced Filter:
讓我們來(lái)看看一個(gè)被發(fā)現(xiàn)的設(shè)備的例子,以及哪些部分可以用高級(jí)過(guò)濾器來(lái)匹配:
As you can see, there are various types of filters that can help you match only the devices you’re interested in discovering and having show up in the list.
正如你所看到的,有各種類型的過(guò)濾器,可以幫助你只匹配你有興趣發(fā)現(xiàn)并顯示在列表中的設(shè)備。
Differences Between iOS and Android Versions of the App
應(yīng)用程序的iOS和Android版本之間的差異
There are quite a few differences between iOS and Android when it comes to UI, the functionality and APIs available to apps, BLE behavior, etc.
在用戶界面、應(yīng)用程序可用的功能和API、BLE行為等方面,iOS和Android之間有相當(dāng)多的差異。
It’s essential to be aware of these differences not just as a developer but also as a user of our mobile app. This will help you better understand how things work on each platform and are aware of any differences in behavior between the two that could affect your development and testing activities when working with BLE devices, specifically our NanoBeacon IN100.
不僅僅是作為一個(gè)開發(fā)者,而且作為我們的移動(dòng)應(yīng)用的用戶,意識(shí)到這些差異是非常重要的。這將有助于你更好地了解每個(gè)平臺(tái)上的工作方式,并意識(shí)到兩者之間的任何行為差異,這可能會(huì)影響你在使用BLE設(shè)備時(shí)的開發(fā)和測(cè)試活動(dòng),特別是我們的NanoBeacon IN100。
Here’s a summary of the differences between the two platforms as it pertains to Bluetooth Low Energy functionality and the functionality of our NanoBeacon BLE Scanner mobile app:
以下是兩個(gè)平臺(tái)之間的差異總結(jié),它涉及到藍(lán)牙低能量功能和我們的NanoBeacon BLE掃描器移動(dòng)應(yīng)用程序的功能:
Advertisement Data 廣播數(shù)據(jù)
iOS does not give apps visibility of the Bluetooth address, so it’s not possible to search by or view the Bluetooth address of the discovered device(s).
iOS不給應(yīng)用程序提供藍(lán)牙地址的可見性,所以不可能通過(guò)搜索或查看所發(fā)現(xiàn)設(shè)備的藍(lán)牙地址。
iBeacons come through the Core Location framework on iOS and are reported once per second, so the adv interval cannot be estimated.
iBeacons通過(guò)iOS上的核心定位框架,每秒報(bào)告一次,所以無(wú)法估計(jì)廣播時(shí)間間隔。
iOS does not provide access to the raw advertisement data, so user-defined data types are not supported.
iOS不提供對(duì)原始廣播數(shù)據(jù)的訪問(wèn),所以不支持用戶定義的數(shù)據(jù)類型。
On iOS, it’s not possible to scan for unspecified iBeacons, and they will not show up in scan results unless you have scanned in a configuration that contains an iBeacon. The app registers the iBeacon when you load the configuration.
在iOS上,不可能掃描未指定的iBeacon,除非你在包含iBeacon的配置中進(jìn)行了掃描,否則它們不會(huì)在掃描結(jié)果中顯示出來(lái)。當(dāng)你加載配置時(shí),應(yīng)用程序會(huì)注冊(cè)iBeacon。
iOS will report iBeacons RSSI as 0 if iOS cannot determine the iBeacons proximity based on the TX power included in the iBeacon payload. The algorithm used by iOS is not public.
如果iOS無(wú)法根據(jù)iBeacon有效載荷中包含的發(fā)射功率確定iBeacon的距離,那么iOS將把iBeacons的RSSI報(bào)告為0。iOS使用的算法并不公開。
iOS will continue to report an iBeacon for up to 30 seconds after it has been powered down (or goes out of range).
在iBeacon斷電(或超出范圍)后,iOS將繼續(xù)報(bào)告該iBeacon長(zhǎng)達(dá)30秒。
General Scanning 一般掃描
iOS will miss more advertisement packets than Android when using a larger advertisement interval (greater than 1000 ms).
當(dāng)使用較大的廣播間隔(大于1000毫秒)時(shí),iOS將比Android錯(cuò)過(guò)更多的廣播數(shù)據(jù)包。
Background Scanning 背景掃描
iOS does not allow continuous background scanning for advertisement data, with the exception of iBeacons.
除了iBeacons之外,iOS不允許對(duì)廣播數(shù)據(jù)進(jìn)行連續(xù)的后臺(tái)掃描。
Android will allow continuous background scanning for all BLE advertisements.
Android將允許對(duì)所有BLE廣播進(jìn)行連續(xù)的后臺(tái)掃描。
Notifications 通知
Android supports background notifications for all types of Triggered advertisements.
Android支持所有類型的Triggered廣播的后臺(tái)通知。
iOS only supports background notifications for Triggered iBeacon advertisements.
iOS只支持Triggered iBeacon廣播的后臺(tái)通知。
Conclusion 總結(jié)
And that’s it for this tutorial. We covered a lot of topics, including:
本教程到此結(jié)束。我們涵蓋了很多主題,包括:
Device Filters:
設(shè)備過(guò)濾器:
Device Name
設(shè)備名稱
Minimum RSSI
最小RSSI
Sort by RSSI
按RSSI排序
Hide Unnamed Devices
隱藏未命名的設(shè)備
Advanced Filters (raw data/bytes, text/strings, etc.)
高級(jí)過(guò)濾器(原始數(shù)據(jù)/字節(jié)、文本/字符串等)
Only Show Configuration Matches
只顯示配置匹配的設(shè)備
Filter by Type (Eddystone TLM, Eddystone UID, and iBeacon)
按類型過(guò)濾(Eddystone TLM,Eddystone UID,和iBeacon)
The differences between the iOS and Android versions of the mobile app.
移動(dòng)應(yīng)用程序的iOS和Android版本之間的差異。
In the upcoming tutorials in the series, we will cover:
在接下來(lái)的系列教程中,我們將介紹:
How to export logging data for captured advertising sets and analyze them
如何為捕獲的廣播集導(dǎo)出記錄數(shù)據(jù)并進(jìn)行分析
App notifications for Triggered Advertising Mode advertising sets
觸發(fā)式廣播模式廣播集的應(yīng)用程序通知
The new NanoBeaconLib mobile app library (allows you to develop a custom IN100-interfacing mobile app in no time!)
新的NanoBeaconLib移動(dòng)應(yīng)用程序庫(kù)(允許你在短時(shí)間內(nèi)開發(fā)一個(gè)自定義的IN100界面的移動(dòng)應(yīng)用程序!)。
and more!
以及更多!
審核編輯:湯梓紅
-
Android
+關(guān)注
關(guān)注
12文章
3945瀏覽量
128005 -
藍(lán)牙
+關(guān)注
關(guān)注
114文章
5878瀏覽量
171318 -
應(yīng)用程序
+關(guān)注
關(guān)注
38文章
3296瀏覽量
57946 -
BLE
+關(guān)注
關(guān)注
12文章
670瀏覽量
59612 -
掃描器
+關(guān)注
關(guān)注
0文章
170瀏覽量
11961
原文標(biāo)題:NanoBeacon? BLE掃描器教程(第二部分)
文章出處:【微信號(hào):gh_3f4003bc6add,微信公眾號(hào):橙群微電子】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論