diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/README.md b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/README.md
new file mode 100644
index 0000000..70d0cfc
--- /dev/null
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/README.md
@@ -0,0 +1,198 @@
+# Periodic Advertisement (sync transfer) Example
+
+## Description
+
+This example demonstrates the periodic advertising feature of Bluetooth 5, detailed in the [Periodic Advertising](https://docs.silabs.com/bluetooth/latest/bluetooth-fundamentals-advertising-scanning/periodic-advertising) article.
+
+This example does depend on a bluetooth connection for supplying the synchronization information through the [perodic advertising sync Transfer procedure](https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-62/out/en/host/generic-access-profile.html#UUID-32456dd3-dcdd-cf92-fd85-a29ad43f51a1)
+
+
+This example consists of two projects, one for the advertiser and one for the scanner.
+
+### Advertiser
+
+According to Bluetooth core specification message sequence charts, an advertiser may execute the periodic advertising sync transfer procedure as follows:
+
+
+
+
+
+As shown in the chart there is a need to start an extended advertisement because:
+- Periodic advertisement mandates the start of extended advertisement [even for brief period](https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-62/out/en/low-energy-controller/link-layer-specification.html#UUID-11541cae-d7a8-d7e3-d05f-85c32728443a).
+- (optionally in this case) Advertise a payload that enables the identification of the device and subsequentlly a connection through which the periodic advertising sync transfer procedure (PAST) can be executed.
+- *Note: the advertiser and scanenr roles used for establshing the connection and transmitting the PAST information are independent from the roles of the PAWR advertiser and synchronizer. (i.e. the PAWR advertiser can be either an advertiser or a scanner in the procedure leading up to the establishing the connection and provisionning of the sync information step)*
+
+In this specific implementation a [periodicSync](config/gatt_configuration.btconf#L52) GATT service UUID is being used by the scanner to identify the advertiser.
+
+The following are the APIs used to satisfy the steps mandated in the message sequence chart:
+
+1. Pre-requisite: create an advertising set:
+```C
+ sl_status_t sl_bt_advertiser_create_set(uint8_t *handle);
+```
+2. Set the extended advertising parameters and payload:
+```C
+ sl_status_t sl_bt_advertiser_set_timing(uint8_t advertising_set,
+ uint32_t interval_min,
+ uint32_t interval_max,
+ uint16_t duration,
+ uint8_t maxevents);
+
+sl_status_t sl_bt_extended_advertiser_generate_data(uint8_t advertising_set,
+ uint8_t discover);
+```
+3. Start the extended advertisement
+```C
+sl_status_t sl_bt_extended_advertiser_start(uint8_t advertising_set,
+ uint8_t connect,
+ uint32_t flags);
+
+```
+
+4. Set the periodic advertising parameters,payload as well as starting the periodic advertisement train:
+```C
+sl_status_t sl_bt_periodic_advertiser_set_data(uint8_t advertising_set,
+ size_t data_len,
+ const uint8_t* data);
+
+sl_status_t sl_bt_periodic_advertiser_start(uint8_t advertising_set,
+ uint16_t interval_min,
+ uint16_t interval_max,
+ uint32_t flags);
+```
+
+Once a connection is established the advertiser waits for
+[sl_bt_evt_connection_remote_used_features_id](src/advertiser/app.c#185) event to occur so it can verify that the connected device supports the reception of a PAST. Then sends the synchronization information through the following API
+
+```C
+sl_status_t sl_bt_advertiser_past_transfer(uint8_t connection,
+ uint16_t service_data,
+ uint8_t advertising_set);
+```
+
+A [sleeptimer](src/advertiser/app.c#L159) is used to update to advertising data regularly by generating a [signal](src/advertiser/app.c#L25) that gets processed by the ble using a [special event](src/advertiser//app.c#L212)
+
+
+### Scanner
+
+According to Bluetooth core specification, a device may execute the Periodic advertising synchronization procedure through 2 methods, One of which is the periodic advertising Sync Transfer (PAST)
+
+In this specific implementation the scanner does the following:
+ 1. identifies the advertiser by a [periodicSync](src/scanner/app.c#L25) service.
+ 2. Open a connection and wait for Sync transfer
+ 3. Synchronize to the PAWR and reports the advertisement payloads.
+
+
+The following are the API used to execute these steps:
+
+1. Set extended scan parameters
+```C
+sl_status_t sl_bt_scanner_set_parameters(uint8_t mode,
+ uint16_t interval,
+ uint16_t window);
+```
+2. Start Scanning
+```C
+sl_status_t sl_bt_scanner_start(uint8_t scanning_phy, uint8_t discover_mode);
+```
+3. Extended advertisement report [event](src/scanner/app.c#L122) and connection creation based on the identification function.
+```C
+sl_status_t sl_bt_connection_open(bd_addr address,
+ uint8_t address_type,
+ uint8_t initiating_phy,
+ uint8_t *connection);
+```
+4. PAST reception [event](src/scanner/app.c#L152) indicating sync failure or establishement
+
+5. Periodic advertisement report [event](src/scanner/app.c#L173)
+
+
+## Simplicity SDK version ##
+
+- SiSDK v2025.6
+
+## Hardware Required ##
+
+- 2 x WSTK board: BR4001A
+- 2 x Bluetooth radio board, e.g: BRD4162A
+
+## Setting up
+
+*Note: Provided examples are fully configured and ready for use, the following is relevant if you build them from scratch*
+
+# Advertiser
+
+1. Create a new **SoC-Empty** project.
+
+2. Copy the attached [src/advertiser/app.c](src/advertiser/app.c) file replacing the existing `app.c` in the project.
+
+3. Open the .slcp file of your project, navigate to the software component tab and make sure the following components are installed:
+
+ - Log
+ - IO Stream: USART component with the default instance name: vcom
+ - Extended Advertising
+ - Periodic Advertising
+ - Transfer periodic synchronization information for a local advertising set
+
+4. Further software component configuration (image for illustation)
+
+ - Board Control:Enable Virtual COM UART
+ - Advertising Base Feature: Max number of advertising sets reserved for user (for multiple periodic advertisement or extra extended/legacy advertisement)
+ - Periodic Advertising: Max number of advertising sets that support periodic advertising
+
+
+
+5. Import the GATT configuration:
+ - Open the **Bluetooth GATT Configurator** under the **CONFIGURATION TOOLS** tab.
+ - Find the Import button and import the attached **gatt_configuration.btconf** file.
+
+
+
+6. **Save and close** then the tool will auto-generate to code.
+
+7. Build and flash the project to the **Advertiser** device.
+
+
+# Scanner
+
+1. Create a new **SoC-Empty** project.
+
+2. Copy the attached [src/scanner/app.c](src/scanner/app.c) file replacing the existing `app.c` in the project.
+
+3. Open the .slcp file of your project, navigate to the software component tab and make sure the following components are installed:
+
+ - Log
+ - IO Stream: USART component with the default instance name: vcom
+ - Scanner for extended advertisements
+ - Synchronization to Periodic advertising trains by receiving PAST
+
+4. Further software component configuration (image for illustation)
+
+ - Board Control:Enable Virtual COM UART
+ - Periodic Advertising Synchronization: Max number of periodic advertising synchronizations (for syncing to multiple trains)
+ - Periodic Advertising: Max number of advertising sets that support periodic advertising
+
+
+
+
+6. **Save and close** then the tool will auto-generate to code.
+
+7. Build and flash the project to the **Scanner** device.
+
+
+## Usage
+
+After flashing the applications to the devices, launch console for both **Advertiser** and **Scanner**, and reset both devices. On the logs, you should be able to observe that those devices are sending and receiving periodic advertisements after the connection and PAST operation had been executed successfully.
+Here we issue a manual reset on the advertiser side, consequencially the synchronizer timeout (reason 0x0007) and then proceeds to scan again and launch the connection and PAST procedure.
+
+
+
+The advertiser changes the content of the advertisement at regular intervals when the timer callback fires up, but in reality if the periodic advertisement interval is smaller than the timer timeout value then the advertiser controller will continue using the same data which is refleacted by the multiple reports on the scanner side with the identical payload.
+
+Use the energy profiler in Simplicity studio to evaluate the current consumption. Here you can observe:
+- The extended advertisement current peak every 100ms on the advertiser.
+- The periodic advertisement/synchronized scanning current peak every 500ms both on the advertiser and the scanner.
+- After a manual reset on the scanner, a connection is established and the PAST is performed.
+- Note: the normal scanning interval set to 125ms is not shown on this image.
+
+
diff --git a/advertising/periodic_advertisement/SimplicityStudio/readme.md b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/readme.md
similarity index 56%
rename from advertising/periodic_advertisement/SimplicityStudio/readme.md
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/readme.md
index 19da0e8..7b7e48a 100644
--- a/advertising/periodic_advertisement/SimplicityStudio/readme.md
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/readme.md
@@ -1,7 +1,5 @@
# Periodic Advertisement Example
-The readme file of this project can be found [here](https://github.com/SiliconLabs/bluetooth_stack_features/blob/master/advertising/periodic_advertisement/README.md).
+The readme file of this project can be found [here](https://github.com/SiliconLabsSoftware/bluetooth_stack_features/blob/master/advertising/periodic_advertisement/connectionless_synchronization/README.md).
.
> Note: In this project all the necessary software components are installed, source files are copied, and configurations are set, hence you can disregard the Setting Up section of the online readme file. Nevertheless, if you want to add the demonstrated feature to your own project, it might be good to know what software components you must install, and what configurations you must set beforehand, hence reading through the Setting Up section might be useful.
-
-> Note: This project requires a bootloader. For Series 1 (EFR32xG1x) devices please flash a **Bluetooth In-place OTA DFU** bootloader or an **Internal Storage** bootloader to your device to get this application to work. For Series 2 (EFR32xG2x) devices please flash a **Bluetooth Apploader OTA DFU** bootloader to your device
diff --git a/advertising/periodic_advertisement/SimplicityStudio/soc_periodic_advertisement_advertiser.slcp b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/soc_periodic_advertisement_sync_transfer_advertiser.slcp
similarity index 81%
rename from advertising/periodic_advertisement/SimplicityStudio/soc_periodic_advertisement_advertiser.slcp
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/soc_periodic_advertisement_sync_transfer_advertiser.slcp
index e077d36..8866e1a 100644
--- a/advertising/periodic_advertisement/SimplicityStudio/soc_periodic_advertisement_advertiser.slcp
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/soc_periodic_advertisement_sync_transfer_advertiser.slcp
@@ -1,8 +1,8 @@
-project_name: soc_periodic_advertisement_advertiser
+project_name: soc_periodic_advertisement_PAST_advertiser
package: Bluetooth
-label: Bluetooth - SoC Periodic Advertisement Advertiser
+label: Bluetooth - SoC Periodic Advertisement sync transfer (PAST) Advertiser
description: >
- This example demonstrates the periodic advertising feature of Bluetooth 5 in the advertiser side.
+ This example demonstrates the periodic advertising (without response) feature using Periodic advertisement sync transfer (PAST) for synchronization(Advertiser).
category: Bluetooth Examples
quality: development
@@ -14,10 +14,7 @@ component:
- id: bluetooth_feature_connection_role_peripheral
- id: bluetooth_feature_gatt
- id: bluetooth_feature_gatt_server
- - id: bluetooth_feature_sm
- id: bluetooth_feature_system
- - id: in_place_ota_dfu
- - id: bootloader_interface
- id: rail_util_pti
- id: app_assert
- id: component_catalog
diff --git a/advertising/periodic_advertisement/SimplicityStudio/soc_periodic_advertisement_scanner.slcp b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/soc_periodic_advertisement_sync_transfer_scanner.slcp
similarity index 77%
rename from advertising/periodic_advertisement/SimplicityStudio/soc_periodic_advertisement_scanner.slcp
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/soc_periodic_advertisement_sync_transfer_scanner.slcp
index 7186445..975d035 100644
--- a/advertising/periodic_advertisement/SimplicityStudio/soc_periodic_advertisement_scanner.slcp
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/SimplicityStudio/soc_periodic_advertisement_sync_transfer_scanner.slcp
@@ -1,23 +1,18 @@
-project_name: soc_periodic_advertisement_scanner
+project_name: soc_periodic_advertisement_PAST_scanner
package: Bluetooth
-label: Bluetooth - SoC Periodic Advertisement Scanner
+label: Bluetooth - SoC Periodic Advertisement sync transfer (PAST) Scanner
description: >
- This example demonstrates the periodic advertising feature of Bluetooth 5 in the scanner side.
+ Fhis example demonstrates the periodic advertising (without response) feature using Periodic advertisement sync transfer (PAST) for synchronizationt(scanner).
category: Bluetooth Examples
quality: development
component:
- id: bluetooth_stack
- - id: gatt_configuration
- id: bluetooth_feature_connection
- id: bluetooth_feature_connection_role_central
- id: bluetooth_feature_gatt
- - id: bluetooth_feature_gatt_server
- id: bluetooth_feature_scanner
- - id: bluetooth_feature_sm
- id: bluetooth_feature_system
- - id: in_place_ota_dfu
- - id: bootloader_interface
- id: rail_util_pti
- id: app_assert
- id: component_catalog
diff --git a/advertising/periodic_advertisement/config/gatt_configuration.btconf b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/config/gatt_configuration.btconf
similarity index 91%
rename from advertising/periodic_advertisement/config/gatt_configuration.btconf
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/config/gatt_configuration.btconf
index 20ca6de..b144e6b 100644
--- a/advertising/periodic_advertisement/config/gatt_configuration.btconf
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/config/gatt_configuration.btconf
@@ -1,21 +1,20 @@
-
+
Abstract: The generic_access service contains generic information about the device. All available Characteristics are readonly.
-
+
-
Periodic Advertisement
-
+
Abstract: The external appearance of this device. The values are composed of a category (10-bits) and sub-categories (6-bits).
@@ -25,11 +24,11 @@
-
+
Abstract: The Device Information Service exposes manufacturer and/or vendor information about a device. Summary: This service exposes manufacturer information about a device. The Device Information Service is instantiated as a Primary Service. Only one instance of the Device Information Service is exposed on a device.
-
+
Abstract: The value of this characteristic is a UTF-8 string representing the name of the manufacturer of the device.
@@ -38,7 +37,7 @@
-
+
Abstract: The SYSTEM ID characteristic consists of a structure with two fields. The first field are the LSOs and the second field contains the MSOs. This is a 64-bit structure which consists of a 40-bit manufacturer-defined identifier concatenated with a 24 bit unique Organizationally Unique Identifier (OUI). The OUI is issued by the IEEE Registration Authority (http://standards.ieee.org/regauth/index.html) and is required to be used in accordance with IEEE Standard 802-2001.6 while the least significant 40 bits are manufacturer defined. If System ID generated based on a Bluetooth Device Address, it is required to be done as follows. System ID and the Bluetooth Device Address have a very similar structure: a Bluetooth Device Address is 48 bits in length and consists of a 24 bit Company Assigned Identifier (manufacturer defined identifier) concatenated with a 24 bit Company Identifier (OUI). In order to encapsulate a Bluetooth Device Address as System ID, the Company Identifier is concatenated with 0xFFFE followed by the Company Assigned Identifier of the Bluetooth Address. For more guidelines related to EUI-64, refer to http://standards.ieee.org/develop/regauth/tut/eui64.pdf. Examples: If the system ID is based of a Bluetooth Device Address with a Company Identifier (OUI) is 0x123456 and the Company Assigned Identifier is 0x9ABCDE, then the System Identifier is required to be 0x123456FFFE9ABCDE.
@@ -48,18 +47,7 @@
-
+
-
-
-
-
-
-
- 00
-
-
-
-
-
+
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/Energy_profiler_view.png b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/Energy_profiler_view.png
new file mode 100644
index 0000000..bc90292
Binary files /dev/null and b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/Energy_profiler_view.png differ
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/Software_component_config_illustration.png b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/Software_component_config_illustration.png
new file mode 100644
index 0000000..103cc7b
Binary files /dev/null and b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/Software_component_config_illustration.png differ
diff --git a/advertising/periodic_advertisement/images/btconf.png b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/btconf.png
similarity index 100%
rename from advertising/periodic_advertisement/images/btconf.png
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/btconf.png
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/message_sequence_chart_advertiser.png b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/message_sequence_chart_advertiser.png
new file mode 100644
index 0000000..4caa5be
Binary files /dev/null and b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/message_sequence_chart_advertiser.png differ
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/message_sequence_chart_synchronization.png b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/message_sequence_chart_synchronization.png
new file mode 100644
index 0000000..79f67ce
Binary files /dev/null and b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/message_sequence_chart_synchronization.png differ
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/terminal_view.png b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/terminal_view.png
new file mode 100644
index 0000000..3b6e0bb
Binary files /dev/null and b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/images/terminal_view.png differ
diff --git a/advertising/periodic_advertisement/inc/advertiser/app.h b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/inc/advertiser/app.h
similarity index 100%
rename from advertising/periodic_advertisement/inc/advertiser/app.h
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/inc/advertiser/app.h
diff --git a/advertising/periodic_advertisement/inc/scanner/app.h b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/inc/scanner/app.h
similarity index 100%
rename from advertising/periodic_advertisement/inc/scanner/app.h
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/inc/scanner/app.h
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/advertiser/app.c b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/advertiser/app.c
new file mode 100644
index 0000000..a76b7d6
--- /dev/null
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/advertiser/app.c
@@ -0,0 +1,243 @@
+/***************************************************************************//**
+ * @file
+ * @brief Core application logic.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+#include "em_common.h"
+#include "app_assert.h"
+#include "sl_bluetooth.h"
+#include "gatt_db.h"
+#include "app.h"
+#include "sl_bt_api.h"
+#include "app_log.h"
+
+#define SIGNAL_REFRESH_DATA 1 //bitmask used to report external signal to the ble stack
+#define TICKS_TIMEOUT 32768 // Timer periodic timeout, in timer ticks
+#define TX_POWER 30 //effective value TX_POWER/10
+
+//Periodic Advertising Sync Transfer - Recipient bit order in featureset as per Vol 6, Part B 4.6
+#define PAST_RECEIVE_FEATURE_BIT 25
+#define FEATURE_AVAILABLE(feature_set, feature_bit) (((feature_set)[(feature_bit) / 8] >> ((feature_bit) % 8)) & 0X1)
+
+// The sync provisioning advertisement handle (used to start connection)
+static uint8_t provisioning_set_handle = 0xff;
+// the periodic advertisement set handle
+static uint8_t periodic_set_handle = 0xff;
+
+// Periodic advertisement data
+static uint8_t periodic_adv_data[8] = { 0x07, 0xFF, 0x02, 0xFF, 0x00, 0x00, 0x00, 0x00 };
+//Sleeptimer used to update periodic data
+static sl_sleeptimer_timer_handle_t sleep_timer_handle;
+void sleeptimer_callback(sl_sleeptimer_timer_handle_t *handle, void *data);
+
+/**************************************************************************//**
+ * Application Init.
+ *****************************************************************************/
+SL_WEAK void app_init(void)
+{
+ /////////////////////////////////////////////////////////////////////////////
+ // Put your additional application init code here! //
+ // This is called once during start-up. //
+ /////////////////////////////////////////////////////////////////////////////
+}
+
+/**************************************************************************//**
+ * Application Process Action.
+ *****************************************************************************/
+SL_WEAK void app_process_action(void)
+{
+ /////////////////////////////////////////////////////////////////////////////
+ // Put your additional application code here! //
+ // This is called infinitely. //
+ // Do not call blocking functions from here! //
+ /////////////////////////////////////////////////////////////////////////////
+}
+
+/**************************************************************************//**
+ * Bluetooth stack event handler.
+ * This overrides the dummy weak implementation.
+ *
+ * @param[in] evt Event coming from the Bluetooth stack.
+ *****************************************************************************/
+void sl_bt_on_event(sl_bt_msg_t *evt)
+{
+ sl_status_t sc;
+ static uint8_t connection_handle;
+
+ switch (SL_BT_MSG_ID(evt->header)) {
+ // -------------------------------
+ // This event indicates the device has started and the radio is ready.
+ // Do not call any stack command before receiving this boot event!
+ case sl_bt_evt_system_boot_id: {
+ bd_addr address;
+ uint8_t address_type;
+ uint8_t system_id[8];
+ int16_t result;
+ // Extract unique ID from BT Address.
+ sc = sl_bt_system_get_identity_address(&address, &address_type);
+ app_assert_status(sc);
+
+ app_log_info("Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
+ address_type ? "static random" : "public device",
+ address.addr[5],
+ address.addr[4],
+ address.addr[3],
+ address.addr[2],
+ address.addr[1],
+ address.addr[0]);
+ // Pad and reverse unique ID to get System ID, write it to the corresponding GATT characteristic
+ system_id[0] = address.addr[5];
+ system_id[1] = address.addr[4];
+ system_id[2] = address.addr[3];
+ system_id[3] = 0xFF;
+ system_id[4] = 0xFE;
+ system_id[5] = address.addr[2];
+ system_id[6] = address.addr[1];
+ system_id[7] = address.addr[0];
+ sc = sl_bt_gatt_server_write_attribute_value(gattdb_system_id,
+ 0,
+ sizeof(system_id),
+ system_id);
+ app_assert_status(sc);
+
+ // Create an advertising set.
+ sc = sl_bt_advertiser_create_set(&provisioning_set_handle);
+ app_assert_status(sc);
+
+ // Set TX power
+ sc = sl_bt_advertiser_set_tx_power(provisioning_set_handle, TX_POWER, &result);
+ app_assert_status(sc);
+ app_log_info("Tx power of advertising set to %d.%d dBm\r\n", result / 10, result % 10);
+
+ // Set advertising interval to 100ms.
+ sc = sl_bt_advertiser_set_timing(provisioning_set_handle,
+ 160, // min. adv. interval. Value in units of 0.625 ms
+ 160, // max. adv. interval. Value in units of 0.625 ms
+ 0, // adv. duration
+ 0); // max. num. adv. events
+ app_assert_status(sc);
+
+ // Start general extended advertising
+ sc = sl_bt_extended_advertiser_generate_data(provisioning_set_handle,
+ sl_bt_advertiser_general_discoverable);
+ app_assert_status(sc);
+
+ sc = sl_bt_extended_advertiser_start(provisioning_set_handle,
+ sl_bt_extended_advertiser_connectable,
+ SL_BT_EXTENDED_ADVERTISER_INCLUDE_TX_POWER);
+
+ app_assert_status(sc);
+
+ // Start periodic advertisement
+ sc = sl_bt_advertiser_create_set(&periodic_set_handle);
+ app_assert_status(sc);
+
+ // Start periodic advertising with periodic interval 500ms
+ sc = sl_bt_periodic_advertiser_start(periodic_set_handle,
+ 400,
+ 400,
+ 0);
+ app_assert_status(sc);
+
+ sc = sl_bt_periodic_advertiser_set_data(periodic_set_handle, sizeof(periodic_adv_data), periodic_adv_data);
+ app_assert_status(sc);
+
+ // Start a timer to change advertising data every 1s
+ sc = sl_sleeptimer_start_periodic_timer(&sleep_timer_handle, TICKS_TIMEOUT, sleeptimer_callback, (void*)NULL, 0, 0);
+ app_assert_status(sc);
+ break;
+ }
+
+ // -------------------------------
+ // This event indicates that a new connection was opened.
+ case sl_bt_evt_connection_opened_id: {
+ bd_addr peer_add = evt->data.evt_connection_opened.address;
+ connection_handle = evt->data.evt_connection_opened.connection;
+ sl_sleeptimer_stop_timer(&sleep_timer_handle);
+ app_assert_status(sc);
+ app_log_info("connection open with peer device %02X:%02X:%02X:%02X:%02X:%02X, connection handle: %02X\r\n",
+ peer_add.addr[5],
+ peer_add.addr[4],
+ peer_add.addr[3],
+ peer_add.addr[2],
+ peer_add.addr[1],
+ peer_add.addr[0],
+ connection_handle);
+ break;
+ }
+
+ // -------------------------------
+ // This event indicates that the remote peer features has been discovered.
+ case sl_bt_evt_connection_remote_used_features_id:
+ app_log_info("remote user features event\r\n");
+ // Verify that the peer device support periodic advertising sync transfer receive
+ if (FEATURE_AVAILABLE(evt->data.evt_connection_remote_used_features.features.data, PAST_RECEIVE_FEATURE_BIT)) {
+ app_log_info("Peer device supports PAST reception, sending sync information\r\n");
+ sc = sl_bt_advertiser_past_transfer(connection_handle, 0, periodic_set_handle);
+ app_assert_status(sc);
+ }
+ break;
+
+ // -------------------------------
+ // This event indicates that a new connection was closed.
+ case sl_bt_evt_connection_closed_id:
+ app_log_info("connection with handle %02X closed\r\n", connection_handle);
+ sc = sl_bt_extended_advertiser_start(provisioning_set_handle,
+ sl_bt_extended_advertiser_connectable,
+ SL_BT_EXTENDED_ADVERTISER_INCLUDE_TX_POWER);
+
+ app_assert_status(sc);
+ sc = sl_sleeptimer_start_periodic_timer(&sleep_timer_handle, TICKS_TIMEOUT, sleeptimer_callback, (void*)NULL, 0, 0);
+ app_assert_status(sc);
+
+ break;
+
+ // -------------------------------
+ // This event indicates that an external has been generated
+ case sl_bt_evt_system_external_signal_id:
+ if (evt->data.evt_system_external_signal.extsignals == SIGNAL_REFRESH_DATA) {
+ // please note that the device continue advertising the old payload up until this section of the code is executed
+ app_log_info("Periodic advertisement new payload: ");
+ for (uint8_t i = 4; i < 8; i++) {
+ periodic_adv_data[i] = rand() % 9;
+ }
+ for (uint8_t i = 0; i < 8; i++) {
+ app_log("%02X,", periodic_adv_data[i]);
+ }
+ app_log("\r\n");
+ sc = sl_bt_periodic_advertiser_set_data(periodic_set_handle, sizeof(periodic_adv_data), periodic_adv_data);
+ app_assert_status(sc);
+ }
+ break;
+ ///////////////////////////////////////////////////////////////////////////
+ // Add additional event handlers here as your application requires! //
+ ///////////////////////////////////////////////////////////////////////////
+ }
+}
+
+/***************************************************************************//**
+ * Sleeptimer callback
+ *
+ * Note: This function is called from interrupt context
+ *
+ * @param[in] handle Handle of the sleeptimer instance
+ * @param[in] data Callback data
+ ******************************************************************************/
+void sleeptimer_callback(sl_sleeptimer_timer_handle_t *handle, void *data)
+{
+ (void)handle;
+ (void)data;
+
+ sl_bt_external_signal(SIGNAL_REFRESH_DATA);
+}
diff --git a/advertising/periodic_advertisement/src/advertiser/main.c b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/advertiser/main.c
similarity index 100%
rename from advertising/periodic_advertisement/src/advertiser/main.c
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/advertiser/main.c
diff --git a/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/scanner/app.c b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/scanner/app.c
new file mode 100644
index 0000000..13416f8
--- /dev/null
+++ b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/scanner/app.c
@@ -0,0 +1,182 @@
+/***************************************************************************//**
+ * @file scanner
+ * @brief Core application logic.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+#include "em_common.h"
+#include "app_assert.h"
+#include "sl_bluetooth.h"
+#include "app.h"
+#include "sl_bt_api.h"
+#include "app_log.h"
+
+#define SYNC_TIMEOUT 1000 // effective value SYNC_TIMEOUT*10 ms
+
+// UUID of periodic synchronous service used to identify the advertisement of the target device
+const uint8_t periodicSyncService[16] = { 0x81, 0xc2, 0x00, 0x2d, 0x31, 0xf4, 0xb0, 0xbf, 0x2b, 0x42, 0x49, 0x68, 0xc7, 0x25, 0x71, 0x41 };
+
+// Parse advertisements looking for advertised periodicSync Service.
+static uint8_t findServiceInAdvertisement(uint8_t *data, uint8_t len)
+{
+ uint8_t adFieldLength;
+ uint8_t adFieldType;
+ uint8_t i = 0;
+ // Parse advertisement packet
+ while (i < len) {
+ adFieldLength = data[i];
+ adFieldType = data[i + 1];
+ // found incomplete/complete list of 128-bit Service UUIDs as defined in the assgigned numbers SIG document.
+ if (adFieldType == 0x06 || adFieldType == 0x07) {
+ // compare UUID to periodic synchronous service UUID
+ if (memcmp(&data[i + 2], periodicSyncService, 16) == 0) {
+ return 1;
+ }
+ }
+ // advance to the next AD struct
+ i = i + adFieldLength + 1;
+ }
+ return 0;
+}
+
+/**************************************************************************//**
+ * Application Init.
+ *****************************************************************************/
+SL_WEAK void app_init(void)
+{
+ /////////////////////////////////////////////////////////////////////////////
+ // Put your additional application init code here! //
+ // This is called once during start-up. //
+ /////////////////////////////////////////////////////////////////////////////
+}
+
+/**************************************************************************//**
+ * Application Process Action.
+ *****************************************************************************/
+SL_WEAK void app_process_action(void)
+{
+ /////////////////////////////////////////////////////////////////////////////
+ // Put your additional application code here! //
+ // This is called infinitely. //
+ // Do not call blocking functions from here! //
+ /////////////////////////////////////////////////////////////////////////////
+}
+
+/**************************************************************************//**
+ * Bluetooth stack event handler.
+ * This overrides the dummy weak implementation.
+ *
+ * @param[in] evt Event coming from the Bluetooth stack.
+ *****************************************************************************/
+void sl_bt_on_event(sl_bt_msg_t *evt)
+{
+ sl_status_t sc;
+ static uint8_t connection_handle;
+
+ switch (SL_BT_MSG_ID(evt->header)) {
+ // -------------------------------
+ // This event indicates the device has started and the radio is ready.
+ // Do not call any stack command before receiving this boot event!
+ case sl_bt_evt_system_boot_id: {
+ bd_addr address;
+ uint8_t address_type;
+ // Extract unique ID from BT Address.
+ sc = sl_bt_system_get_identity_address(&address, &address_type);
+ app_assert_status(sc);
+
+ app_log_info("Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
+ address_type ? "static random" : "public device",
+ address.addr[5],
+ address.addr[4],
+ address.addr[3],
+ address.addr[2],
+ address.addr[1],
+ address.addr[0]);
+
+ sc = sl_bt_past_receiver_set_default_sync_receive_parameters(sl_bt_past_receiver_mode_synchronize, 0, SYNC_TIMEOUT, sl_bt_sync_report_all);
+ app_assert_status(sc);
+
+ // Scan in intervals of 125ms for 125ms time window
+ sc = sl_bt_scanner_set_parameters(sl_bt_scanner_scan_mode_passive, 200, 200);
+ app_assert_status(sc);
+
+ sc = sl_bt_scanner_start(sl_bt_scanner_scan_phy_1m,
+ sl_bt_scanner_discover_observation);
+ app_assert_status(sc);
+ break;
+ }
+
+ // -------------------------------
+ // This event indicates the device has received extended advertisements PDU
+ case sl_bt_evt_scanner_extended_advertisement_report_id:
+ if (findServiceInAdvertisement(&(evt->data.evt_scanner_extended_advertisement_report.data.data[0]), evt->data.evt_scanner_extended_advertisement_report.data.len) != 0) {
+ app_log_info("found periodic sync service, attempting to open connection\r\n");
+ sc = sl_bt_connection_open(evt->data.evt_scanner_extended_advertisement_report.address, evt->data.evt_scanner_extended_advertisement_report.address_type, sl_bt_gap_phy_1m, &connection_handle);
+ app_assert_status(sc);
+ /* now that connection is open, we can stop scanning*/
+ sc = sl_bt_scanner_stop();
+ app_assert_status(sc);
+ }
+ break;
+
+ // -------------------------------
+ // This event indicates the a connection was opened
+ case sl_bt_evt_connection_opened_id: {
+ bd_addr peer_add = evt->data.evt_connection_opened.address;
+ app_log_info("connection open with peer device %02X:%02X:%02X:%02X:%02X:%02X\r\n",
+ peer_add.addr[5], peer_add.addr[4], peer_add.addr[3],
+ peer_add.addr[2], peer_add.addr[1], peer_add.addr[0]);
+ break;
+ }
+
+ // -------------------------------
+ // This event indicates that a new connection was closed.
+ case sl_bt_evt_connection_closed_id:
+ app_log_info("connection with handle %02X closed\r\n", connection_handle);
+ break;
+
+ // -------------------------------
+ // This event indicates the device has synchronized successfully to the perodic advertisement after receiving PAST
+ case sl_bt_evt_periodic_sync_transfer_received_id:
+ app_log_info("syncing to periodic advertisement result: %02X\r\n", evt->data.evt_periodic_sync_transfer_received.status);
+ sc = sl_bt_connection_close(evt->data.evt_periodic_sync_transfer_received.connection);
+ app_assert_status(sc);
+ break;
+
+ // -------------------------------
+ // This event indicates the synchornizatiion has been terminated
+ case sl_bt_evt_sync_closed_id:
+ app_log_info("periodic sync closed. reason 0x%04X, sync handle 0x%04X\r\n",
+ evt->data.evt_sync_closed.reason,
+ evt->data.evt_sync_closed.sync);
+ /* restart discovery */
+ sl_bt_scanner_start(sl_bt_scanner_scan_phy_1m,
+ sl_bt_scanner_discover_observation);
+ app_assert_status(sc);
+ break;
+
+ // -------------------------------
+ // This event indicates the device has received a periodic advertisements PDU
+ case sl_bt_evt_periodic_sync_report_id:
+ app_log_info("Periodic advertisemenet payload: ");
+ for (int i = 0; i < evt->data.evt_periodic_sync_report.data.len; i++) {
+ app_log("%02X,", evt->data.evt_periodic_sync_report.data.data[i]);
+ }
+ app_log("\r\n");
+ break;
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Add additional event handlers here as your application requires! //
+ ///////////////////////////////////////////////////////////////////////////
+ }
+}
diff --git a/advertising/periodic_advertisement/src/scanner/main.c b/advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/scanner/main.c
similarity index 100%
rename from advertising/periodic_advertisement/src/scanner/main.c
rename to advertising/periodic_advertisement/Periodic_advertisement_sync_transfer/src/scanner/main.c
diff --git a/advertising/periodic_advertisement/README.md b/advertising/periodic_advertisement/README.md
deleted file mode 100644
index 683d8eb..0000000
--- a/advertising/periodic_advertisement/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# Periodic Advertisement Example
-
-## Description
-
-This example demonstrates the periodic advertising feature of Bluetooth 5, detailed in the [Periodic Advertising](https://docs.silabs.com/bluetooth/latest/bluetooth-fundamentals-advertising-scanning/periodic-advertising) article. The example consists of two projects, one for the advertiser and one for the scanner.
-
-The advertiser starts both periodic advertising and extended advertisement to advertise the sync info needed for the periodic advertising. The advertiser changes the content of the periodic advertisement every second.
-
-The scanner starts scanning for the extended advertisements to find the sync info, and then syncs on the periodic advertising. Once synced, the scanning is stopped and only periodic advertisements are received.
-
-To start periodic advertisement, the advertiser uses the function:
-
-```C
-sl_bt_periodic_advertiser_start(advertising_set_handle,
- 160, // periodic interval min
- 160, // periodic interval max
- 1); //Include TX power in advertising PDU
-```
-
-To set the periodic advertisement data, the advertiser use the function:
-
-```C
-sl_bt_periodic_advertiser_set_data(advertising_set_handle,
- sizeof(periodic_adv_data),
- periodic_adv_data);
-```
-
-The scanner will find the periodic advertiser by the UUID of the Synchronous service, then start syncing with the advertiser by using the function:
-
-```C
-sl_bt_sync_scanner_open(evt->data.evt_scanner_extended_advertisement_report.address,
- evt->data.evt_scanner_extended_advertisement_report.address_type,
- evt->data.evt_scanner_extended_advertisement_report.adv_sid,
- &sync);
-```
-
-There are two important things when setting up this example in **Bluetooth SDK version 8.2**:
-
-- The first is to set the value **Max number of periodic advertising synchronizations** in **Periodic Advertising Synchronization configure** on the **Scanner** according to the number of advertisers you want to sync on
-
-- The second is to install the **Periodic Advertising** component in the **Advertiser** and the **Synchronization to periodic advertising trains by scanning** component in the **Scanner**.
-
-See section [Setting up](#setting-up) to see how to initialize the periodic advertisement in Bluetooth SDK version 8.2.
-
-## Simplicity SDK version ##
-
-- SiSDK v2025.6
-
-## Hardware Required ##
-
-- 2 x WSTK board: BR4001A
-- 2 x Bluetooth radio board, e.g: BRD4162A
-
-## Setting up
-
-To try this example, you need two radio boards, one for the advertiser side and one for the scanner side.
-
-### Advertiser
-
-1. Create a new **SoC-Empty** project.
-
-2. Copy the attached [src/advertiser/app.c](src/advertiser/app.c) file replacing the existing `app.c`.
-
-3. Open the .slcp file of your project and open the Software Components tab
- - Install **Periodic Advertising** component
- 
-
- - Install **IO Stream: USART** component with the default instance name: **vcom**
- 
- 
-
- - Enable **Virtual COM UART** in the **Board Control** component
- 
- 
-
- - Install the **Extended Advertising** and **Periodic Advertising** components, if they are not yet installed
-
- - Install the **Log** component (found under Application > Utility group)
- 
-
-4. Import the GATT configuration:
- - Open the **Bluetooth GATT Configurator** under the **CONFIGURATION TOOLS** tab.
- - Find the Import button and import the attached **gatt_configuration.btconf** file.
- 
- - Save the GATT configuration (Ctrl+S).
-
-5. **Save and close** then the tool will auto-generate to code.
-
-6. Build and flash the project to the **Advertiser** device.
-
-### Scanner
-
-1. Create an **Bluetooth - SoC Empty** example for the radio boards in Simplicity Studio.
-
-2. Copy the attached [src/scanner/app.c](src/scanner/app.c) replacing the existing `app.c`.
-
-3. install the **Synchronization to periodic advertising trains by scanning**. Note: This will install needed dependencies such as **Periodic Advertising Synchronization** that will be configured in next step 
-
-3. Config **Software components**.
-
- * In **Periodic Advertising Synchronization** configuration, set **Max number of periodic advertising synchronizations**. This example syncs to one advertiser only, but it is possible to sync to multiple advertisers at the same time.
- 
- 
-
-4. **Save and close** then the tool will auto-generate to code.
-
-5. Build and flash the project to the **Scanner** device.
-
-## Usage
-
-After flashing the applications to the devices, launch console for both **Advertiser** and **Scanner**, and reset both devices. On the logs, you should be able to observe that those devices are sending and receiving periodic advertisements after the scanner synced on the advertiser.
-
-
-
-The advertiser changes the content of the advertisement every second, but the periodic advertising interval is set as 200ms so each data will be received 5 times. Which is shown in the console.
-
-
-
-Use the energy profiler in Simplicity studio to evaluate the current consumption. The scanner goes into energy saving mode and wakes up every 200 ms to receive sync packets from the advertiser. The advertiser sleeps when not advertising, as shown in the figure below.
-
-
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/README.md b/advertising/periodic_advertisement/connectionless_synchronization/README.md
new file mode 100644
index 0000000..596172e
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/README.md
@@ -0,0 +1,188 @@
+# Periodic Advertisement (connectionless synchronization) Example
+
+## Description
+
+This example demonstrates the periodic advertising feature of Bluetooth 5, detailed in the [Periodic Advertising](https://docs.silabs.com/bluetooth/latest/bluetooth-fundamentals-advertising-scanning/periodic-advertising) article.
+
+This example does not depend on a Bluetooth connection. It rather uses an extended advertisement to establish the synchronization to the periodic advertisement train.
+
+This example consists of two projects, one for the advertiser and one for the scanner.
+
+### Advertiser
+
+According to Bluetooth core specification message sequence charts, a device may execute the periodic advertisement procedure as follows:
+
+
+
+
+
+As shown in the chart there is a need to start an extended advertisement to:
+- Advertise the synchronization information enabling interested scanners to synchronize to the periodic advertisement train.
+- Advertise a payload that enables the identification of the advertising set associated with the periodic advertisement.
+
+In this specific implementation a [periodicSync](config/gatt_configuration.btconf#L52) GATT service UUID is being used by the scanner to identify the advertiser.
+
+The following are the APIs used to satisfy the steps mandated in the message sequence chart:
+
+1. Pre-requisite: create an advertising set:
+```C
+ sl_status_t sl_bt_advertiser_create_set(uint8_t *handle);
+```
+2. Set the extended advertising parameters and payload:
+```C
+ sl_status_t sl_bt_advertiser_set_timing(uint8_t advertising_set,
+ uint32_t interval_min,
+ uint32_t interval_max,
+ uint16_t duration,
+ uint8_t maxevents);
+
+sl_status_t sl_bt_extended_advertiser_generate_data(uint8_t advertising_set,
+ uint8_t discover);
+```
+3. Start the extended advertisement
+```C
+sl_status_t sl_bt_extended_advertiser_start(uint8_t advertising_set,
+ uint8_t connect,
+ uint32_t flags);
+
+```
+
+4. Set the periodic advertising parameters,payload as well as starting the periodic advertisement train:
+```C
+sl_status_t sl_bt_periodic_advertiser_set_data(uint8_t advertising_set,
+ size_t data_len,
+ const uint8_t* data);
+
+sl_status_t sl_bt_periodic_advertiser_start(uint8_t advertising_set,
+ uint16_t interval_min,
+ uint16_t interval_max,
+ uint32_t flags);
+```
+A [sleeptimer](src/advertiser/app.c#L145) is used to update to advertising data regularly by generating a [signal](src/advertiser/app.c#L25) that gets processed by the ble using a [special event](src/advertiser//app.c#L157)
+
+
+### Scanner
+
+According to Bluetooth core specification, a device may execute the Periodic advertising synchronization procedure through 2 methods, one of which consist of listening to and extracting from an extended advertisement the synchronization information to the periodic advertisement train, the following is the corresponding message sequence chart as defined by the bluetooth core specification:
+
+
+
+
+
+In this specific implementation the scanner is identfiying the advertiser by a [periodicSync](src/scanner/app.c#L25) service.
+
+The following are the APIs and events used to satisfy the steps mandated in the essage sequence chart:
+
+1. Set extended scan parameters
+```C
+sl_status_t sl_bt_scanner_set_parameters(uint8_t mode,
+ uint16_t interval,
+ uint16_t window);
+```
+2. Start Scanning
+```C
+sl_status_t sl_bt_scanner_start(uint8_t scanning_phy, uint8_t discover_mode);
+```
+3. Extended advertisement report [event](src/scanner/app.c#L117) and synchornization creation
+```C
+sl_status_t sl_bt_sync_scanner_open(bd_addr address,
+ uint8_t address_type,
+ uint8_t adv_sid,
+ uint16_t *sync);
+```
+4. Synchronization establishement [event](src/scanner/app.c#L132)
+
+5. Periodic advertisement report [event](src/scanner/app.c#L155)
+
+
+## Simplicity SDK version ##
+
+- SiSDK v2025.6
+
+## Hardware Required ##
+
+- 2 x WSTK board: BR4001A
+- 2 x Bluetooth radio board, e.g: BRD4162A
+
+## Setting up
+
+*Note: Provided examples are fully configured and ready for use, the following is relevant if you build them from scratch*
+
+# Advertiser
+
+1. Create a new **SoC-Empty** project.
+
+2. Copy the attached [src/advertiser/app.c](src/advertiser/app.c) file replacing the existing `app.c` in the project.
+
+3. Open the .slcp file of your project, navigate to the software component tab and make sure the following components are installed:
+
+ - Log
+ - IO Stream: USART component with the default instance name: vcom
+ - Extended Advertising
+ - Periodic Advertising
+
+4. Further software component configuration (image for illustation)
+
+ - Board Control:Enable Virtual COM UART
+ - Advertising Base Feature: Max number of advertising sets reserved for user (for multiple periodic advertisement or extra extended/legacy advertisement)
+ - Periodic Advertising: Max number of advertising sets that support periodic advertising
+
+
+
+5. Import the GATT configuration:
+ - Open the **Bluetooth GATT Configurator** under the **CONFIGURATION TOOLS** tab.
+ - Find the Import button and import the attached **gatt_configuration.btconf** file.
+
+
+
+6. **Save and close** then the tool will auto-generate to code.
+
+7. Build and flash the project to the **Advertiser** device.
+
+
+# Scanner
+
+1. Create a new **SoC-Empty** project.
+
+2. Copy the attached [src/scanner/app.c](src/scanner/app.c) file replacing the existing `app.c` in the project.
+
+3. Open the .slcp file of your project, navigate to the software component tab and make sure the following components are installed:
+
+ - Log
+ - IO Stream: USART component with the default instance name: vcom
+ - Scanner for extended advertisements
+ - Synchronization to periodic advertising trains by scanning
+
+4. Further software component configuration (image for illustation)
+
+ - Board Control:Enable Virtual COM UART
+ - Periodic Advertising Synchronization: Max number of periodic advertising synchronizations (for syncing to multiple trains)
+ - Periodic Advertising: Max number of advertising sets that support periodic advertising
+
+
+
+5. Import the GATT configuration:
+ - Open the **Bluetooth GATT Configurator** under the **CONFIGURATION TOOLS** tab.
+ - Find the Import button and import the attached **gatt_configuration.btconf** file.
+
+
+
+6. **Save and close** then the tool will auto-generate to code.
+
+7. Build and flash the project to the **Scanner** device.
+
+
+## Usage
+
+After flashing the applications to the devices, launch console for both **Advertiser** and **Scanner**, and reset both devices. On the logs, you should be able to observe that those devices are sending and receiving periodic advertisements after the scanner synced on the advertiser.
+
+
+
+The advertiser changes the content of the advertisement at regular intervals when the timer callback fires up, but in reality if the periodic advertisement interval is smaller than the timer timeout value then the advertiser controller will continue using the same data which is refleacted by the multiple reports on the scanner side with the identical payload.
+
+Use the energy profiler in Simplicity studio to evaluate the current consumption. Here you can observe:
+- The extended advertisement current peak every 100ms on the advertiser.
+- The periodic advertisement/synchronized scanning current peak every 500ms both on the advertiser and the scanner.
+- Note: the normal scanning interval set to 125ms is not shown on this image.
+
+
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/readme.md b/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/readme.md
new file mode 100644
index 0000000..7b7e48a
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/readme.md
@@ -0,0 +1,5 @@
+# Periodic Advertisement Example
+
+The readme file of this project can be found [here](https://github.com/SiliconLabsSoftware/bluetooth_stack_features/blob/master/advertising/periodic_advertisement/connectionless_synchronization/README.md).
+.
+> Note: In this project all the necessary software components are installed, source files are copied, and configurations are set, hence you can disregard the Setting Up section of the online readme file. Nevertheless, if you want to add the demonstrated feature to your own project, it might be good to know what software components you must install, and what configurations you must set beforehand, hence reading through the Setting Up section might be useful.
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/soc_periodic_advertisement_connectionless_synchronization_advertiser.slcp b/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/soc_periodic_advertisement_connectionless_synchronization_advertiser.slcp
new file mode 100644
index 0000000..2ac0505
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/soc_periodic_advertisement_connectionless_synchronization_advertiser.slcp
@@ -0,0 +1,68 @@
+project_name: soc_periodic_advertisement_connectionless_synchronization_advertiser
+package: Bluetooth
+label: Bluetooth - SoC Periodic Advertisement Connectionless Synchronization Advertiser
+description: >
+ This example demonstrates the periodic advertising (without response) feature using extended advertisemet for synchronization (advertiser).
+category: Bluetooth Examples
+quality: development
+
+component:
+ - id: bluetooth_stack
+ - id: gatt_configuration
+ - id: bluetooth_feature_legacy_advertiser
+ - id: bluetooth_feature_connection
+ - id: bluetooth_feature_connection_role_peripheral
+ - id: bluetooth_feature_gatt
+ - id: bluetooth_feature_gatt_server
+ - id: bluetooth_feature_system
+ - id: rail_util_pti
+ - id: app_assert
+ - id: component_catalog
+ - id: mpu
+ - id: bluetooth_feature_periodic_advertiser
+ - id: bluetooth_feature_extended_advertiser
+ - id: iostream_usart
+ instance:
+ - vcom
+ - id: iostream_retarget_stdio
+ - id: app_log
+ - id: board_control
+ - id: bt_post_build
+ - id: sl_system
+ - id: clock_manager
+ - id: device_init
+
+source:
+ - path: ../src/advertiser/app.c
+ - path: ../src/advertiser/main.c
+
+include:
+ - path: ../inc/advertiser/
+ file_list:
+ - path: app.h
+
+readme:
+ - path: ./readme.md
+
+config_file:
+ - override:
+ component: gatt_configuration
+ file_id: gatt_configuration_file_id
+ path: ../config/gatt_configuration.btconf
+ directory: btconf
+
+configuration:
+ - name: SL_STACK_SIZE
+ value: "2752"
+ - name: SL_HEAP_SIZE
+ value: "9200"
+ - name: SL_BOARD_ENABLE_VCOM
+ value: 1
+
+tag:
+ - hardware:rf:band:2400
+
+ui_hints:
+ highlight:
+ - path: readme.md
+ focus: true
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/soc_periodic_advertisement_connectionless_synchronization_scanner.slcp b/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/soc_periodic_advertisement_connectionless_synchronization_scanner.slcp
new file mode 100644
index 0000000..0360c5a
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/SimplicityStudio/soc_periodic_advertisement_connectionless_synchronization_scanner.slcp
@@ -0,0 +1,62 @@
+project_name: soc_periodic_advertisement_connectionless_synchronization_scanner
+package: Bluetooth
+label: Bluetooth - SoC Periodic Advertisement Connectionless Synchronization scanner
+description: >
+ This example demonstrates the periodic advertising (without response) feature using extended advertisemet for synchronization (synchronizer).
+category: Bluetooth Examples
+quality: development
+
+component:
+ - id: bluetooth_stack
+ - id: bluetooth_feature_connection
+ - id: bluetooth_feature_connection_role_central
+ - id: bluetooth_feature_gatt
+ - id: bluetooth_feature_scanner
+ - id: bluetooth_feature_system
+ - id: rail_util_pti
+ - id: app_assert
+ - id: component_catalog
+ - id: mpu
+ - id: bluetooth_feature_extended_scanner
+ - id: bluetooth_feature_sync
+ - id: bluetooth_feature_sync_scanner
+ - id: iostream_usart
+ instance:
+ - vcom
+ - id: iostream_retarget_stdio
+ - id: app_log
+ - id: board_control
+ - id: bt_post_build
+ - id: sl_system
+ - id: clock_manager
+ - id: device_init
+
+source:
+ - path: ../src/scanner/app.c
+ - path: ../src/scanner/main.c
+
+include:
+ - path: ../inc/scanner/
+ file_list:
+ - path: app.h
+
+readme:
+ - path: ./readme.md
+
+configuration:
+ - name: SL_STACK_SIZE
+ value: "2752"
+ - name: SL_HEAP_SIZE
+ value: "9200"
+ - name: SL_BT_CONFIG_MAX_PERIODIC_ADVERTISING_SYNC
+ value: "1"
+ - name: SL_BOARD_ENABLE_VCOM
+ value: 1
+
+tag:
+ - hardware:rf:band:2400
+
+ui_hints:
+ highlight:
+ - path: readme.md
+ focus: true
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/config/gatt_configuration.btconf b/advertising/periodic_advertisement/connectionless_synchronization/config/gatt_configuration.btconf
new file mode 100644
index 0000000..b144e6b
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/config/gatt_configuration.btconf
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ Abstract: The generic_access service contains generic information about the device. All available Characteristics are readonly.
+
+
+
+ Periodic Advertisement
+
+
+
+
+
+
+
+
+ Abstract: The external appearance of this device. The values are composed of a category (10-bits) and sub-categories (6-bits).
+ 0000
+
+
+
+
+
+
+
+
+ Abstract: The Device Information Service exposes manufacturer and/or vendor information about a device. Summary: This service exposes manufacturer information about a device. The Device Information Service is instantiated as a Primary Service. Only one instance of the Device Information Service is exposed on a device.
+
+
+
+ Abstract: The value of this characteristic is a UTF-8 string representing the name of the manufacturer of the device.
+ Silicon Labs
+
+
+
+
+
+
+
+ Abstract: The SYSTEM ID characteristic consists of a structure with two fields. The first field are the LSOs and the second field contains the MSOs. This is a 64-bit structure which consists of a 40-bit manufacturer-defined identifier concatenated with a 24 bit unique Organizationally Unique Identifier (OUI). The OUI is issued by the IEEE Registration Authority (http://standards.ieee.org/regauth/index.html) and is required to be used in accordance with IEEE Standard 802-2001.6 while the least significant 40 bits are manufacturer defined. If System ID generated based on a Bluetooth Device Address, it is required to be done as follows. System ID and the Bluetooth Device Address have a very similar structure: a Bluetooth Device Address is 48 bits in length and consists of a 24 bit Company Assigned Identifier (manufacturer defined identifier) concatenated with a 24 bit Company Identifier (OUI). In order to encapsulate a Bluetooth Device Address as System ID, the Company Identifier is concatenated with 0xFFFE followed by the Company Assigned Identifier of the Bluetooth Address. For more guidelines related to EUI-64, refer to http://standards.ieee.org/develop/regauth/tut/eui64.pdf. Examples: If the system ID is based of a Bluetooth Device Address with a Company Identifier (OUI) is 0x123456 and the Company Assigned Identifier is 0x9ABCDE, then the System Identifier is required to be 0x123456FFFE9ABCDE.
+
+
+
+
+
+
+
+
+
+
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/images/Energy_profiler_view.png b/advertising/periodic_advertisement/connectionless_synchronization/images/Energy_profiler_view.png
new file mode 100644
index 0000000..03b6858
Binary files /dev/null and b/advertising/periodic_advertisement/connectionless_synchronization/images/Energy_profiler_view.png differ
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/images/Software_component_config_illustration.png b/advertising/periodic_advertisement/connectionless_synchronization/images/Software_component_config_illustration.png
new file mode 100644
index 0000000..103cc7b
Binary files /dev/null and b/advertising/periodic_advertisement/connectionless_synchronization/images/Software_component_config_illustration.png differ
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/images/btconf.png b/advertising/periodic_advertisement/connectionless_synchronization/images/btconf.png
new file mode 100644
index 0000000..a6d3335
Binary files /dev/null and b/advertising/periodic_advertisement/connectionless_synchronization/images/btconf.png differ
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/images/message_sequence_chart_advertiser.png b/advertising/periodic_advertisement/connectionless_synchronization/images/message_sequence_chart_advertiser.png
new file mode 100644
index 0000000..7320b23
Binary files /dev/null and b/advertising/periodic_advertisement/connectionless_synchronization/images/message_sequence_chart_advertiser.png differ
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/images/message_sequence_chart_synchronization.png b/advertising/periodic_advertisement/connectionless_synchronization/images/message_sequence_chart_synchronization.png
new file mode 100644
index 0000000..79f67ce
Binary files /dev/null and b/advertising/periodic_advertisement/connectionless_synchronization/images/message_sequence_chart_synchronization.png differ
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/images/terminal_view.png b/advertising/periodic_advertisement/connectionless_synchronization/images/terminal_view.png
new file mode 100644
index 0000000..d32c569
Binary files /dev/null and b/advertising/periodic_advertisement/connectionless_synchronization/images/terminal_view.png differ
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/inc/advertiser/app.h b/advertising/periodic_advertisement/connectionless_synchronization/inc/advertiser/app.h
new file mode 100644
index 0000000..3cbb0db
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/inc/advertiser/app.h
@@ -0,0 +1,31 @@
+/***************************************************************************//**
+ * @file
+ * @brief Application interface provided to main().
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+
+#ifndef APP_H
+#define APP_H
+
+/**************************************************************************//**
+ * Application Init.
+ *****************************************************************************/
+void app_init(void);
+
+/**************************************************************************//**
+ * Application Process Action.
+ *****************************************************************************/
+void app_process_action(void);
+
+#endif // APP_H
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/inc/scanner/app.h b/advertising/periodic_advertisement/connectionless_synchronization/inc/scanner/app.h
new file mode 100644
index 0000000..3cbb0db
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/inc/scanner/app.h
@@ -0,0 +1,31 @@
+/***************************************************************************//**
+ * @file
+ * @brief Application interface provided to main().
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+
+#ifndef APP_H
+#define APP_H
+
+/**************************************************************************//**
+ * Application Init.
+ *****************************************************************************/
+void app_init(void);
+
+/**************************************************************************//**
+ * Application Process Action.
+ *****************************************************************************/
+void app_process_action(void);
+
+#endif // APP_H
diff --git a/advertising/periodic_advertisement/src/advertiser/app.c b/advertising/periodic_advertisement/connectionless_synchronization/src/advertiser/app.c
similarity index 82%
rename from advertising/periodic_advertisement/src/advertiser/app.c
rename to advertising/periodic_advertisement/connectionless_synchronization/src/advertiser/app.c
index 3f4ec7e..7a23998 100644
--- a/advertising/periodic_advertisement/src/advertiser/app.c
+++ b/advertising/periodic_advertisement/connectionless_synchronization/src/advertiser/app.c
@@ -19,18 +19,21 @@
#include "sl_bluetooth.h"
#include "gatt_db.h"
#include "app.h"
-
#include "sl_bt_api.h"
#include "app_log.h"
-#define SIGNAL_REFRESH_DATA 1
-#define TICKS_PER_SECOND 32768
+#define SIGNAL_REFRESH_DATA 1 //bitmask used to report external signal to the ble stack
+#define TICKS_TIMEOUT 32768 // Timer periodic timeout, in timer ticks
+#define TX_POWER 30 //effective value TX_POWER/10
// The advertising set handle allocated from Bluetooth stack.
static uint8_t advertising_set_handle = 0xff;
-
-sl_sleeptimer_timer_handle_t sleep_timer_handle;
+// Periodic advertisement data
+static uint8_t periodic_adv_data[8] = { 0x07, 0xFF, 0x02, 0xFF, 0x00, 0x00, 0x00, 0x00 };
+//Sleeptimer used to update periodic data
+static sl_sleeptimer_timer_handle_t sleep_timer_handle;
void sleeptimer_callback(sl_sleeptimer_timer_handle_t *handle, void *data);
+
/**************************************************************************//**
* Application Init.
*****************************************************************************/
@@ -63,23 +66,21 @@ SL_WEAK void app_process_action(void)
void sl_bt_on_event(sl_bt_msg_t *evt)
{
sl_status_t sc;
- bd_addr address;
- uint8_t address_type;
- uint8_t system_id[8];
-
- static uint8_t periodic_adv_data[191];
- int16_t result;
switch (SL_BT_MSG_ID(evt->header)) {
// -------------------------------
// This event indicates the device has started and the radio is ready.
// Do not call any stack command before receiving this boot event!
- case sl_bt_evt_system_boot_id:
+ case sl_bt_evt_system_boot_id: {
+ bd_addr address;
+ uint8_t address_type;
+ uint8_t system_id[8];
+ int16_t result;
// Extract unique ID from BT Address.
sc = sl_bt_system_get_identity_address(&address, &address_type);
app_assert_status(sc);
- app_log_info("Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\n",
+ app_log_info("Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
address_type ? "static random" : "public device",
address.addr[5],
address.addr[4],
@@ -87,7 +88,7 @@ void sl_bt_on_event(sl_bt_msg_t *evt)
address.addr[2],
address.addr[1],
address.addr[0]);
- // Pad and reverse unique ID to get System ID.
+ // Pad and reverse unique ID to get System ID, write it to the corresponding GATT characteristic
system_id[0] = address.addr[5];
system_id[1] = address.addr[4];
system_id[2] = address.addr[3];
@@ -107,10 +108,9 @@ void sl_bt_on_event(sl_bt_msg_t *evt)
app_assert_status(sc);
// Set TX power
- sc = sl_bt_advertiser_set_tx_power(advertising_set_handle, 30, &result);
- app_assert_status(sc);
-
+ sc = sl_bt_advertiser_set_tx_power(advertising_set_handle, TX_POWER, &result);
app_assert_status(sc);
+ app_log_info("Tx power of advertising set to %d.%d dBm\r\n", result / 10, result % 10);
// Set advertising interval to 100ms.
sc = sl_bt_advertiser_set_timing(advertising_set_handle,
@@ -120,10 +120,9 @@ void sl_bt_on_event(sl_bt_msg_t *evt)
0); // max. num. adv. events
app_assert_status(sc);
- // Start general advertising
+ // Start general extended advertising
sc = sl_bt_extended_advertiser_generate_data(advertising_set_handle,
sl_bt_advertiser_general_discoverable);
-
app_assert_status(sc);
sc = sl_bt_extended_advertiser_start(advertising_set_handle,
@@ -132,36 +131,39 @@ void sl_bt_on_event(sl_bt_msg_t *evt)
app_assert_status(sc);
- // Start periodic advertising with periodic interval 200ms
- sc = sl_bt_periodic_advertiser_start(advertising_set_handle, 160, 160,
- SL_BT_PERIODIC_ADVERTISER_AUTO_START_EXTENDED_ADVERTISING);
+ // Start periodic advertising with periodic interval 500ms
+ sc = sl_bt_periodic_advertiser_start(advertising_set_handle,
+ 400,
+ 400,
+ 0);
app_assert_status(sc);
- // Set the advertising data
sc = sl_bt_periodic_advertiser_set_data(advertising_set_handle, sizeof(periodic_adv_data), periodic_adv_data);
-
app_assert_status(sc);
// Start a timer to change advertising data every 1s
- sc = sl_sleeptimer_start_periodic_timer(&sleep_timer_handle, TICKS_PER_SECOND, sleeptimer_callback, (void*)NULL, 0, 0);
-
+ sc = sl_sleeptimer_start_periodic_timer(&sleep_timer_handle, TICKS_TIMEOUT, sleeptimer_callback, (void*)NULL, 0, 0);
app_assert_status(sc);
break;
+ }
// -------------------------------
// This event indicates that a new connection was opened.
case sl_bt_evt_connection_opened_id:
break;
+ // -------------------------------
+ // This event indicates that an external has been generated
case sl_bt_evt_system_external_signal_id:
if (evt->data.evt_system_external_signal.extsignals == SIGNAL_REFRESH_DATA) {
- app_log("\r\n");
- for (int i = 0; i < 190; i++) {
+ app_log_info("Periodic advertisement payload: ");
+ for (uint8_t i = 4; i < 8; i++) {
periodic_adv_data[i] = rand() % 9;
- app_log(" %X", periodic_adv_data[i]);
+ }
+ for (uint8_t i = 0; i < 8; i++) {
+ app_log("%02X,", periodic_adv_data[i]);
}
app_log("\r\n");
-
sc = sl_bt_periodic_advertiser_set_data(advertising_set_handle, sizeof(periodic_adv_data), periodic_adv_data);
app_assert_status(sc);
}
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/src/advertiser/main.c b/advertising/periodic_advertisement/connectionless_synchronization/src/advertiser/main.c
new file mode 100644
index 0000000..6f9f109
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/src/advertiser/main.c
@@ -0,0 +1,58 @@
+/***************************************************************************//**
+ * @file
+ * @brief main() function.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+#include "sl_component_catalog.h"
+#include "sl_system_init.h"
+#include "app.h"
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+#include "sl_power_manager.h"
+#endif // SL_CATALOG_POWER_MANAGER_PRESENT
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+#include "sl_system_kernel.h"
+#else // SL_CATALOG_KERNEL_PRESENT
+#include "sl_system_process_action.h"
+#endif // SL_CATALOG_KERNEL_PRESENT
+
+int main(void)
+{
+ // Initialize Silicon Labs device, system, service(s) and protocol stack(s).
+ // Note that if the kernel is present, processing task(s) will be created by
+ // this call.
+ sl_system_init();
+
+ // Initialize the application. For example, create periodic timer(s) or
+ // task(s) if the kernel is present.
+ app_init();
+
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+ // Start the kernel. Task(s) created in app_init() will start running.
+ sl_system_kernel_start();
+#else // SL_CATALOG_KERNEL_PRESENT
+ while (1) {
+ // Do not remove this call: Silicon Labs components process action routine
+ // must be called from the super loop.
+ sl_system_process_action();
+
+ // Application process.
+ app_process_action();
+
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+ // Let the CPU go to sleep if the system allows it.
+ sl_power_manager_sleep();
+#endif
+ }
+#endif // SL_CATALOG_KERNEL_PRESENT
+}
diff --git a/advertising/periodic_advertisement/src/scanner/app.c b/advertising/periodic_advertisement/connectionless_synchronization/src/scanner/app.c
similarity index 65%
rename from advertising/periodic_advertisement/src/scanner/app.c
rename to advertising/periodic_advertisement/connectionless_synchronization/src/scanner/app.c
index bae02e5..0656b45 100644
--- a/advertising/periodic_advertisement/src/scanner/app.c
+++ b/advertising/periodic_advertisement/connectionless_synchronization/src/scanner/app.c
@@ -17,13 +17,11 @@
#include "em_common.h"
#include "app_assert.h"
#include "sl_bluetooth.h"
-#include "gatt_db.h"
#include "app.h"
-
#include "sl_bt_api.h"
#include "app_log.h"
-// This constant is UUID of periodic synchronous service
+// UUID of periodic synchronous service used to identify the advertisement of the target device
const uint8_t periodicSyncService[16] = { 0x81, 0xc2, 0x00, 0x2d, 0x31, 0xf4, 0xb0, 0xbf, 0x2b, 0x42, 0x49, 0x68, 0xc7, 0x25, 0x71, 0x41 };
// Parse advertisements looking for advertised periodicSync Service.
@@ -32,15 +30,13 @@ static uint8_t findServiceInAdvertisement(uint8_t *data, uint8_t len)
uint8_t adFieldLength;
uint8_t adFieldType;
uint8_t i = 0;
- app_log("packet length %d\r\n", len);
// Parse advertisement packet
while (i < len) {
adFieldLength = data[i];
adFieldType = data[i + 1];
- // Partial ($02) or complete ($03) list of 128-bit UUIDs
- app_log("adField type %d \r\n", adFieldType);
+ // found incomplete/complete list of 128-bit Service UUIDs as defined in the assgigned numbers SIG document.
if (adFieldType == 0x06 || adFieldType == 0x07) {
- // compare UUID to service UUID
+ // compare UUID to periodic synchronous service UUID
if (memcmp(&data[i + 2], periodicSyncService, 16) == 0) {
return 1;
}
@@ -83,92 +79,90 @@ SL_WEAK void app_process_action(void)
void sl_bt_on_event(sl_bt_msg_t *evt)
{
sl_status_t sc;
- bd_addr address;
- uint8_t address_type;
- uint8_t system_id[8];
-
static uint16_t sync;
switch (SL_BT_MSG_ID(evt->header)) {
// -------------------------------
// This event indicates the device has started and the radio is ready.
// Do not call any stack command before receiving this boot event!
- case sl_bt_evt_system_boot_id:
-
+ case sl_bt_evt_system_boot_id: {
+ bd_addr address;
+ uint8_t address_type;
// Extract unique ID from BT Address.
sc = sl_bt_system_get_identity_address(&address, &address_type);
- app_assert(sc == SL_STATUS_OK,
- "[E: 0x%04x] Failed to get Bluetooth address\n",
- (int)sc);
-
- // Pad and reverse unique ID to get System ID.
- system_id[0] = address.addr[5];
- system_id[1] = address.addr[4];
- system_id[2] = address.addr[3];
- system_id[3] = 0xFF;
- system_id[4] = 0xFE;
- system_id[5] = address.addr[2];
- system_id[6] = address.addr[1];
- system_id[7] = address.addr[0];
-
- sc = sl_bt_gatt_server_write_attribute_value(gattdb_system_id,
- 0,
- sizeof(system_id),
- system_id);
- app_assert(sc == SL_STATUS_OK,
- "[E: 0x%04x] Failed to write attribute\n",
- (int)sc);
-
- // periodic scanner setting
- sl_bt_scanner_set_parameters(sl_bt_scanner_scan_mode_passive, 200, 200);
- sl_bt_scanner_start(sl_bt_scanner_scan_phy_1m,
- sl_bt_scanner_discover_observation);
-
+ app_assert_status(sc);
+
+ app_log_info("Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
+ address_type ? "static random" : "public device",
+ address.addr[5],
+ address.addr[4],
+ address.addr[3],
+ address.addr[2],
+ address.addr[1],
+ address.addr[0]);
+
+ // Scan in intervals of 125ms for 125ms time window
+ sc = sl_bt_scanner_set_parameters(sl_bt_scanner_scan_mode_passive, 200, 200);
+ app_assert_status(sc);
+
+ sc = sl_bt_scanner_start(sl_bt_scanner_scan_phy_1m,
+ sl_bt_scanner_discover_observation);
+ app_assert_status(sc);
break;
+ }
- // scan response
+ // -------------------------------
+ // This event indicates the device has received extended advertisements PDU
case sl_bt_evt_scanner_extended_advertisement_report_id:
- app_log("got ext adv indication with tx_power = %d\r\n",
- evt->data.evt_scanner_extended_advertisement_report.tx_power);
-
+ app_log_info("got extended advertisement indication with tx_power = %d\r\n",
+ evt->data.evt_scanner_extended_advertisement_report.tx_power);
if (findServiceInAdvertisement(&(evt->data.evt_scanner_extended_advertisement_report.data.data[0]), evt->data.evt_scanner_extended_advertisement_report.data.len) != 0) {
- app_log("found periodic sync service, attempting to open sync\r\n");
+ app_log_info("found periodic sync service, attempting to open sync\r\n");
sc = sl_bt_sync_scanner_open(evt->data.evt_scanner_extended_advertisement_report.address,
evt->data.evt_scanner_extended_advertisement_report.address_type,
evt->data.evt_scanner_extended_advertisement_report.adv_sid,
&sync);
- app_log_info("cmd_sync_open() sync = 0x%4lX\r\n", sc);
+ app_assert_status(sc);
+ /* now that sync is open, we can stop scanning*/
+ sl_bt_scanner_stop();
}
break;
+ // -------------------------------
+ // This event indicates the device has synchronized successfully to the perodic advertisement
case sl_bt_evt_periodic_sync_opened_id:
- /* now that sync is open, we can stop scanning*/
- app_log("evt_sync_opened\r\n");
-// sl_bt_system_set_soft_timer(0,1,0);
- sl_bt_scanner_stop();
+ {
+ bd_addr advA = evt->data.evt_periodic_sync_opened.address;
+ app_log_info("Successfully synchronized to bluetooth address: %02X:%02X:%02X:%02X:%02X:%02X\r\n",
+ advA.addr[5],
+ advA.addr[4],
+ advA.addr[3],
+ advA.addr[2],
+ advA.addr[1],
+ advA.addr[0]);
+
break;
+ }
+ // -------------------------------
+ // This event indicates the synchornizatiion has been terminated
case sl_bt_evt_sync_closed_id:
- app_log("periodic sync closed. reason 0x%2X, sync handle %d",
- evt->data.evt_sync_closed.reason,
- evt->data.evt_sync_closed.sync);
+ app_log_info("periodic sync closed. reason 0x%04X, sync handle 0x%04X\r\n",
+ evt->data.evt_sync_closed.reason,
+ evt->data.evt_sync_closed.sync);
/* restart discovery */
sl_bt_scanner_start(sl_bt_scanner_scan_phy_1m,
sl_bt_scanner_discover_observation);
break;
+ // -------------------------------
+ // This event indicates the device has received a periodic advertisements PDU
case sl_bt_evt_periodic_sync_report_id:
-
- app_log("periodic sync handle %d\r\n", evt->data.evt_periodic_sync_report.sync);
- app_log("got following sync data: \r\n ");
+ app_log_info("Periodic advertisemenet payload: ");
for (int i = 0; i < evt->data.evt_periodic_sync_report.data.len; i++) {
- app_log(" %X", evt->data.evt_periodic_sync_report.data.data[i]);
+ app_log("%02X,", evt->data.evt_periodic_sync_report.data.data[i]);
}
app_log("\r\n");
- app_log("periodic sync RSSI %d and Tx power %d\r\n",
- evt->data.evt_periodic_sync_report.rssi,
- evt->data.evt_periodic_sync_report.tx_power);
- app_log("periodic data status %d\r\n", evt->data.evt_periodic_sync_report.data_status);
break;
///////////////////////////////////////////////////////////////////////////
diff --git a/advertising/periodic_advertisement/connectionless_synchronization/src/scanner/main.c b/advertising/periodic_advertisement/connectionless_synchronization/src/scanner/main.c
new file mode 100644
index 0000000..6f9f109
--- /dev/null
+++ b/advertising/periodic_advertisement/connectionless_synchronization/src/scanner/main.c
@@ -0,0 +1,58 @@
+/***************************************************************************//**
+ * @file
+ * @brief main() function.
+ *******************************************************************************
+ * # License
+ * Copyright 2020 Silicon Laboratories Inc. www.silabs.com
+ *******************************************************************************
+ *
+ * The licensor of this software is Silicon Laboratories Inc. Your use of this
+ * software is governed by the terms of Silicon Labs Master Software License
+ * Agreement (MSLA) available at
+ * www.silabs.com/about-us/legal/master-software-license-agreement. This
+ * software is distributed to you in Source Code format and is governed by the
+ * sections of the MSLA applicable to Source Code.
+ *
+ ******************************************************************************/
+#include "sl_component_catalog.h"
+#include "sl_system_init.h"
+#include "app.h"
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+#include "sl_power_manager.h"
+#endif // SL_CATALOG_POWER_MANAGER_PRESENT
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+#include "sl_system_kernel.h"
+#else // SL_CATALOG_KERNEL_PRESENT
+#include "sl_system_process_action.h"
+#endif // SL_CATALOG_KERNEL_PRESENT
+
+int main(void)
+{
+ // Initialize Silicon Labs device, system, service(s) and protocol stack(s).
+ // Note that if the kernel is present, processing task(s) will be created by
+ // this call.
+ sl_system_init();
+
+ // Initialize the application. For example, create periodic timer(s) or
+ // task(s) if the kernel is present.
+ app_init();
+
+#if defined(SL_CATALOG_KERNEL_PRESENT)
+ // Start the kernel. Task(s) created in app_init() will start running.
+ sl_system_kernel_start();
+#else // SL_CATALOG_KERNEL_PRESENT
+ while (1) {
+ // Do not remove this call: Silicon Labs components process action routine
+ // must be called from the super loop.
+ sl_system_process_action();
+
+ // Application process.
+ app_process_action();
+
+#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
+ // Let the CPU go to sleep if the system allows it.
+ sl_power_manager_sleep();
+#endif
+ }
+#endif // SL_CATALOG_KERNEL_PRESENT
+}
diff --git a/advertising/periodic_advertisement/images/add_log_1.png b/advertising/periodic_advertisement/images/add_log_1.png
deleted file mode 100644
index 67ea117..0000000
Binary files a/advertising/periodic_advertisement/images/add_log_1.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/add_log_2.png b/advertising/periodic_advertisement/images/add_log_2.png
deleted file mode 100644
index d6dd3a0..0000000
Binary files a/advertising/periodic_advertisement/images/add_log_2.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/add_log_3.png b/advertising/periodic_advertisement/images/add_log_3.png
deleted file mode 100644
index dd3d8a2..0000000
Binary files a/advertising/periodic_advertisement/images/add_log_3.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/add_log_4.png b/advertising/periodic_advertisement/images/add_log_4.png
deleted file mode 100644
index a897686..0000000
Binary files a/advertising/periodic_advertisement/images/add_log_4.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/add_log_5.png b/advertising/periodic_advertisement/images/add_log_5.png
deleted file mode 100644
index 4f57b90..0000000
Binary files a/advertising/periodic_advertisement/images/add_log_5.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/add_periodic_component.png b/advertising/periodic_advertisement/images/add_periodic_component.png
deleted file mode 100644
index 4e6981c..0000000
Binary files a/advertising/periodic_advertisement/images/add_periodic_component.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/add_periodic_sync_component.png b/advertising/periodic_advertisement/images/add_periodic_sync_component.png
deleted file mode 100644
index 584fb2b..0000000
Binary files a/advertising/periodic_advertisement/images/add_periodic_sync_component.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/figure_1.png b/advertising/periodic_advertisement/images/figure_1.png
deleted file mode 100644
index 1ad2bde..0000000
Binary files a/advertising/periodic_advertisement/images/figure_1.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/periodic_ble_core_config_1.png b/advertising/periodic_advertisement/images/periodic_ble_core_config_1.png
deleted file mode 100644
index f6e6a93..0000000
Binary files a/advertising/periodic_advertisement/images/periodic_ble_core_config_1.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/periodic_ble_core_config_2.png b/advertising/periodic_advertisement/images/periodic_ble_core_config_2.png
deleted file mode 100644
index cda3528..0000000
Binary files a/advertising/periodic_advertisement/images/periodic_ble_core_config_2.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/result_1.png b/advertising/periodic_advertisement/images/result_1.png
deleted file mode 100644
index dc2c1f4..0000000
Binary files a/advertising/periodic_advertisement/images/result_1.png and /dev/null differ
diff --git a/advertising/periodic_advertisement/images/result_2.png b/advertising/periodic_advertisement/images/result_2.png
deleted file mode 100644
index 65ac8fc..0000000
Binary files a/advertising/periodic_advertisement/images/result_2.png and /dev/null differ
diff --git a/templates.xml b/templates.xml
index 763b266..ce143d8 100644
--- a/templates.xml
+++ b/templates.xml
@@ -144,11 +144,11 @@
-
+
-
-
+
+
@@ -156,11 +156,35 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+