BLE Send
Send data using Bluetooth Low Energy (BLE) protocol
Add-On Required: This feature requires the Simulink Support Package for Android Devices add-on.
Libraries:
Simulink Support Package for Android Devices /
Communication
Description
The BLE Send block transmits data or instructions from your Android® mobile device to a nearby device or sensor using the Bluetooth® Low Energy (BLE) protocol.
Central Mode
A BLE device configured in the central mode scans and detects nearby BLE devices and determines their available services. After scanning, a BLE device operating in the central mode can connect to any of the discovered BLE devices.
When you set the Mode of the devices to Central
(Client)
, you must scan and detect nearby BLE devices. To start BLE Setup
wizard, click Scan. When the wizard completes, select a
Peripheral Device and Characteristic found
during the scan and detection.
Peripheral Mode
A BLE device configured in the peripheral mode advertises its presence to other devices, broadcasting minimal information on the service supported and 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 Android mobile device.
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. Universally 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 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 the 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 R2017b