MatterEx.Transport.BLE.MockAdapter (matter_ex v0.4.0)

Copy Markdown View Source

Test adapter for BLE transport.

Uses an Agent to track all calls. Tests inject events via simulate_* functions and inspect sent data via sent_packets/1.

Summary

Functions

Check if the adapter is currently advertising.

Get current advertising data (nil if not advertising).

Get all packets sent via the TX characteristic.

Simulate a BLE connection from a commissioner.

Simulate incoming BLE data (written to RX characteristic).

Get the opts passed to start/1.

Check if the adapter has been stopped.

Functions

advertising?(agent)

Check if the adapter is currently advertising.

advertising_data(agent)

Get current advertising data (nil if not advertising).

sent_packets(agent)

Get all packets sent via the TX characteristic.

simulate_connect(agent, connection_ref \\ :mock_conn)

Simulate a BLE connection from a commissioner.

simulate_data(agent, data, connection_ref \\ :mock_conn)

Simulate incoming BLE data (written to RX characteristic).

simulate_disconnect(agent, connection_ref \\ :mock_conn)

Simulate a BLE disconnection.

start_opts(agent)

Get the opts passed to start/1.

stopped?(agent)

Check if the adapter has been stopped.