Generated banner for Matlab Simulate Bluetooth Network
Generated logo for Matlab Simulate Bluetooth Network

Matlab Simulate Bluetooth Network

MathWorksOfficialCreated by MathWorks

  • Skill
  • Tool integration
  • Science and research
  • BSD-2-Clause
  • No issues found

From the author

Simulate Bluetooth system-level networks using the Bluetooth Toolbox. Use this skill for any Bluetooth topology: BLE ACL (Asynchronous Connection-Less) data connections, CIS (Connected Isochronous Stream) and LE Audio for stereo speakers or hearing aids, BLE GAP (Generic Access Profile) connection establishment with advertising and scanning, Classic BR/EDR piconets with ACL data and SCO (Synchronous Connection-Oriented) voice links, and BLE+BR/EDR coexistence with adaptive frequency hopping. Covers bluetoothLENode, bluetoothNode, bluetoothLEConnectionConfig, bluetoothLECISConfig, bluetoothLEGAPConfig, bluetoothConnectionConfig, configureConnection, kpi (), updateChannelList, and all Bluetooth statistics.
— the description by MathWorks

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides the framework for performing system-level simulations of Bluetooth networks using the Bluetooth Toolbox. It enables the modeling of various Bluetooth topologies, including BLE ACL data connections, LE Audio streams (CIS/CIG), Classic BR/EDR piconets, and coexistence scenarios with adaptive frequency hopping. The skill integrates with the wireless network simulator to allow for node configuration, traffic generation, and performance analysis through KPIs.

What it does

  • Simulates BLE ACL connections and LE Audio streams like CIS/CIG.
  • Models Classic BR/EDR piconets with ACL data and SCO voice links.
  • Supports BLE and BR/EDR coexistence with adaptive frequency hopping.
  • Configures connection parameters such as intervals, offsets, and PHY modes.
  • Provides KPI tracking for throughput, latency, and packet loss rates.
  • Facilitates node setup using specialized Bluetooth node objects.

When to use it

  • When evaluating Bluetooth network performance at the system level.
  • For simulating multi-peripheral star networks or LE Audio use cases.
  • When testing connection establishment and timing in BLE GAP scenarios.
  • For analyzing coexistence between different Bluetooth technologies.
  • When you need to model specific Bluetooth topologies like stereo TWS or hearing aids.

Advantages

  • Enables system-level performance analysis without needing full PHY-layer modeling.
  • Provides pre-validated templates for common audio and data use cases.
  • Allows for flexible configuration of connection parameters and channel selection.
  • Supports complex multi-node topologies with specific traffic requirements.
  • Integrates seamlessly with standard wireless network simulation workflows.

Usage examples

“How do I set up a basic BLE point-to-point connection?”
The skill provides a pattern using bluetoothLENode and configureConnection to establish an ACL link between a central and peripheral node.
“Can I simulate LE Audio for stereo speakers?”
Yes, the skill supports CIS configuration for LE Audio, allowing you to define ISO intervals and subevents for multi-peripheral audio streams.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/matlab/matlab-simulate-bluetooth-network/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip matlab-simulate-bluetooth-network.zip -d .agents/skills

Documentation by MathWorks

Bluetooth System-Level Simulation

Entry point for all Bluetooth system-level simulation. All Bluetooth simulations use sim = wirelessNetworkSimulator.init and follow the workflow defined in matlab-simulate-wireless-network (simulator init, traffic, mobility, instrumentation, addNodes, run).

When to Use

  • BLE ACL point-to-point or star network connections

  • LE Audio unicast with CIS/CIG (stereo speakers, hearing aids)

  • BLE GAP connection establishment (advertising, scanning, connection timing)

  • Classic BR/EDR piconets with ACL data or SCO voice

  • BLE + BR/EDR coexistence with adaptive frequency hopping

  • Any simulation using bluetoothLENode, bluetoothNode

When Not to Use

  • Non-Bluetooth wireless simulations (use matlab-simulate-wireless-network instead)

  • PHY-layer or link level Bluetooth waveform generation, receiver analysis or BER analysis

  • Generic simulator setup, traffic models, or mobility (use matlab-simulate-wireless-network)

Scenario → Reference Routing

ScenarioReference
BLE realistic connection setup (advertising, scanning, GAP)references/ble-gap-connection.md
BLE point-to-point data, star network, ACL connectionsreferences/ble-connection.md
LE Audio unicast (stereo speakers, hearing aids, CIS/CIG)references/ble-cis.md
Classic Bluetooth earbuds, SCO voice, ACL datareferences/bluetooth-bredr.md
BLE + BR/EDR coexistence, adaptive frequency hoppingreferences/bluetooth-coexistence.md
Capture and visualization (PCAP, IQ, event tracing, traffic viewer)See matlab-simulate-wireless-network skill

Node Roles

  • BLE (ACL, CIS): bluetoothLENode("central"), bluetoothLENode("peripheral")

  • BR/EDR: bluetoothNode("central"), bluetoothNode("peripheral") — max 7 peripherals per central

Traffic Attachment Rules

addTrafficSource(sourceNode, traffic, ...):

  • ACL/CIS/BR/EDR: DestinationNode=peer required. CIS also needs CISConfig=cfgCISOut.

  • BR/EDR SCO: No traffic call — implicit via SCOPacketType in connection config.

kpi() Availability

Topology"throughput""latency""PLR" / "PDR"Layer
BLE ACLLL onlyApp onlyBoth LL and App"LL" or "App"
BLE CISLL onlyApp onlyBoth LL and App"LL" or "App"
BR/EDRBaseband—Baseband"Baseband"

Connection/Configuration Setup

TopologyConfig ObjectFunctionNotes
BLE ACLbluetoothLEConnectionConfigconfigureConnection(cfg, central, peripheral)Per-peripheral in loop; unique AccessAddress per connection
BLE CISbluetoothLEConnectionConfig + bluetoothLECISConfig[~, cfgCISOut] = configureConnection(cfg, central, peripheral, CISConfig=cfgCIS)Pass cfgCISOut to addTrafficSource(..., CISConfig=cfgCISOut)
BR/EDRbluetoothConnectionConfigconfigureConnection(cfg, central, peripherals)Single call with vector of peripherals

Common Mistakes

  • bluetoothNode for BLE (or vice versa): BR/EDR = bluetoothNode, BLE = bluetoothLENode

  • Wrong kpi Layer: BLE throughput → "LL", BLE latency → "App", BR/EDR → "Baseband" only

  • Properties locked after run(): Node/connection properties cannot change mid-sim. Use updateChannelList for mid-sim channel updates.

  • configureConnection with peripheral vector for BLE: Must call per-peripheral in loop (BR/EDR accepts vector)

  • Unique AccessAddress per connection: Each BLE connection on same central needs different AccessAddress

  • DataRate in Kbps: DataRate=100 means 100 Kbps, not 100 bps

  • GeneratePacket=true is not valid: Not applicable for network-level simulation. Use OnTime=Inf for continuous traffic.

<!-- Copyright 2026 The MathWorks, Inc. -->

Files

references/ble-cis.md

BLE CIS (Connected Isochronous Stream) Simulation

Simulate LE Audio using Connected Isochronous Streams. CIS provides time-bounded, reliable isochronous data delivery for use cases like stereo speakers, hearing aids, and multi-channel audio.

When to Use

  • Simulating LE Audio with multiple speakers (stereo, surround)

  • Configuring CIS timing for LC3 codec alignment

  • Testing latency requirements for audio (<20ms)

  • Multi-peripheral CIG (Connected Isochronous Group) scheduling

CIS End-to-End Flow (3 Steps)

% Step 1: Create CIS config
cfgCIS = bluetoothLECISConfig(ISOInterval=0.02, MaxPDU=120, NumSubevents=2, BurstNumber=[1 0]);

% Step 2: configureConnection returns UPDATED CIS config (capture 2nd output)
[~, cfgCISOut] = configureConnection(cfgConn, central, peripheral, CISConfig=cfgCIS);

% Step 3: Pass returned cfgCISOut to addTrafficSource
addTrafficSource(central, traffic, DestinationNode=peripheral, CISConfig=cfgCISOut);

If struggling with CIS setup, refer to openExample("bluetooth/BLEMultistreamAudioExample") for a working reference.

Quick-Start: Pick a Template

Select the template matching your use case. All values are pre-validated.

Use CaseNumPeripPHYMaxPDUNSEISO (s)CI (s)AP (s)
Stereo TWS (2 earbuds)2LE2M12020.020.040.005
Hearing Aid (mono)1LE2M10020.020.020.005
Hearing Aid (bidir)1LE2M[100 40]20.020.020.005
4-Speaker Surround4LE2M12020.020.080.005
Stereo LE1M (fallback)2LE1M12010.020.040.005
Low-Latency Stereo2LE2M12010.010.020.005

Formulas (only needed for non-standard configurations):

  • ConnectionInterval = NumPeripherals × ISOInterval

  • ConnectionOffset(i) = (i-1) × ISOInterval

  • ISOInterval >= ActivePeriod + NumPeripherals × NSE × SubeventLength

  • ISOInterval must be a multiple of 1.25ms, range [5ms, 4s]

Complete Pattern: Stereo TWS

sim = wirelessNetworkSimulator.init;

central = bluetoothLENode("central", Position=[0 0 0]);
peripherals = [bluetoothLENode("peripheral", Position=[-1 1 0]), ...
               bluetoothLENode("peripheral", Position=[1 1 0])];

cfgCIS = bluetoothLECISConfig(ISOInterval=0.02, MaxPDU=120, ...
    NumSubevents=2, BurstNumber=[1 0], FlushTimeout=[2 1]);

for i = 1:2
    cfgConn = bluetoothLEConnectionConfig( ...
        ConnectionInterval=0.04, ...
        ActivePeriod=0.005, ...
        ConnectionOffset=(i-1)*0.02, ...
        AccessAddress=sprintf("5DA4427%d", i-1), ...
        PHYMode="LE2M", MaxPDU=120);

    [~, cfgCISOut] = configureConnection(cfgConn, central, peripherals(i), CISConfig=cfgCIS);

    traffic = networkTrafficOnOff(DataRate=48, PacketSize=120, OnTime=Inf);
    addTrafficSource(central, traffic, DestinationNode=peripherals(i), CISConfig=cfgCISOut);
end

addNodes(sim, [central; peripherals(:)]);
run(sim, 0.5);

Complete Pattern: Hearing Aid Bidirectional

sim = wirelessNetworkSimulator.init;

central = bluetoothLENode("central", Position=[0 0 0]);
peripheral = bluetoothLENode("peripheral", Position=[0.1 0 0]);

cfgCIS = bluetoothLECISConfig(ISOInterval=0.02, MaxPDU=[100 40], ...
    NumSubevents=2, BurstNumber=[1 1], FlushTimeout=[2 2]);

cfgConn = bluetoothLEConnectionConfig( ...
    ConnectionInterval=0.02, ActivePeriod=0.005, ...
    AccessAddress="5DA44270", PHYMode="LE2M", MaxPDU=[100 40]);

[~, cfgCISOut] = configureConnection(cfgConn, central, peripheral, CISConfig=cfgCIS);

trafficDL = networkTrafficOnOff(DataRate=40, PacketSize=100, OnTime=Inf);
addTrafficSource(central, trafficDL, DestinationNode=peripheral, CISConfig=cfgCISOut);

trafficUL = networkTrafficOnOff(DataRate=16, PacketSize=40, OnTime=Inf);
addTrafficSource(peripheral, trafficUL, DestinationNode=central, CISConfig=cfgCISOut);

addNodes(sim, [central, peripheral]);
run(sim, 0.5);

Key Rules

Rule 1: Use RETURNED CIS Config for Traffic

configureConnection returns an updated CIS config with computed read-only fields. You MUST use this returned config:

[~, cfgCISOut] = configureConnection(cfgConn, central, peripheral, CISConfig=cfgCIS);
addTrafficSource(central, traffic, DestinationNode=peripheral, CISConfig=cfgCISOut);
Rule 2: ISOInterval = ConnectionInterval / NumPeripherals (STRICT)

This is enforced at runtime. Use the template table or formula:

  • ConnectionInterval = NumPeripherals × ISOInterval

  • Standard choice: ISOInterval = 0.02 (20ms, matches LC3 frame interval)

Rule 3: ActivePeriod = 0.005 (safe default)

Use ActivePeriod = 0.005 for all CIS simulations. This satisfies the minimum for LE1M and LE2M with any MaxPDU ≤ 251.

Rule 4: ConnectionOffset Staggering

Each peripheral's offset = (i-1) × ISOInterval:

cfgConn.ConnectionOffset = (i-1) * cfgCIS.ISOInterval;
Rule 5: Parameter Name is CISConfig

Always use CISConfig=... (not CfgCIS, CISCfg, or ISOConfig).

Statistics / KPI

kpi(): Throughput at "LL", latency at "App", PLR/PDR at both layers.

statistics(node): App layer has ReceivedPackets/Bytes, AveragePacketLatency. LL layer CIS sub-struct: CISStatistics.CISID, TransmittedPackets, ReceivedPackets, RetransmittedPackets, AcknowledgedPackets.

CIS Config Properties

PropertyRangeDefaultNotes
ISOInterval[5ms, 4s]0.02Multiple of 1.25ms
NumSubevents[1, 31]1Retransmission opportunities
SubInterval[0.4ms, 4s]autoTime between subevents
BurstNumber[0, 15]1Scalar or [C→P, P→C]
MaxPDU[0, 251]251Scalar or [C→P, P→C]
FlushTimeout[1, 255]1Scalar or [C→P, P→C]
CISArrangementseq/interl"sequential"Subevent layout

Read-only after configureConnection: AccessAddress, CISID, CISOffset.

<!-- Copyright 2026 The MathWorks, Inc. -->

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

The author says: >=R2026a

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
MathWorks
Publisher
MathWorks (Official)
Source
matlab/matlab-agentic-toolkit · skills-catalog/wireless-communications/matlab-simulate-bluetooth-network · commit 2a7f215
Licence
BSD 2-Clause License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-simulate-bluetooth-network.zip