BLE Send
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
Common
Description
Use the BLE Send block to enable your Arduino® board to transmit data or instructions to a nearby device or sensor using the Bluetooth® Low Energy (BLE) protocol.
Supported Arduino Boards
Arduino Nano 33 IoT
Arduino Nano 33 BLE Sense
Arduino MKR Wi-Fi® 1010
Arduino compatible ESP32 – WROOM
Arduino compatible ESP32 – WROVER
Central Mode
A BLE device configured in the Central (Client) mode can scan and detect nearby BLE
devices and determine their available services. When you set the Mode
parameter to Central (Client)
, use the Scan button
on the block to set up the BLE Setup wizard. The BLE Setup wizard scans for nearby BLE
devices and determines the services and characteristics available on these devices. Once
wizard detects nearby BLE devices, select a peripheral device and its characteristic using
the Peripheral Device and Characteristic
parameters.
Peripheral Mode
A BLE device configured in the Peripheral (Server) mode advertises its presence to other
devices, broadcasting minimal information on the services it supports and the identity of
the device. This allows BLE devices configured in the central mode to scan and detect nearby
BLE devices and determine their available services. When you set the
Mode of the device to Peripheral (Server)
, you
must specify the Service and Characteristic of
your device. Other devices with the same service and characteristic then receive the data
sent from your Arduino board.
Service and Characteristic
BLE data exchange is based on the Generic Attributes (GATT) profile, which defines a hierarchical data structure. GATT consists of a service, such as Heart Rate service, that can contain several characteristics, such as Heart Rate Measurement or Body Sensor Location. Universal unique ID (UUID) defines both services and characteristics allowing different BLE devices to identify the services and characteristics of the connected device.
When a BLE device operates in the peripheral mode, the available services provided by the device are advertised to any listening BLE devices operating in the central mode. Only when the BLE central device establishes a connection to the BLE peripheral device are the characteristics within the service made available. Many services and associated characteristics are already available as standards, including the Heart Rate service.
You can optionally specify your own or custom services and characteristics using your own UUIDs for the service and characteristics. To enable custom UUID specification, select the Specify using UUID parameter.
Ports
Input
Parameters
Version History
Introduced in R2021b