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://mp-staging.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/bluetooth-bredr.md

Bluetooth BR/EDR Simulation

Simulate Classic Bluetooth (BR/EDR) networks with ACL data and SCO voice connections.

When to Use

  • BR/EDR piconets (earbuds, headsets, audio accessories)

  • SCO voice links (HV1, HV2, HV3) with or without ACL data

  • ACL data packet types (DH1–DH5, 3-DH1–3-DH5) and throughput

Critical Rules

  • Uses bluetoothNode (not bluetoothLENode) and bluetoothConnectionConfig

  • configureConnection(cfg, central, peripherals) — accepts vector of peripherals (unlike BLE)

  • kpi(..., Layer="Baseband") — only layer available; no latency via kpi (use statistics())

  • Max 7 peripherals per central — use multiple centrals for more

  • SCO is implicit: setting cfg.SCOPacketType = "HV3" reserves SCO slots automatically. Only add traffic for ACL data, never for SCO.

Latency from statistics()

Latency is populated on the receiving node (the node that receives the traffic).

stats = statistics(peripheral);  % receiver of the traffic
latency = stats.Baseband.ConnectionStats(1).AverageACLPacketLatency;

SCO Earbud Piconet

sim = wirelessNetworkSimulator.init;

central = bluetoothNode("central", Position=[0 0 0], Name="Phone");
peripherals = bluetoothNode("peripheral", ...
    Position=[0.3 0 0; 0 0.3 0], Name=["LeftEar", "RightEar"]);

cfg = bluetoothConnectionConfig;
cfg.SCOPacketType = "HV3";
cfg.CentralToPeripheralACLPacketType = "DH1";
configureConnection(cfg, central, peripherals);

% ACL data traffic (SCO voice is automatic)
traffic = networkTrafficOnOff(DataRate=50, PacketSize=27, OnTime=Inf);
addTrafficSource(central, traffic, DestinationNode=peripherals);

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

% Results
for i = 1:numel(peripherals)
    tput = kpi(central, peripherals(i), "throughput", Layer="Baseband");
    plr = kpi(central, peripherals(i), "PLR", Layer="Baseband");
    fprintf('%s: %.2f kbps, PLR=%.4f\n', peripherals(i).Name, tput, plr);
end

Traffic DataRate is in Kbps — use DataRate=50 for 50 Kbps, not DataRate=50000.

SCO Packet Types and Slot Reservation

TypeSlot UsageIntervalVoice PayloadCoding
HV11 slotEvery 2 slots10 bytes1/3 FEC
HV21 slotEvery 4 slots20 bytes2/3 FEC
HV31 slotEvery 6 slots30 bytesNone

HV3 is the most common — reserves 1/6 of available slots (least overhead).

Multi-SCO and SCO+ACL Constraints
  • Max SCO links: HV1=1, HV2=2, HV3=3. All links in a piconet must use the same type (mixing is rejected).

  • 5-slot ACL never works with any SCO. HV3 supports asymmetric 3-slot (one dir only). HV2 supports 1-slot only.

  • At max SCO links, no ACL capacity remains. Keep SCO links below max for ACL+SCO coexistence.

SCO + ACL Packet Compatibility

When SCO is active, ACL packet type must fit in remaining slots:

SCO TypeSymmetric ACL (same both dirs)Asymmetric ACL (one dir 3-slot, other 1-slot)5-slot ACL
HV1None — DV only (0 ACL throughput)NoneNever
HV21-slot only: DH1, 2-DH1, 3-DH1Not supportedNever
HV31-slot only: DH1, 2-DH1, 3-DH1Supported: e.g., C2P=3-DH3, P2C=3-DH1Never
NoneAnyAnyAny

Key rules:

  • 5-slot types (DH5, 2-DH5, 3-DH5) never work with any SCO — always rejected

  • HV3 + 3-slot ACL works only if one direction uses 1-slot (asymmetric config)

  • HV2 + multi-slot ACL never works — even asymmetric is rejected

  • HV1 leaves no ACL capacity; toolbox substitutes DV packet (max 9 bytes, 0 ACL packets in practice)

% HV3 + asymmetric ACL — VALID
cfg.SCOPacketType = "HV3";
cfg.CentralToPeripheralACLPacketType = "3-DH3";  % 3-slot downlink
cfg.PeripheralToCentralACLPacketType = "3-DH1";  % 1-slot uplink

% HV3 + symmetric 3-slot — INVALID (runtime error)
cfg.CentralToPeripheralACLPacketType = "3-DH3";
cfg.PeripheralToCentralACLPacketType = "3-DH3";  % Error!

ACL Packet Types

TypeRateSlotsMax PayloadDescription
DM11 Mbps117 bytesBasic rate, 1-slot, 2/3 FEC
DM31 Mbps3121 bytesBasic rate, 3-slot, 2/3 FEC
DM51 Mbps5224 bytesBasic rate, 5-slot, 2/3 FEC
DH11 Mbps127 bytesBasic rate, 1-slot
DH31 Mbps3183 bytesBasic rate, 3-slot
DH51 Mbps5339 bytesBasic rate, 5-slot
2-DH12 Mbps154 bytesEDR, 1-slot
2-DH32 Mbps3367 bytesEDR, 3-slot
2-DH52 Mbps5679 bytesEDR, 5-slot
3-DH13 Mbps183 bytesEDR, 1-slot
3-DH33 Mbps3552 bytesEDR, 3-slot
3-DH53 Mbps51021 bytesEDR, 5-slot

Connection Config Properties

PropertyDefaultDescription
CentralToPeripheralACLPacketType"DH1"ACL packet type C→P
PeripheralToCentralACLPacketType"DH1"ACL packet type P→C
SCOPacketType"None"SCO type (or "None" for ACL-only)
HoppingSequenceType"Connection basic"Hopping mode
UsedChannels0:78Active channels (79 total for BR/EDR)
PollInterval40Max slots between poll requests
TransmitterPower20Tx power in dBm
SupervisionTimeout32000Timeout in slots

PHY mode consistency: Both ACL directions must use the same PHY family — either both 1 Mbps (DM/DH), both 2 Mbps (2-DH), or both 3 Mbps (3-DH). Mixing (e.g., DH5 + 3-DH1) causes a runtime error.

Statistics Structure (BR/EDR)

statistics(node).Baseband.ConnectionStats (per peer): PeerNodeName, TransmittedDataBytes, ReceivedDataBytes, TransmittedACLPackets, RetransmittedACLPackets, ReceivedACLPackets, TransmittedSCOPackets, ReceivedSCOPackets, AverageACLPacketLatency

Event Callbacks (BR/EDR)

Single-argument signature: function myCallback(eventData). Fields: eventData.EventData.LogicalTransport ("ACL"/"SCO"), eventData.EventData.PHYMode ("BR"/"EDR2M"/"EDR3M").

registerEventCallback(node, "ReceptionEnded", @myCallback);

<!-- 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