Matlab Simulate Bluetooth Network
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Science and research
- BSD-2-Clause
- No issues found
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
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/matlab/matlab-simulate-bluetooth-network/downloadUnzip 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-networkinstead)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
| Scenario | Reference |
|---|---|
| BLE realistic connection setup (advertising, scanning, GAP) | references/ble-gap-connection.md |
| BLE point-to-point data, star network, ACL connections | references/ble-connection.md |
| LE Audio unicast (stereo speakers, hearing aids, CIS/CIG) | references/ble-cis.md |
| Classic Bluetooth earbuds, SCO voice, ACL data | references/bluetooth-bredr.md |
| BLE + BR/EDR coexistence, adaptive frequency hopping | references/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=peerrequired. CIS also needsCISConfig=cfgCISOut.BR/EDR SCO: No traffic call — implicit via
SCOPacketTypein connection config.
kpi() Availability
| Topology | "throughput" | "latency" | "PLR" / "PDR" | Layer |
|---|---|---|---|---|
| BLE ACL | LL only | App only | Both LL and App | "LL" or "App" |
| BLE CIS | LL only | App only | Both LL and App | "LL" or "App" |
| BR/EDR | Baseband | — | Baseband | "Baseband" |
Connection/Configuration Setup
| Topology | Config Object | Function | Notes |
|---|---|---|---|
| BLE ACL | bluetoothLEConnectionConfig | configureConnection(cfg, central, peripheral) | Per-peripheral in loop; unique AccessAddress per connection |
| BLE CIS | bluetoothLEConnectionConfig + bluetoothLECISConfig | [~, cfgCISOut] = configureConnection(cfg, central, peripheral, CISConfig=cfgCIS) | Pass cfgCISOut to addTrafficSource(..., CISConfig=cfgCISOut) |
| BR/EDR | bluetoothConnectionConfig | configureConnection(cfg, central, peripherals) | Single call with vector of peripherals |
Common Mistakes
bluetoothNodefor BLE (or vice versa): BR/EDR =bluetoothNode, BLE =bluetoothLENodeWrong kpi Layer: BLE throughput →
"LL", BLE latency →"App", BR/EDR →"Baseband"onlyProperties locked after
run(): Node/connection properties cannot change mid-sim. UseupdateChannelListfor mid-sim channel updates.configureConnectionwith peripheral vector for BLE: Must call per-peripheral in loop (BR/EDR accepts vector)Unique
AccessAddressper connection: Each BLE connection on same central needs different AccessAddressDataRate in Kbps:
DataRate=100means 100 Kbps, not 100 bpsGeneratePacket=trueis not valid: Not applicable for network-level simulation. UseOnTime=Inffor continuous traffic.
<!-- Copyright 2026 The MathWorks, Inc. -->
Files
- ATTRIBUTION.mdAdded by AutoGineer1.1 KiB
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md4.7 KiB
- manifest.yaml522 B
- references/ble-cis.md5.9 KiB
- references/ble-connection.md4.9 KiB
- references/ble-gap-connection.md6.3 KiB
- references/bluetooth-bredr.md6.2 KiB
- references/bluetooth-coexistence.md5.1 KiB
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 Case | NumPerip | PHY | MaxPDU | NSE | ISO (s) | CI (s) | AP (s) |
|---|---|---|---|---|---|---|---|
| Stereo TWS (2 earbuds) | 2 | LE2M | 120 | 2 | 0.02 | 0.04 | 0.005 |
| Hearing Aid (mono) | 1 | LE2M | 100 | 2 | 0.02 | 0.02 | 0.005 |
| Hearing Aid (bidir) | 1 | LE2M | [100 40] | 2 | 0.02 | 0.02 | 0.005 |
| 4-Speaker Surround | 4 | LE2M | 120 | 2 | 0.02 | 0.08 | 0.005 |
| Stereo LE1M (fallback) | 2 | LE1M | 120 | 1 | 0.02 | 0.04 | 0.005 |
| Low-Latency Stereo | 2 | LE2M | 120 | 1 | 0.01 | 0.02 | 0.005 |
Formulas (only needed for non-standard configurations):
ConnectionInterval = NumPeripherals × ISOIntervalConnectionOffset(i) = (i-1) × ISOIntervalISOInterval >= ActivePeriod + NumPeripherals × NSE × SubeventLengthISOInterval 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 × ISOIntervalStandard 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
| Property | Range | Default | Notes |
|---|---|---|---|
| ISOInterval | [5ms, 4s] | 0.02 | Multiple of 1.25ms |
| NumSubevents | [1, 31] | 1 | Retransmission opportunities |
| SubInterval | [0.4ms, 4s] | auto | Time between subevents |
| BurstNumber | [0, 15] | 1 | Scalar or [C→P, P→C] |
| MaxPDU | [0, 251] | 251 | Scalar or [C→P, P→C] |
| FlushTimeout | [1, 255] | 1 | Scalar or [C→P, P→C] |
| CISArrangement | seq/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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-simulate-bluetooth-network.zip