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.
在本系列的上一篇教程中,我們介紹了最近發布的NanoBeacon BLE掃描器移動應用程序,包括移動應用程序的概述、從哪里安裝、如何使用它從NanoBeacon 配置工具桌面應用程序導入IN100配置等。
In this tutorial, we will cover the following:
在本教程中,我們將介紹以下內容:
A detailed look into device filters
對設備過濾器的詳細了解
Differences between the iOS and Android versions of the app
該應用程序的iOS和Android版本之間的差異
Let’s get started!
讓我們開始吧!
Device Filters設備過濾器
Here’s a look at the various filters available within the app for filtering for specific devices:
下面我們來看看應用程序中可用于過濾特定設備的各種過濾器:
To recap, the available filters are:
簡而言之,可用的過濾器是:
Name: this allows you to filter by device name.
名稱:這允許你按設備名稱過濾。
Advanced: allows you to filter by raw data included in the advertising data, company name, etc.
高級:允許你按廣播數據中包含的原始數據、公司名稱等進行過濾。
On Android, filtering by Bluetooth Address is possible (iOS does not expose the device’s Bluetooth address).
在安卓系統上,可以通過藍牙地址進行過濾(iOS系統不暴露設備的藍牙地址)。
Minimum RSSI: this allows you to filter out devices that are discovered with an RSSI lower than the set value.
最小RSSI:這允許你過濾掉那些發現的RSSI低于設定值的設備。
Hide unnamed devices: this allows you to hide devices that donotadvertise a device name.
隱藏未命名的設備:這允許你隱藏那些沒有公布設備名稱的設備。
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).
只顯示項目配置匹配:這允許你只顯示與導入的IN100配置匹配的設備(通過掃描NanoBeacon配置工具應用程序的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排序: 這允許你按檢測到的RSSI對設備列表進行排序(從信號最強的設備開始)。
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廣播設備的任何組合(同時排除其他未選擇的設備),如下所示:
Let’s dig into each of these in more detail.
讓我們更詳細地挖掘其中的每一點。
Device Name and Unnamed Devices
設備名稱和未命名的設備
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設備時,你通常會看到有幾十個設備被發現。這可能會使找到感興趣的設備成為一種挑戰。為了解決這個問題(如果您知道設備名稱),您可以輸入設備名稱的一部分(區分大小寫),掃描器將只顯示與輸入的設備名稱相符的設備。
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”:
例如,在這里我設置了一個IN100的廣播集(自定義數據類型),我將設備名稱設置為 "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:
在掃描器視圖中,該設備將顯示出來,但在幾十個其他設備中,使其難以找到。讓我們添加一個設備名稱過濾器,使其更容易找到:
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:
一旦我們輸入了設備名稱過濾器,我們就可以點擊過濾器圖標回到掃描儀視圖。在掃描器視圖中,我們現在應該能夠看到這個設備,而沒有其他所有的設備:
This also works by entering partial strings, for example “IN”.
這也可以通過輸入部分字符串來實現,例如 "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:
另一個有用的過濾器是 "隱藏未命名的設備 "復選框。一旦選中,掃描器將只顯示在廣播數據中包含設備名稱的設備:
Sorting by RSSI and Min RSSI
按RSSI和最小RSSI排序
Two other useful filters are the “Sort by RSSI” and “Minimum RSSI” filters.
另外兩個有用的過濾器是 "按RSSI排序 "和 "最小RSSI "過濾器。
“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 "有助于過濾掉太遠的設備,這些設備通常會給掃描結果帶來混亂。對于相對較近的設備,我們建議發現RSSI為-70或更高的設備。這將確保你只看到與你的智能手機相近的設備。
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.
一旦你設置了最低RSSI,利用 "按RSSI排序 "過濾器也是很有幫助的,它可以讓你看到一個從最高RSSI開始的已發現設備的排序列表。
Here’s an example screenshot showing the results:
下面是一個顯示結果的屏幕截圖示例:
As you can see, the devices are sorted by RSSI in descending order.
你可以看到,設備是按RSSI降序排序的。
Type Filter類型過濾器
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.
通過 "類型 "過濾器,你可以確保只有特定的設備(iBeacon、Eddystone TLM和Eddystone UID)被列在掃描儀視圖中。你可以選擇這些類型中的一個或多個來顯示匹配的設備。所選的類型是列表中唯一會被匹配的類型。例如,選擇 "Eddystone TLM "將只顯示Eddystone TLM廣播設備。
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.
請注意,所有配置的過濾器都將應用于掃描結果。另外,在iOS版本的應用程序中,對發現的iBeacon設備有一定的限制。我們將在本教程的后面一節中詳細介紹。
“Only show project configuration matches” Filter
"僅顯示項目配置匹配 "過濾器
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.
"僅顯示項目配置匹配 "過濾器是我們的NanoBeacon BLE掃描器移動應用程序的一個獨特功能。它允許你只顯示與從NanoBeacon配置工具導入的配置相匹配的設備。
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!
這是一個非常強大的過濾器,不僅可以讓你專注于分析IN100設備的廣播數據,還可以以人類可讀的格式查看,這是市場上其他移動應用程序所不能做到的!
We covered how to import configurations via the QR code scan functionality in theprevious tutorial in this series.
我們在本系列的上一篇教程中介紹了如何通過二維碼掃描功能導入配置。
After importing the configuration and selecting this filter, the scanner will only show your device:
導入配置并選擇該過濾器后,掃描儀將只顯示你的設備:
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:
為了使事情變得更加方便,你可以導航到每一個被發現的廣播集,以查看詳細的解析廣播數據:
Advanced Filters 高級過濾器
The last filter we want to cover is the “Advanced” entry field. This allows us to filter by:
我們要介紹的最后一個過濾器是 "高級 "條目欄。這使我們可以通過以下方式進行過濾:
Raw bytes in the advertising data (hex values)
廣播數據中的原始字節(十六進制值)
Company ID (hex values)
公司ID (十六進制值)
Company Name (string values)
公司名稱(字符串值)
Device Name as well (string values)
設備名稱也是(字符串值)
Let’s take a look at an example of a discovered device and which parts can be matched using the Advanced Filter:
讓我們來看看一個被發現的設備的例子,以及哪些部分可以用高級過濾器來匹配:
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.
正如你所看到的,有各種類型的過濾器,可以幫助你只匹配你有興趣發現并顯示在列表中的設備。
Differences Between iOS and Android Versions of the App
應用程序的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.
在用戶界面、應用程序可用的功能和API、BLE行為等方面,iOS和Android之間有相當多的差異。
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.
不僅僅是作為一個開發者,而且作為我們的移動應用的用戶,意識到這些差異是非常重要的。這將有助于你更好地了解每個平臺上的工作方式,并意識到兩者之間的任何行為差異,這可能會影響你在使用BLE設備時的開發和測試活動,特別是我們的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:
以下是兩個平臺之間的差異總結,它涉及到藍牙低能量功能和我們的NanoBeacon BLE掃描器移動應用程序的功能:
Advertisement Data 廣播數據
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不給應用程序提供藍牙地址的可見性,所以不可能通過搜索或查看所發現設備的藍牙地址。
iBeacons come through the Core Location framework on iOS and are reported once per second, so the adv interval cannot be estimated.
iBeacons通過iOS上的核心定位框架,每秒報告一次,所以無法估計廣播時間間隔。
iOS does not provide access to the raw advertisement data, so user-defined data types are not supported.
iOS不提供對原始廣播數據的訪問,所以不支持用戶定義的數據類型。
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的配置中進行了掃描,否則它們不會在掃描結果中顯示出來。當你加載配置時,應用程序會注冊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無法根據iBeacon有效載荷中包含的發射功率確定iBeacon的距離,那么iOS將把iBeacons的RSSI報告為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將繼續報告該iBeacon長達30秒。
General Scanning 一般掃描
iOS will miss more advertisement packets than Android when using a larger advertisement interval (greater than 1000 ms).
當使用較大的廣播間隔(大于1000毫秒)時,iOS將比Android錯過更多的廣播數據包。
Background Scanning 背景掃描
iOS does not allow continuous background scanning for advertisement data, with the exception of iBeacons.
除了iBeacons之外,iOS不允許對廣播數據進行連續的后臺掃描。
Android will allow continuous background scanning for all BLE advertisements.
Android將允許對所有BLE廣播進行連續的后臺掃描。
Notifications 通知
Android supports background notifications for all types of Triggered advertisements.
Android支持所有類型的Triggered廣播的后臺通知。
iOS only supports background notifications for Triggered iBeacon advertisements.
iOS只支持Triggered iBeacon廣播的后臺通知。
Conclusion 總結
And that’s it for this tutorial. We covered a lot of topics, including:
本教程到此結束。我們涵蓋了很多主題,包括:
Device Filters:
設備過濾器:
Device Name
設備名稱
Minimum RSSI
最小RSSI
Sort by RSSI
按RSSI排序
Hide Unnamed Devices
隱藏未命名的設備
Advanced Filters (raw data/bytes, text/strings, etc.)
高級過濾器(原始數據/字節、文本/字符串等)
Only Show Configuration Matches
只顯示配置匹配的設備
Filter by Type (Eddystone TLM, Eddystone UID, and iBeacon)
按類型過濾(Eddystone TLM,Eddystone UID,和iBeacon)
The differences between the iOS and Android versions of the mobile app.
移動應用程序的iOS和Android版本之間的差異。
In the upcoming tutorials in the series, we will cover:
在接下來的系列教程中,我們將介紹:
How to export logging data for captured advertising sets and analyze them
如何為捕獲的廣播集導出記錄數據并進行分析
App notifications for Triggered Advertising Mode advertising sets
觸發式廣播模式廣播集的應用程序通知
The new NanoBeaconLib mobile app library (allows you to develop a custom IN100-interfacing mobile app in no time!)
新的NanoBeaconLib移動應用程序庫(允許你在短時間內開發一個自定義的IN100界面的移動應用程序!)。
and more!
以及更多!
審核編輯:湯梓紅
-
Android
+關注
關注
12文章
3926瀏覽量
127158 -
藍牙
+關注
關注
114文章
5775瀏覽量
169870 -
應用程序
+關注
關注
37文章
3245瀏覽量
57614 -
BLE
+關注
關注
12文章
653瀏覽量
59345 -
掃描器
+關注
關注
0文章
157瀏覽量
11900
原文標題:NanoBeacon? BLE掃描器教程(第二部分)
文章出處:【微信號:gh_3f4003bc6add,微信公眾號:橙群微電子】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
評論