一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲AV|成人开心激情五月|欧美性爱内射视频|超碰人人干人人上|一区二区无码三区亚洲人区久久精品

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

NanoBeacon? BLE掃描器教程(第三部分)

橙群微電子 ? 2023-06-08 10:40 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

Let’s recap what we covered in the previous articles within this series:

讓我們回顧一下我們在本系列的前幾篇文章中所涉及的內(nèi)容:

  • Requirements, installation, and setup steps for using the mobile app
  • 使用移動應用程序的要求、安裝和設(shè)置步驟
  • Overview of the different sections within the app
  • 應用程序內(nèi)不同部分的概述
  • Running a few test case scenarios with different advertising data types
  • 用不同的廣播數(shù)據(jù)類型運行一些測試案例場景
  • A detailed look at device filters
  • 詳細了解設(shè)備過濾器
  • Differences between the iOS and Android versions of the app
  • 該應用程序的iOS和Android版本之間的差異


In this particular tutorial, we will focus on one of the most unique features of our app: App Notifications (even in the background) for detecting Triggered Advertising Sets.

在這個特別的教程中,我們將專注于我們應用程序的一個最獨特的功能:應用通知(甚至在后臺),用于檢測觸發(fā)的廣播集。


So, how do these work? what exactly do we mean by “Triggered”? What are the limitations of app notifications in both versions of the app (Android and iOS)?

那么,這些是如何工作的?"Triggered "到底是什么意思?在兩個版本的應用程序(安卓和iOS)中,應用程序通知的限制是什么?


Triggered Advertising Sets觸發(fā)式廣播集


Triggered advertising sets allow the user to configure the device to send advertising packets only when certain conditions occur.

觸發(fā)式廣播集允許用戶配置設(shè)備,使其僅在某些條件發(fā)生時發(fā)送廣播包。


This can be very useful in use cases where advertising packets are only needed when one or more conditions are met, for example, the battery level going below 10% or the temperate going over 40 degrees Celsius. In this case, sending advertising data all the time regardless of these conditions (which is what is referred to as “Continuous Advertising Mode” in the NanoBeacon Config Tool) would unnecessarily increase battery consumption, so it makes sense to only send them out based on certain conditions.

這對于只有在滿足一個或多個條件時才需要廣播數(shù)據(jù)包的用例非常有用,例如,電池電量低于10%或溫度超過40攝氏度。在這種情況下,不管這些條件如何,一直發(fā)送廣播數(shù)據(jù)(這就是NanoBeacon配置工具中所說的 "連續(xù)廣播模式")會不必要地增加電池消耗,所以只根據(jù)某些條件發(fā)送廣播是有意義的。


Here’s a look at the various options available for this mode within the NanoBeacon Config Tool:

下面我們來看看NanoBeacon配置工具中該模式的各種可用選項:


0f45fb1a-0014-11ee-ba01-dac502259ad0.png

1、Triggered advertising event count: this defines the number of advertising events transmitted if a triggered condition is met.

1、觸發(fā)的廣播事件計數(shù):這定義了在滿足觸發(fā)條件時傳輸?shù)膹V播事件的數(shù)量。


2、Trigger event will reset triggered advertising event count: enabling this will reset the advertising event count set above in #1, meaning that if any of the trigger conditions are met, it will keep resetting the count and continue sending the advertising packets. Once none of the trigger conditions are met, the advertising event count will start decrementing. For example, suppose this option was enabled, and the trigger condition was a high threshold for internal temperature ≥ 25 deg C, and the temperature surpassed this threshold. In that case, it will continue sending advertising events until the temperature is below the threshold, and then it will only send the number of advertising events set in option #1.

2、觸發(fā)事件將重置被觸發(fā)的廣播事件計數(shù):啟用這個功能將重置上面#1中設(shè)置的廣播事件計數(shù),這意味著如果滿足任何一個觸發(fā)條件,它將不斷重置計數(shù)并繼續(xù)發(fā)送廣播數(shù)據(jù)包。一旦沒有一個觸發(fā)條件被滿足,廣播事件計數(shù)將開始遞減。例如,假設(shè)該選項被啟用,而觸發(fā)條件是內(nèi)部溫度≥25攝氏度的高閾值,并且溫度超過了這個閾值。在這種情況下,它將繼續(xù)發(fā)送廣播事件,直到溫度低于閾值,然后它將只發(fā)送選項#1中設(shè)置的廣播事件數(shù)量。


3、Single trigger, Recurring trigger, Advertise indefinitely after 1st trigger:

3、單次觸發(fā)、重復觸發(fā)、第1次觸發(fā)后無限期廣播:

  • Single Trigger: choosing this type will set the behavior to only send the advertising events upon any of the trigger conditions being met just once. If the trigger conditions are met later (during the same power cycle), no advertising events will be transmitted.

  • 單次觸發(fā):選擇這種類型將設(shè)置行為,只在任何一次觸發(fā)條件被滿足時才發(fā)送廣播事件。如果以后再滿足觸發(fā)條件(在同一電源周期內(nèi)),將不發(fā)送廣播事件。

  • Recurring Trigger: choosing this type will send out advertising events every time a trigger condition is met.

  • 循環(huán)觸發(fā):選擇這種類型,每次觸發(fā)條件被滿足時都會發(fā)送廣播事件。

  • Advertise indefinitely after 1st trigger: as the name suggests, choosing this type will send out advertising events indefinitely after any of the trigger conditions are met.

  • 第1次觸發(fā)后無限期廣播:顧名思義,選擇這種類型將在滿足任何觸發(fā)條件后無限期地發(fā)送廣播事件。

4、Sensor trigger source: this defines one or more sources for trigger conditions, which are set in the “Global Trigger Settings” section within the NanoBeacon Config Tool. Examples of trigger sources include VCC, Internal Temperature, ADC channels, 1-wire sensor readings, and I2C slave readings.4、傳感器觸發(fā)源:這定義了一個或多個觸發(fā)條件的來源,在 NanoBeacon 配置工具中的 "全局觸發(fā)設(shè)置 "部分設(shè)置。觸發(fā)源的例子包括VCC、內(nèi)部溫度、ADC通道、單線傳感器讀數(shù)和I2C從屬讀數(shù)。


5、GPIO trigger source: this defines one or more sources for trigger conditions based on GPIO status. The GPIOs available are: GPIO2, GPIO3, MGPIO4, MGPIO5, MGPIO6, and MGPIO7.

5、GPIO觸發(fā)源:這定義了一個或多個基于GPIO狀態(tài)的觸發(fā)條件源??捎玫腉PIO是:GPIO2, GPIO3, MGPIO4, MGPIO5, MGPIO6, 和 MGPIO7.


Keep in mind that the triggered event will occur if anyof the defined conditions are met.

請記住,如果滿足任何定義的條件,觸發(fā)的事件就會發(fā)生。


Triggered Advertising Sets on the Mobile App移動應用上的觸發(fā)式廣播集

Now that we better understand how triggered advertisements work and the different options available, we can now test them out to see what they look like and how they behave on both the Android and iOS versions of the mobile app.

現(xiàn)在我們更好地了解了觸發(fā)式廣播的工作原理和不同的選項,我們現(xiàn)在可以測試一下,看看它們在移動應用的安卓和iOS版本上是什么樣子的,表現(xiàn)如何。


Referring back to the previous article, where we covered the differences between the iOS and Android versions of the app, the following is a significant difference related to notifications:

參考之前的文章,我們介紹了iOS和Android版本的應用程序之間的差異,以下是與通知有關(guān)的重大差異:

  • Android supports background notifications for all types of Triggered advertisements.

  • 安卓支持所有類型的Triggered廣播的后臺通知。

  • iOS only supports background notifications for Triggered iBeacon advertisements.

  • iOS只支持Triggered iBeacon廣播的后臺通知。

Due to this, we’ll use iBeacon as the primary test case in this tutorial.

由于這個原因,我們將使用iBeacon作為本教程的主要測試案例。


Test Case: Single Advertising Set: Triggered iBeacon

測試案例:單一廣播集:觸發(fā)的iBeacon

For this test case, we’ll go ahead and define one advertising set as iBeacon and configure it in Triggered mode.

在這個測試案例中,我們將繼續(xù)將一個廣播集定義為iBeacon,并將其配置為觸發(fā)模式。


We’ll also define the following configuration parameters, all in the NanoBeacon Config Tool:

我們還將在NanoBeacon配置工具中定義以下配置參數(shù):

  • Advertising Interval = 100 ms (to make it easier to discover the advertising sets, in practice, you may want to increase the interval to reduce power consumption).

  • 廣播間隔=100毫秒(為了使廣播集更容易被發(fā)現(xiàn),在實踐中,你可能想增加間隔以減少功耗)。

  • Global Triggers: set the source for Trigger #2 to be Internal Temperature and set the High Threshold to some temperature value that’s greater than the current environment you’re in to be able to manually invoke the trigger condition. I’ve set the value to 3000 (which translates to 30 deg C). Note that the value you enter here will be multiplied by the “On-Chip Measurement Unit” defined in the “On-Chip Measurement Units” section accessible from the main screen of the Config Tool.

  • 全局觸發(fā)器:將觸發(fā)器#2的來源設(shè)置為內(nèi)部溫度,并將高閾值設(shè)置為某個溫度值,該值要大于你當前所處的環(huán)境,以便能夠手動調(diào)用觸發(fā)條件。我把這個值設(shè)置為3000(換算成30攝氏度)。請注意,你在這里輸入的值將乘以 "片上測量單位",該單位定義在 "片上測量單位 "部分,可從配置工具的主屏幕上訪問。

  • Set the Advertising Data Format to iBeacon and set the UUID, Major, Minor, and Tx Power values as you’d like.

  • 將廣播數(shù)據(jù)格式設(shè)置為iBeacon,并根據(jù)你的需要設(shè)置UUID、Major、Minor和Tx Power值。

  • Set the Advertising Mode to Triggered Advertising and enable “High Trigger 2” in the Sensor Trigger Source section.

  • 將廣播模式設(shè)置為觸發(fā)式廣播,并在傳感器觸發(fā)源部分啟用 "高觸發(fā)器2"。

Once that’s all set, make sure your IN100 development board and programmer board are attached and connected to the computer running the NanoBeacon Config Tool.

一旦設(shè)置完畢,確保你的IN100開發(fā)板和編程板連接到運行NanoBeacon配置工具的計算機上。


Now you can Probe the device, select it, and then Run in RAM to run your configuration on the IN100 tag.

現(xiàn)在你可以探測設(shè)備,選擇它,然后在RAM中運行,在IN100標簽上運行你的配置。


Here are some screenshots showing the settings described above:

下面是一些顯示上述設(shè)置的屏幕截圖:


0f533d7a-0014-11ee-ba01-dac502259ad0.png

0f5ffcfe-0014-11ee-ba01-dac502259ad0.png

0f6d08f4-0014-11ee-ba01-dac502259ad0.png

0f818d7e-0014-11ee-ba01-dac502259ad0.png

0f8e063a-0014-11ee-ba01-dac502259ad0.png

Now we’re ready to import this configuration into the mobile app. I’ll be using the iOS version for this test.

現(xiàn)在我們準備把這個配置導入到移動應用中。我將使用iOS版本進行這項測試。


Using the QR Code display functionality in the Config Tool and the QR Code import functionality in the mobile app, import the configuration:

使用配置工具中的QR碼顯示功能和移動應用程序中的QR碼導入功能,導入配置:


0f9a4b0c-0014-11ee-ba01-dac502259ad0.png

0fb1b224-0014-11ee-ba01-dac502259ad0.png

Now, navigate to the Scanner view within the mobile app and select “Only show project configuration matches” in the filter options. Give that the temperature is below the high threshold condition you set (30 degrees C in my case), you should not see any devices in the list:

現(xiàn)在,在移動應用程序中導航到掃描儀視圖,在過濾器選項中選擇 "只顯示項目配置匹配"。鑒于溫度低于你設(shè)置的高閾值條件(在我的例子中是30攝氏度),你應該在列表中看不到任何設(shè)備:


0fc48ee4-0014-11ee-ba01-dac502259ad0.png

As a simple way to enable the trigger condition, you can place your finger (or momentarily point a heat gun) on the IN100 chipset on the development board

作為啟用觸發(fā)條件的一個簡單方法,你可以將手指(或用熱風槍瞬間指向)放在開發(fā)板上的IN100芯片組上

0fdb51f6-0014-11ee-ba01-dac502259ad0.png

If you wait long enough for the temperature to hit the high threshold, the Scanner view in the mobile app should now show the iBeacon advertising set, along with a notification at the top of the screen:

如果你等待足夠長的時間讓溫度達到高閾值,移動應用程序中的掃描器視圖現(xiàn)在應該顯示iBeacon廣播設(shè)置,同時在屏幕頂部有一個通知:


0ff9e51c-0014-11ee-ba01-dac502259ad0.png

Even if you have the app running in the background and the phone locked, you should see the notifications come through for each Triggered advertising set being discovered:即使你的應用程序在后臺運行,并且手機被鎖定,你也應該看到每個被發(fā)現(xiàn)的觸發(fā)式廣播集的通知都會出現(xiàn):


1011a986-0014-11ee-ba01-dac502259ad0.png

That’s all you need to do to get notifications for Triggered advertising sets from the mobile app!

這就是你需要做的,從移動應用中獲得觸發(fā)式廣播集的通知!

Keep in mind that iBeacon is the only Advertising Data Format type that can trigger notifications on iOS devices. On Android, that limitation is not present.

請記住,iBeacon是唯一可以在iOS設(shè)備上觸發(fā)通知的廣播數(shù)據(jù)格式類型。在安卓上,這個限制是不存在的。


Conclusion & Summary 結(jié)論與總結(jié)In this tutorial, we covered how to discover Triggered Advertising Sets and showed how app notifications work in the mobile app.

在本教程中,我們介紹了如何發(fā)現(xiàn)觸發(fā)式廣播集,并展示了應用通知在移動應用中的作用。


In the next tutorial, we will go over another unique feature of our mobile app: Logs.

在下一個教程中,我們將介紹我們的移動應用程序的另一個獨特功能:日志。


With logs, you’ll be able to view the history of discovered advertising sets and the advertising data contained in them as well as the ability to export those logs outside of the app to your computer or any other device for later analysis!

通過日志,你將能夠查看已發(fā)現(xiàn)的廣播集的歷史和其中包含的廣播數(shù)據(jù),并能夠?qū)⑦@些日志導出到你的電腦或任何其他設(shè)備,以便日后分析!

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學習之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報投訴
  • BLE
    BLE
    +關(guān)注

    關(guān)注

    12

    文章

    699

    瀏覽量

    60794
  • 掃描器
    +關(guān)注

    關(guān)注

    0

    文章

    180

    瀏覽量

    12374
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評論

    相關(guān)推薦
    熱點推薦

    提高篇——C語言核心技術(shù)(中文版)

    嚴謹?shù)男g(shù)語表介紹C語言;第二部分描述標準鏈接庫;第三部分介紹GNU軟件包中常用的編譯和測試工具。 獲取完整文檔資料可下載附件哦?。。。∪绻麅?nèi)容有幫助可以關(guān)注、點贊、評論支持一下哦~
    發(fā)表于 06-13 16:39

    TI大學計劃-電源篇

    本手冊將分為以下幾部分介紹信號鏈和電源相關(guān)的知識及 TI 產(chǎn)品在大學生創(chuàng)新活動中的應用: 第一部分:運算放大器的原理和設(shè)計; 第二部分:數(shù)據(jù)轉(zhuǎn)換的原理和設(shè)計;
    發(fā)表于 05-19 15:33

    如何用 Raspberry Pi 500 搭建家庭錄音室?

    是時候安裝并配置家庭錄音室中高質(zhì)量音頻制作所需的軟件了。這是來自《樹莓派官方雜志》系列教程的第三部分,也是最后一部分。若想閱讀整個系列教程,請先回顧第一部分(關(guān)于錄音空間設(shè)置),再閱讀第二部分
    的頭像 發(fā)表于 05-18 08:33 ?902次閱讀
    如何用 Raspberry Pi 500 搭建家庭錄音室?

    自助售貨機內(nèi)嵌掃描器應該要如何選用?

    技術(shù)參數(shù)、應用場景、成本效益個維度,系統(tǒng)解析自助售貨機內(nèi)嵌掃描器的選型策略。一、核心性能指標的精準把控掃描速度與精度?是衡量掃描器性能的首要指標。在移動支付場景下,高性能
    的頭像 發(fā)表于 05-07 14:25 ?162次閱讀
    自助售貨機內(nèi)嵌<b class='flag-5'>掃描器</b>應該要如何選用?

    松下MPS媒體制作平臺第八篇:視頻混合插件(第三部分)

    ? 歡迎?????大家觀看松下操作教程 MPS媒體制作平臺????? 第八篇:視頻混合插件(第三部分) 視頻混合(Video Mixer)插件可以輕松進行主體鍵控,不受拍攝地點的局限,同時便于將
    的頭像 發(fā)表于 01-08 10:10 ?490次閱讀
    松下MPS媒體制作平臺第八篇:視頻混合<b class='flag-5'>器</b>插件(<b class='flag-5'>第三部分</b>)

    工業(yè)二維碼條碼掃描器流水線條碼掃描

    在工業(yè)生產(chǎn)的廣闊舞臺上,工業(yè)二維碼條碼掃描器以其卓越的耐用性和高效的掃描能力,成為了連接自動化生產(chǎn)與信息管理不可或缺的橋梁。它們不僅是工廠流水線上的“慧眼”,更是提升生產(chǎn)效率、保障產(chǎn)品質(zhì)量的得力助手
    的頭像 發(fā)表于 01-07 16:07 ?546次閱讀
    工業(yè)二維碼條碼<b class='flag-5'>掃描器</b>流水線條碼<b class='flag-5'>掃描</b>

    紅外、光感雙重觸發(fā)的條碼掃描器,用于生產(chǎn)線上

    隨著工業(yè)自動化的不斷發(fā)展,生產(chǎn)線上的效率與準確性成為了企業(yè)追求的目標。紅外、光感雙重觸發(fā)的條碼掃描器作為一種先進的自動識別技術(shù),正逐漸在生產(chǎn)線上發(fā)揮著重要作用。本文將詳細介紹這種條碼掃描器的工作原理
    的頭像 發(fā)表于 12-17 16:02 ?471次閱讀
    紅外、光感雙重觸發(fā)的條碼<b class='flag-5'>掃描器</b>,用于生產(chǎn)線上

    固定式掃描器哪款好?盤點高性價比型號推薦,打造高效掃碼體驗

    在現(xiàn)代企業(yè)中,固定式掃描器已成為一種不可或缺的工具。無論是在零售、物流、倉儲還是生產(chǎn)線,固定式掃描器都能有效提升工作效率與準確性。那么,市場上眾多型號中,哪款固定式掃描器更具性價比呢?本文將從
    的頭像 發(fā)表于 12-12 14:56 ?810次閱讀
    固定式<b class='flag-5'>掃描器</b>哪款好?盤點高性價比型號推薦,打造高效掃碼體驗

    工業(yè)固定式掃描器怎樣用?固定式工業(yè)條碼掃描器解決方案

    在現(xiàn)代制造業(yè)和物流領(lǐng)域,條碼掃描技術(shù)已經(jīng)成為提高效率、減少錯誤的重要工具。工業(yè)固定式掃描器作為其中一種高效的解決方案,能夠在生產(chǎn)線、倉儲和物流管理中發(fā)揮關(guān)鍵作用。本文將探討工業(yè)固定式條碼掃描器
    的頭像 發(fā)表于 12-05 15:29 ?669次閱讀
    工業(yè)固定式<b class='flag-5'>掃描器</b>怎樣用?固定式工業(yè)條碼<b class='flag-5'>掃描器</b>解決方案

    嵌入式條碼掃描器的幾種掃描模式

    嵌入式條碼掃描器掃描模式是指其在識別條碼時的工作模式,這些模式會影響到掃描器的使用效果和適用場景。以下是幾種常見的嵌入式條碼掃描器掃描
    的頭像 發(fā)表于 11-19 16:27 ?689次閱讀
    嵌入式條碼<b class='flag-5'>掃描器</b>的幾種<b class='flag-5'>掃描</b>模式

    如何設(shè)置條形碼掃描器模塊,掃碼常見技術(shù)問題的解決

    隨著現(xiàn)代商業(yè)和工業(yè)的快速發(fā)展,條形碼掃描器模塊已經(jīng)成為日常工作中不可或缺的一部分。然而,對于許多用戶來說,如何正確地設(shè)置這些設(shè)備仍然是一個挑戰(zhàn)。為了幫助大家解決這一問題,深圳遠景達(RAKINDA
    的頭像 發(fā)表于 11-11 15:38 ?1069次閱讀
    如何設(shè)置條形碼<b class='flag-5'>掃描器</b>模塊,掃碼<b class='flag-5'>器</b>常見技術(shù)問題的解決

    Air780EP硬件設(shè)計原理解析(第三部分

    ? 接下來,我們繼續(xù)學習第三部分。 四、射頻接口 天線接口管腳定義如下: 表格 14:RF_ANT 管腳定義 ? 4.1 射頻參考電路 ? 注意: 連接到模塊RF天線焊盤的RF走線必須使用微帶線或者
    的頭像 發(fā)表于 11-06 15:07 ?749次閱讀
    Air780EP硬件設(shè)計原理解析(<b class='flag-5'>第三部分</b>)

    實際的正弦波震蕩電路主要由哪三部分組成

    實際的正弦波振蕩電路主要由以下三部分組成,盡管有時在更詳細的描述中可能會提及四部分(包括穩(wěn)幅環(huán)節(jié)),但以下三部分是構(gòu)成正弦波振蕩電路的核心: 放大電路 : 放大電路是振蕩電路的核心部分
    的頭像 發(fā)表于 10-09 16:59 ?1279次閱讀

    數(shù)字芯片設(shè)計驗證經(jīng)驗分享(第三部分):將ASIC IP核移植到FPGA上——如何確保性能與時序以完成充滿挑戰(zhàn)的

    本篇文章是SmartDV數(shù)字芯片設(shè)計經(jīng)驗分享系列文章的第三篇,將繼續(xù)分享第五、第六主題,包括確保在FPGA上實現(xiàn)所需的性能和時鐘兩個方面的考量因素。
    的頭像 發(fā)表于 08-26 14:31 ?2500次閱讀
    數(shù)字芯片設(shè)計驗證經(jīng)驗分享(<b class='flag-5'>第三部分</b>):將ASIC IP核移植到FPGA上——如何確保性能與時序以完成充滿挑戰(zhàn)的

    學習hypervisor嵌入式產(chǎn)品安全設(shè)計

    、PRTOS的配套工具等內(nèi)容。第三部分(第13~15章)介紹嵌入式Hypervisor的高級應用和未來規(guī)劃,涵蓋μC/OS-II與Linux內(nèi)核的虛擬化過程,以及PRTOS社區(qū)的愿景等內(nèi)容。
    發(fā)表于 08-25 09:11