ORG.BLUEZ...SOUNDING1(5)

πŸ“¦
version 5.87+2.git8750129efca8 Β· 4 versions
, in centos-stream 9

πŸ’… NAME πŸ’…

ORG.BLUEZ...SOUNDING1(5) β€” org.bluez.ChannelSounding1 β€” BlueZ D-Bus Channel Sounding API documentation. (Linux System Administration)

Bestie, this is the D-Bus API page for BlueZ Channel Sounding, and it is lowkey a whole vibe. Let's get into it. πŸ¦‹


✨ INTERFACE ✨

Okay so first, the interface tea:

  • Service β€” org.bluez
  • Interface β€” org.bluez.ChannelSounding1
  • Object path β€” [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
  • Used by β€” bluetoothctl(1), bluetoothctl-cs(1)

🫢 Methods 🫢

πŸ’– void StartMeasurement(dict params)

Starts a Channel Sounding distance measurement procedure on the connected device. All the configuration goes in one single a{sv} dictionary. Any key you leave out keeps its current value in the daemon. No cap. ✨

The device to measure is identified by the D-Bus object path you call this method on: [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX. Only one measurement per device object can be active at a time. If you call StartMeasurement while a session is already active, it returns org.bluez.Error.InProgress. Periodt.

When role is Reflector (0x02), this method does not start a CS distance measurement: a Reflector never initiates a procedure locally, so it literally cannot start one via this call. Instead, all the given configuration is applied and stored so the controller is ready to respond once a remote Initiator begins a procedure, and the method returns success without arming a local measurement session. The Active property only transitions to true when a remote-initiated procedure actually starts, which may happen well after this method returns β€” or not at all, if the remote never initiates one. Clients that watch PropertiesChanged for Active (as bluetoothctl-cs(1) does) get notified of both the remote-initiated start and its eventual stop. πŸ’«

For Initiator role (or Both), duration_secs and the device object path are the parameters that matter to start a measurement; every other key below is optional configuration with a usable default. For Reflector role, only role, sync_ant_sel and max_tx_power are required or have any effect β€” the remaining keys are accepted but otherwise unused, since no local procedure is armed. πŸŽ€

Supported dictionary keys:

  • uint32 duration_secs (default 0) β€” Duration in seconds before the measurement is stopped automatically. A value of 0 disables the automatic timeout.
  • byte role (default 0x03) β€” CS role to use for the measurement.
    • 0x01 β€” Initiator
    • 0x02 β€” Reflector
    • 0x03 β€” Both (Initiator and Reflector)
  • byte sync_ant_sel (default 0xFF) β€” CS sync antenna selection. Values 0xFE and 0xFF are reserved by the Bluetooth specification.
  • byte max_tx_power (default 0x14) β€” Maximum TX power in dBm, treated as a signed value. Valid range is -127 to +20 dBm.
  • byte create_context (default 0x01) β€” Controls where the CS configuration is written. Set to 0x00 to write the configuration only to the local Controller. Set to 0x01 to write it to both the local and remote Controllers using the CS Configuration procedure.
  • byte config_id β€” CS configuration identifier.
  • byte main_mode_type β€” Main CS mode used in the procedure.
  • byte sub_mode_type β€” Sub-mode within the main mode. Set to 0xFF when unused.
  • byte main_mode_min_steps β€” Minimum number of CS main mode steps per CS subevent.
  • byte main_mode_max_steps β€” Maximum number of CS main mode steps per CS subevent.
  • byte main_mode_repetition β€” Number of times the main mode steps are repeated in a subevent.
  • byte mode0_steps β€” Number of CS Mode 0 steps at the beginning of each subevent.
  • byte rtt_types β€” Round Trip Time measurement types for the configuration.
  • byte sync_phy β€” PHY used for CS sync packets.
    • 0x01 β€” LE 1M PHY
    • 0x02 β€” LE 2M PHY
  • array{byte} channel_map β€” 10-byte channel map bitmap. Must be exactly 10 bytes.
  • byte channel_map_repetition β€” Number of consecutive repetitions of the channel map.
  • byte channel_selection_type β€” Algorithm used for CS channel selection.
  • byte channel_shape β€” Shape used in the channel selection algorithm.
  • byte channel_jump β€” Channel jump size used in the channel selection algorithm.
  • byte companion_signal_enable β€” Set to 1 to transmit a companion signal alongside the CS tone, 0 to disable.
  • uint16 max_procedure_duration β€” Maximum duration of a single CS measurement procedure.
  • uint16 min_period_between_procedures β€” Minimum time between consecutive CS measurement procedures.
  • uint16 max_period_between_procedures β€” Maximum time between consecutive CS measurement procedures.
  • uint16 max_procedure_count β€” Maximum number of CS measurement procedures to run. A value of 0 means no limit.
  • array{byte} min_sub_event_len β€” Minimum CS subevent length as a 3-byte little-endian value. Must be exactly 3 bytes.
  • array{byte} max_sub_event_len β€” Maximum CS subevent length as a 3-byte little-endian value. Must be exactly 3 bytes.
  • byte tone_antenna_config_selection β€” Antenna configuration used for CS tone exchanges.
  • byte phy β€” PHY used during CS procedures.
    • 0x01 β€” LE 1M PHY
    • 0x02 β€” LE 2M PHY
  • byte tx_power_delta β€” Difference between remote and local TX power during CS procedures. 0x80 indicates not applicable.
  • byte preferred_peer_antenna β€” Preferred antenna to be used by the peer device.
  • byte snr_control_initiator β€” SNR control setting for the initiator role. 0xFF indicates no preference.
  • byte snr_control_reflector β€” SNR control setting for the reflector role. 0xFF indicates no preference.

Possible errors:

  • org.bluez.Error.InProgress
  • org.bluez.Error.InvalidArgs
  • org.freedesktop.DBus.Error.Failed

Examples:

bluetoothctl set role then start

[cs] > role 0x01
[cs] > main_mode_type 2
[cs] > start AA:BB:CC:DD:EE:FF

bluetoothctl start with defaults

[cs] > start [dev_addr] [duration_secs]

bluetoothctl configure as Reflector (applies settings, does not start a measurement)

[cs] > role 0x02
[cs] > start

🌈 void StopMeasurement(void)

Stops the active Channel Sounding distance measurement on this device. The device is identified by the D-Bus object path you call this method on β€” no session identifier is required. Slay, simple. πŸ’…

Raises org.bluez.Error.NotConnected if no measurement is active.

Possible errors:

  • org.bluez.Error.NotConnected
  • org.freedesktop.DBus.Error.Failed

In bluetoothctl(1), the device address argument may be omitted only when a single measurement is active; it is required when multiple measurements are active.

Examples:

bluetoothctl stop the only active measurement

[cs] > stop

bluetoothctl stop a specific device when multiple are active

[cs] > stop AA:BB:CC:DD:EE:FF

🌸 Signals 🌸

🧚 void ProcedureData(array{byte} data)

Emitted when a Channel Sounding measurement procedure completes on this device, carrying the raw CS procedure results as reported by the controller. Consumers such as an external ranging estimation daemon subscribe to this signal to compute distance estimates. Obsessed. 🫢

data is an opaque binary blob, not an introspectable D-Bus dict: every field is raw controller measurement data with no standalone meaning outside of the ranging algorithm that consumes it, so there is literally no debugging value in exposing it field-by-field at the D-Bus level. Consumers must decode it according to the fixed layout below. πŸ”₯

All multi-byte integer fields are little-endian. Signed fields are noted explicitly; all others are unsigned.

ProcedureData blob:

u16  procedureCounter
u16  procedureSequence
s8   initiatorSelectedTxPower
s8   reflectorSelectedTxPower
u32  initiatorSubeventCount
<initiatorSubeventCount> x SubeventBlob
u8   initiatorProcedureAbortReason
u32  reflectorSubeventCount
<reflectorSubeventCount> x SubeventBlob
u8   reflectorProcedureAbortReason
ProcEnableConfigBlob
CsConfigParamBlob

SubeventBlob:

u16  startAclConnEvtCounter
u16  freqComp
s8   refPwrLvl
u8   numAntPaths
u8   subeventAbortReason
u64  timestampNanos
u32  numSteps
<numSteps> x StepBlob

StepBlob:

u8   stepMode                  # 0-3, selects the payload below
u8   stepChannel
<mode payload, shape per stepMode -- see Mode*Blob below>

ModeZeroBlob (5 bytes, present when stepMode is 0):

u8   packetQuality
u8   packetRssiDbm
u8   packetAntenna
u16  initiatorMeasuredFreqOffset

ModeOneBlob (16 bytes, present when stepMode is 1):

u8   packetQuality
u8   packetNadm
u8   packetRssiDbm
s16  toaTodInitiator
s16  todToaReflector
u8   packetAntenna
s16  packetPct1_i
s16  packetPct1_q
s16  packetPct2_i
s16  packetPct2_q

ModeTwoBlob (1 + 5*numPaths bytes, present when stepMode is 2):

u8   antennaPermutationIndex
<numPaths> x { s16 toneI, s16 toneQ }
<numPaths> x u8 toneQualityIndicator

# numPaths = min(numAntPaths + 1, 5), where numAntPaths comes from
# the enclosing SubeventBlob.

ModeThreeBlob (present when stepMode is 3):

ModeOneBlob
ModeTwoBlob

ProcEnableConfigBlob (16 bytes):

u8   toneAntennaConfigSelection
u32  subeventLenUs
u8   subeventsPerEvent
u16  subeventInterval
u16  eventInterval
u16  procedureInterval
u16  procedureCount
u16  maxProcedureLen

CsConfigParamBlob (30 bytes):

u8   modeType
u8   subModeType
u8   rttType
u8[10] channelMap
u8   minMainModeSteps
u8   maxMainModeSteps
u8   mainModeRepetition
u8   mode0Steps
u8   role
u8   csSyncPhyType
u8   channelSelectionType
u8   ch3cShapeType
u8   ch3cJump
u8   channelMapRepetition
u8   tIp1TimeUs
u8   tIp2TimeUs
u8   tFcsTimeUs
u8   tPmTimeUs
u8   tSwTimeUsSupportedByLocal
u8   tSwTimeUsSupportedByRemote
u16  bleConnInterval

The total blob length is fully determined by the counts embedded in the blob itself (initiatorSubeventCount, reflectorSubeventCount, each subevent's numSteps, and each mode-two step's numAntPaths) β€” there is no separate length table to consult. πŸ’€βœ¨

πŸ’… Properties πŸ’…

Okay bestie, here’s the tea on the property this device exposes β˜•βœ¨:

  • boolean Active [readonly] β€” tells you whether a CS distance measurement procedure is currently active on this device. It’s read-only, so you can look but you cannot touch, periodt πŸ’….

So when does it flip to true? When a procedure starts β€” either because the local Initiator called StartMeasurement successfully, or because the remote Initiator enabled a CS procedure on the local Reflector. Both roads lead to true, no cap πŸ›£οΈβœ¨.

And when does it go back to false? When the procedure stops for any reason: the local application called StopMeasurement, the measurement duration timer expired, or the ACL connection was dropped. Any of those exits, and it’s false city πŸ˜­πŸ’”.

This property emits PropertiesChanged on every transition, so clients can track measurement state without polling. The way it keeps you updated automatically? Obsessed πŸ«ΆπŸ“‘.


🌈 RESOURCES 🌈

πŸ› REPORTING BUGS πŸ›

Found a bug? Don’t suffer in silence, bestie πŸ’€. Send the details to:

  • linux-bluetooth@vger.kernel.org

Big slay energy to the BlueZ crew for this page β€” source/version: BlueZ, dated June 2026 πŸ’–βœ¨. That’s the footer tea, and we are so done here πŸ‘‘πŸŽ€.

πŸ“¦ where this page comes from