org.bluez...iaEndpoint(5)

πŸ’– NAME πŸ’–

okay so bestie, this is the whole rundown on org.bluez.MediaEndpoint β€” it's the BlueZ D-Bus MediaEndpoint API documentation, and yes it's a lot but we're gonna get through it together 🫢 (also hi, this page is org.bluez...iaEndpoint(5), the MediaEndpoint one β€” don't @ me about the truncated name, that's just how the man page shows up, iykyk πŸ’…)

✨ INTERFACE ✨

okay so this interface is giving very much "here's who you are and where you live" energy. Three things, note them down πŸ“

  • Service β€” unique name (Server role) org.bluez (Client role)
  • Interface β€” org.bluez.MediaEndpoint1
  • Object path β€” freely definable (Server role) [variable prefix]/{hci0,hci1,...}/dev_{BDADDR}/sep# (Client role)
  • Used by β€” bluetoothctl-endpoint(1)

πŸŽ€ METHODS πŸŽ€

these are the actual mood of the page, so like, pay attention bestie πŸ’€

🌸 void SetConfiguration(object transport, dict properties)

Sets configuration for the transport. Like, that's the whole vibe. ✨

For client role, transport must be set with a server endpoint object which will be configured, and the properties must contain the following properties:

  • array{byte} Capabilities [Mandatory] β€” See Capabilities property.
  • array{byte} Metadata [ISO only] β€” See Metadata property.
  • dict QoS [ISO only] β€” See org.bluez.MediaTransport(5) QoS property.
bestie. there are SO many possible errors for A2DP endpoints. buckle up, no cap. πŸ’€ (all of them, exactly as they are, because I do not skip details ever)

Possible errors for A2DP endpoints:

  • org.bluez.Error.A2DP.InvalidCodecType
  • org.bluez.Error.A2DP.NotSupportedCodecType
  • org.bluez.Error.A2DP.InvalidSamplingFrequency
  • org.bluez.Error.A2DP.NotSupportedSamplingFrequency
  • org.bluez.Error.A2DP.InvalidChannelMode
  • org.bluez.Error.A2DP.NotSupportedChannelMode
  • org.bluez.Error.A2DP.InvalidSubbands
  • org.bluez.Error.A2DP.NotSupportedSubbands
  • org.bluez.Error.A2DP.InvalidAllocationMethod
  • org.bluez.Error.A2DP.NotSupportedAllocationMethod
  • org.bluez.Error.A2DP.InvalidMinimumBitpoolValue
  • org.bluez.Error.A2DP.NotSupportedMinimumBitpoolValue
  • org.bluez.Error.A2DP.InvalidMaximumBitpoolValue
  • org.bluez.Error.A2DP.NotSupportedMaximumBitpoolValue
  • org.bluez.Error.A2DP.InvalidLayer
  • org.bluez.Error.A2DP.NotSupportedLayer
  • org.bluez.Error.A2DP.NotSupportedCRC
  • org.bluez.Error.A2DP.NotSupportedMPF
  • org.bluez.Error.A2DP.NotSupportedVBR
  • org.bluez.Error.A2DP.InvalidBitRate
  • org.bluez.Error.A2DP.NotSupportedBitRate
  • org.bluez.Error.A2DP.InvalidObjectType
  • org.bluez.Error.A2DP.NotSupportedObjectType
  • org.bluez.Error.A2DP.InvalidChannels
  • org.bluez.Error.A2DP.NotSupportedChannels
  • org.bluez.Error.A2DP.InvalidVersion
  • org.bluez.Error.A2DP.NotSupportedVersion
  • org.bluez.Error.A2DP.NotSupportedMaximumSUL
  • org.bluez.Error.A2DP.InvalidBlockLength
  • org.bluez.Error.A2DP.InvalidCPType
  • org.bluez.Error.A2DP.InvalidCPFormat
  • org.bluez.Error.A2DP.InvalidCodecParameter
  • org.bluez.Error.A2DP.NotSupportedCodecParameter
  • org.bluez.Error.A2DP.InvalidDRC
  • org.bluez.Error.A2DP.NotSupportedDRC

Examples:

bluetoothctl
       > endpoint.config <endpoint> <local endpoint> [preset]

🌈 array{byte} SelectConfiguration(array{byte} capabilities)

Picks the preferable configuration from the supported capabilities. It's giving choose-your-own-adventure but for codecs πŸ¦‹

Returns a configuration which can be used to setup a transport β€” see org.bluez.MediaTransport(5) for possible values.

Note: There is no need to cache the selected configuration since on success the configuration is send back as parameter of SetConfiguration. bestie do NOT waste your time caching it, I'm begging πŸ™

πŸ’œ dict SelectProperties(dict capabilities)

Select BAP unicast configuration from the supported capabilities:

  • object Endpoint
  • array{byte} Capabilities
  • array{byte} Metadata
  • uint32 Locations
  • uint32_t ChannelAllocation
  • dict QoS
    • byte Framing
    • byte PHY
    • uint16 MaximumLatency
    • uint32 MinimumDelay
    • uint32 MaximumDelay
    • uint32 PreferredMinimumDelay
    • uint32 PreferredMaximumDelay

See MediaEndpoint Properties for their possible values.

Returns a configuration which can be used to setup a transport:

  • array{byte} Capabilities
  • array{byte} Metadata [optional]
  • dict QoS

See SetConfiguration for their possible values.

Note: There is no need to cache the selected properties since on success the configuration is send back as parameter of SetConfiguration. (again!! don't cache!! I said what I said πŸ’…)

πŸŽ€ void ClearConfiguration(object transport)

Clears transport configuration. Very "we're so over" energy.

Server role: [ISO only]

Close the stream associated with the given transport. If the path given is the path of this endpoint, all its streams are closed. (like, ALL of them, bestie β€” it's not subtle 😭)

πŸ¦‹ void Reconfigure(dict properties)

[ISO only]

Reconfigures a BAP unicast endpoint. This closes all existing streams of the endpoint, and restarts the configuration selection flow which e.g. triggers calls to SelectProperties allowing the sound server to modify the configuration. It's giving main character restart arc ✨

The following arguments are taken in properties:

  • boolean Defer [optional] β€” If True, mark endpoint for reconfiguration, but postpone it until a non-deferred Reconfigure() operation is made on an endpoint of the same device. This is necessary to use when reconfiguring source and sink streams with the intention that they be combined into the same CIG, possibly forming bidirectional CIS. (iykyk πŸ”₯)

⭐ void Release()

This method gets called when bluetoothd(8) unregisters the endpoint.

An endpoint can use it to do cleanup tasks. There is no need to unregister the endpoint, because when this method gets called it has already been unregistered. so like, don't do the work twice bestie, it's already done 🫢


πŸ¦‹ MEDIAENDPOINT PROPERTIES πŸ¦‹

the properties section, aka the accessories of this interface πŸ‘‘

πŸ’– string UUID [readonly, optional]

UUID of the profile which the endpoint is for.

πŸ’– byte Codec [readonly, optional]

Assigned number of codec that the endpoint implements.

The values should match the profile specification which is indicated by the UUID.

πŸ’– uint32_t Vendor [readonly, Optional]

Vendor-specific Company ID, Codec ID tuple that the endpoint implements.

It shall be set to appropriate value when Vendor Specific Codec (0xff) is used.

πŸ’– array{byte} Capabilities [readonly, optional]

Capabilities blob, it is used as it is so the size and byte order must match. (fr fr, do not touch it, it will not forgive you πŸ’€)

πŸ’– array{byte} Metadata [readonly, Optional]

Metadata blob, it is used as it is so the size and byte order must match. (same deal, hands off 🫢)

πŸ’– object Device [readonly, optional]

Device object which the endpoint is belongs to.

πŸ’– bool DelayReporting [readonly, optional]

Indicates if endpoint supports Delay Reporting.

πŸ’– uint32 Locations [readonly, optional, ISO only, experimental]

Indicates endpoint supported locations.

πŸ’– uint16 SupportedContext [readonly, optional, ISO only, experimental]

Indicates endpoint supported audio context.

πŸ’– uint16 Context [readonly, optional, ISO only, experimental]

Indicates endpoint available audio context.

πŸ’– dict QoS [readonly, optional, ISO only, experimental]

Indicates QoS capabilities.

  • byte Framing β€” Indicates endpoint support framing. Possible Values:
    • 0x00 β€” Unframed PDUs supported.
    • 0x01 β€” Unframed PDUs not supported.
  • byte PHY β€” Indicates endpoint preferred PHY. Possible values:
    • bit 0 β€” LE 1M preferred.
    • bit 1 β€” LE 2M preferred.
    • bit 2 β€” LE Coded preferred.
  • byte Retransmissions β€” Indicates endpoint preferred number of retransmissions.
  • uint16 MaximumLatency β€” Indicates endpoint maximum latency.
  • uint32 MinimumDelay β€” Indicates endpoint minimum presentation delay.
  • uint32 MaximumDelay β€” Indicates endpoint maximum presentation delay.
  • uint32 PreferredMinimumDelay β€” Indicates endpoint preferred minimum presentation delay.
  • uint32 PreferredMaximumDelay β€” Indicates endpoint preferred maximum presentation delay.

πŸ’– dict SupportedFeatures [readonly, ISO only, experimental]

Dictionary representing supported features for different services. Keys are service UUIDs, values arrays of strings.

Services:

  • array{string} 00001855-0000-1000-8000-00805f9b34fb β€” TMAP Features. Possible items:
    • "cg" β€” Call Gateway
    • "ct" β€” Call Terminal
    • "ums" β€” Unicast Media Sender
    • "umr" β€” Unicast Media Receiver
    • "bms" β€” Broadcast Media Sender
    • "bmr" β€” Broadcast Media Receiver
  • array{string} 00001858-0000-1000-8000-00805f9b34fb β€” GMAP Features. Possible items:
    • "ugg" β€” Unicast Game Gateway
    • "ugt" β€” Unicast Game Terminal
    • "bgs" β€” Broadcast Game Sender
    • "bgr" β€” Broadcast Game Receiver
    • "ugg-multiplex" β€” UGG Multiplex feature support
    • "ugg-96kbps-source" β€” UGG 96 kbps Source feature support
    • "ugg-multisink" β€” UGG Multisink feature support
    • "ugt-source" β€” UGT Source feature support
    • "ugt-80kbps-source" β€” UGT 80 kbps Source feature support
    • "ugt-sink" β€” UGT Sink feature support
    • "ugt-64kbps-sink" β€” UGT 64 kbps Sink feature support
    • "ugt-multiplex" β€” UGT Multiplex feature support
    • "ugt-multisink" β€” UGT Multisink feature support
    • "ugt-multisource" β€” UGT Multisource feature support
    • "bgs-96kbps" β€” BGS 96 kbps feature support
    • "bgr-multisink" β€” BGR Multisink feature support
    • "bgr-multiplex" β€” BGR Multiplex feature support

and that's the whole page bestie!! you ate that πŸ’…βœ¨ this one's from BlueZ, dated September 2023 β€” go forth and configure your endpoints, you gorgeous genius πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from