No ACL setup yet! Denying access to everyone.
en:edu:zmitac:s2:aih:lab:nrf52zephyrblebeacon

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:edu:zmitac:s2:aih:lab:nrf52zephyrblebeacon [2023/12/09 14:51] – ktokarzen:edu:zmitac:s2:aih:lab:nrf52zephyrblebeacon [2023/12/09 18:42] (current) – ktokarz
Line 3: Line 3:
 This example advertises the device as the "Test beacon" with details provided in Eddystone (([[https://en.wikipedia.org/wiki/Eddystone_(Google)]])) format.  This example advertises the device as the "Test beacon" with details provided in Eddystone (([[https://en.wikipedia.org/wiki/Eddystone_(Google)]])) format. 
  
-After importing it to the Visual Studio Code we should make some configuration: remove the unwanted build target from platformio.ini, and if we want to receive messages via serial port enable it within prj.conf. +After importing it to the Visual Studio Code we should make some configuration: remove the unwanted build target from platformio.ini, and if we want to receive messages via serial port enable it within prj.conf. Notice that to use BLE it is enabled by default in the example's prj.conf file. 
 +<code> 
 +CONFIG_BT=y 
 +CONFIG_BT_DEBUG_LOG=y 
 +CONFIG_BT_DEVICE_NAME="Test beacon" 
 +</code>
 This example starts the Bluetooth interface with the function bt_enable() that passes the pointer to the bt_ready() which is the callback function to notify that initialization has finished.  This example starts the Bluetooth interface with the function bt_enable() that passes the pointer to the bt_ready() which is the callback function to notify that initialization has finished. 
 <code> <code>
Line 16: Line 21:
 The argument "BT_LE_ADV_NCONN" specifies the advertising mode without the possibility of accepting connections from a client (observer). The argument "BT_LE_ADV_NCONN" specifies the advertising mode without the possibility of accepting connections from a client (observer).
  
-The "ad" structure holds the content of the advertising frame.+The "ad" structure holds the content of the advertising frame data.
 <code> <code>
 static const struct bt_data ad[] = { static const struct bt_data ad[] = {
Line 33: Line 38:
 It contains three elements of specific types. The complete list of types with their identifiers you can find in the official Bluetooth SiG website ((https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/core/ad_types.yaml)). It contains three elements of specific types. The complete list of types with their identifiers you can find in the official Bluetooth SiG website ((https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/core/ad_types.yaml)).
 <table bletypes> <table bletypes>
-<caption> List of elements of the advertising frame</caption> +<caption> List of elements of the advertising frame data</caption> 
-^ Type ID ^ Type name ^ Content ^+^ Type ID ^ Type name (as in BLE specification) ^ Content ^
 | 0x01 | Flags | specifies if BR/EDR is supported | | 0x01 | Flags | specifies if BR/EDR is supported |
-| 0x03 | List of 16-bit UUID of all services | Eddystone UUID | +| 0x03 | Complete List of 16-bit Service Class UUIDs | Eddystone UUID | 
-| 0x16 | service data with 16-bit UUID | UUID and content of Eddystone data |+| 0x16 | Service Data - 16-bit UUID | UUID and content of Eddystone data |
 </table> </table>
  
-You can observe the details in the nRF Connect application on your mobile phone.+The "sd" argument is the structure that holds scan response data. This can be read by the observer with a scan request. It has the type of the name of the device and contains the text "Test beacon". 
 +<table blesdtypes> 
 +<caption> List of elements of the advertising frame scan response</caption> 
 +^ Type ID ^ Type name (as in BLE specification) ^ Content ^ 
 +| 0x09 | Complete Local Name | name of the device | 
 +</table>
  
-The "sd" argument is the structure that holds scan response data.+You can observe the details in the nRF Connect application on your mobile phone.
  
-The beacon example is very simple because the beacon device is intended to advertise only so, there is no further functionality implemented. This example shows the so-called Eddystone format (([[https://en.wikipedia.org/wiki/Eddystone_(Google)]])) of Bluetooth Beacons that send simple information to nearby devices. To reduce the number of bytes sent in the advertisement frame the Eddystone format defines the list of prefixes and suffixes that can be used in the URL ((https://github.com/google/eddystone/tree/master/eddystone-url)).+The beacon example is very simple because the beacon device is intended to advertise only, so there is no further functionality implemented. This example shows the so-called Eddystone format (([[https://en.wikipedia.org/wiki/Eddystone_(Google)]])) of Bluetooth Beacons that send simple information to nearby devices. To reduce the number of bytes sent in the advertisement frame the Eddystone format defines the list of prefixes and suffixes that can be used in the URL encoded as values of non-printable characters((https://github.com/google/eddystone/tree/master/eddystone-url)).
 For example, web prefixes can be encoded as in the table {{ref>eddyprefix}}. For example, web prefixes can be encoded as in the table {{ref>eddyprefix}}.
 <table eddyprefix> <table eddyprefix>
Line 73: Line 83:
 | 13       | 0x0d  | .gov    | | 13       | 0x0d  | .gov    |
 </table> </table>
 +===== Tasks to do during the laboratory =====
 +  - Import the Zephyr BLE Beacon example, compile it, and run.
 +  - Use the nRF Connect application (For Android mobile) and find the "Test beacon" device.
 +  - Modify the software obtaining different prefixes and suffixes for the beacon.
 +  - Modify the name of the device with "Polsl Beacon", and the advertised web address with %%"https://www.polsl.pl"%%
 +
en/edu/zmitac/s2/aih/lab/nrf52zephyrblebeacon.1702129899.txt.gz · Last modified: by ktokarz