| Bluetooth Low Energy scripts

Multiple_Connection_Master_Role.py File Reference

## Detailed Description

This script implements the Master role which configures a BLE device as Central, Mode 3. Then it look for BLE Slave devices and connect to each of them. Once connected, Master device enables characteristic notification on each Slave device and it receives related characteristics notifications.

- The script is implemented using the new BlueNRG GUI language scripts based on the BLE ACI APIs. The BlueNRG GUI with script engine is delivered within BlueNRG GUI SW package.
- The script can also be run using the script launcher standalone utility available within BlueNRG GUI SW package.
- A PC running Windows Vista/7 operating systems (64 and 32 bit version) or Windows XP operating systems (32 bit edition), with available USB ports is required for installing the BlueNRG GUI SW package.

# Multiple_Connection_Master_Role script, preliminary setup steps: configure up to 8 BLE devices as slaves by using the Multiple_Connection_Slave_Role.py script

- Open BlueNRG GUI
- BlueNRG/BlueNRG-MS platform configuration steps:
  1. Connect the selected platform to a PC USB port
  2. Put selected platform in DFU mode and download the "C:\Program Files (x86)\STMicroelectronics\BlueNRG GUI\Firmware\STM32L1_prebuilt_images\BlueNRG_VCOM_x_x.hex" using the BlueNRG GUI, Tools, Flash Motherboard FW... utility
- BlueNRG-1 platform configuration steps:
  1. Connect the selected platform to a PC USB port
  2. Download the "C:\Program Files (x86)\STMicroelectronics\BlueNRG GUI x.x.x\Firmware\BlueNRG1\DTM\DTM_UART_16MHz.hex or DTM_SPI.hex" file on the BlueNRG-1 platform using the BlueNRG Flasher utility available on BlueNRG-1 DK SW package (STSW-BLUENRG1-DK)
     - NOTES: SPI Network coprocessor configuration file (DTM_SPI.hex) requires some HW changes to be applied to the BlueNRG-1 development platform. Refer to STSW-BNRGUI user manual UM2058.
- On BlueNRG GUI, open the USB Port associated to the plugged platform
- On BlueNRG GUI, select the Scripts window
- On BlueNRG GUI, Scripts window, Scripts Engine section, click on ... tab and browse to the Multiple_Connection_Slave_Role.py script location and select it
- On BlueNRG GUI, click on Run Script tab for running the selected script
- BLE Slave device adds a service with a characteristic and it enters in discoverable mode. When connected, it continuosly notifies the added characteristic value

- NOTE: Repeat previous steps in order to configure another BlueNRG/BlueNRG-MS device as Slave (up to 8 connections are supported from a BlueNRG/BlueNRG-MS Master device, Mode 3).

# Multiple_Connection_Master_Role.py script execution steps through BlueNRG GUI Script Engine

- Open BlueNRG GUI
- BlueNRG/BlueNRG-MS platform configuration steps:
  1. Connect the selected platform to a PC USB port
  2. Put selected platform in DFU mode and download the "C:\Program Files (x86)\STMicroelectronics\BlueNRG GUI x.x.x\Firmware\STM32L1_prebuilt_images\BlueNRG_VCOM_x_x.hex" using the BlueNRG GUI, Tools, Flash Motherboard FW... utility
- BlueNRG-1 platform configuration steps:
  1. Connect the selected platform to a PC USB port
  2. Download the "C:\Program Files (x86)\STMicroelectronics\BlueNRG GUI x.x.x\Firmware\BlueNRG1\DTM\DTM_UART_16MHz.hex or DTM_SPI.hex" file on the BlueNRG-1 platform using the BlueNRG Flasher utility available on BlueNRG-1 DK SW package (STSW-BLUENRG1-DK)
     - NOTES: SPI Network coprocessor configuration file (DTM_SPI.hex) requires some HW changes to be applied to the BlueNRG-1 development platform. Refer to STSW-BNRGUI user manual UM2058.
- On BlueNRG GUI, open the USB Port associated to the plugged platform
- On BlueNRG GUI, select the Scripts window
- On BlueNRG GUI, Scripts window, Scripts Engine section, click on ... tab and browse to the Multiple_Connection_Master_Role.py script location and select it
- On BlueNRG GUI, click on Run Script tab for running the selected script
- BLE Master device will look for BLE advertising devices. Then it will connect to each discovered BLE Slave device and it will enable the related characteristic notification
- At this stage, BLE Master device receive the characteristic value notification from each Slave device and it displays each of them
- For terminating the script (and closing the current active BLE connections), click on "Terminate Script" tab

# Supported platforms

- BlueNRG-1 development platform (order code: STEVAL-IDB007V1)
- BlueNRG-MS development platform (order code: STEVAL-IDB005V1)
- BlueNRG-MS Daughter Board (order code: STEVAL-IDB005V1D)
- BlueNRG-MS USB dongle (order code: STEVAL-IDB006V1)
- BlueNRG development platform (order code: STEVAL-IDB002V1)
- BlueNRG USB dongle (order code: STEVAL-IDB003V1)

# Supported BLE devices and stack versions

- BlueNRG-1 stack v1.x
- BlueNRG-MS stack v7.2x
- BlueNRG stack v6.4x