Skip to main content

BluetoothConfig

Struct BluetoothConfig 

Source
pub struct BluetoothConfig {
Show 22 fields pub enabled: bool, pub interface: String, pub radio_discovery_enabled: bool, pub device_name_prefix: String, pub local_alias: String, pub connect_pan: bool, pub serve_nap: bool, pub nap_bridge: String, pub nap_bridge_addr: String, pub dhcp_enabled: bool, pub dhcp_range: Option<String>, pub dhcp_lease_time: String, pub dhcp_dns: Option<String>, pub request_dhcp: bool, pub auto_discover_peers: bool, pub poll_interval_ms: u64, pub scan_interval_ms: u64, pub peer_discovery_interval_ms: u64, pub bluetoothctl_timeout_s: u64, pub discoverable_timeout_s: u64, pub startup_timeout_ms: u64, pub peer_cleanup: PeerCleanupConfig,
}
Expand description

Bluetooth PAN link-establishment configuration.

This mechanism is intentionally narrow: it does not replace the transport layer and it does not manage pairing. Instead, it waits for a Bluetooth PAN interface to appear, then learns peer IPs from the PAN neighbor table and hands them to the daemon so the existing TCP transport and handshake logic can connect normally. Static Bluetooth peers are configured under [[peers]] with mechanism = "bluetooth".

Fields§

§enabled: bool

Enable Bluetooth PAN link monitoring. Defaults to false (opt-in).

§interface: String

Preferred PAN-facing interface name or "auto" for runtime resolution.

§radio_discovery_enabled: bool

Enable radio-level Bluetooth discovery and pairing for new peers.

§device_name_prefix: String

Prefix used to identify PIM peers by Bluetooth device name.

§local_alias: String

Local Bluetooth controller alias to advertise. Empty means derived from node name.

§connect_pan: bool

Allow outbound PAN/NAP connection attempts to discovered peers.

§serve_nap: bool

Start and supervise a local Linux NAP server process.

§nap_bridge: String

Linux bridge/interface to expose through the local NAP server.

§nap_bridge_addr: String

IPv4 address/CIDR assigned to nap_bridge when the daemon manages it.

§dhcp_enabled: bool

Run a daemon-supervised DHCP server on nap_bridge when serving NAP.

§dhcp_range: Option<String>

Explicit DHCP range (start,end). When unset, derived from nap_bridge_addr.

§dhcp_lease_time: String

DHCP lease time passed to dnsmasq (e.g. "12h", "infinite").

§dhcp_dns: Option<String>

Comma-separated DNS server list advertised to DHCP clients. When unset, inherited from the host’s /etc/resolv.conf at runtime.

§request_dhcp: bool

Automatically request DHCP on the resolved PAN interface when acting as a Linux PAN client (connect_pan = true, serve_nap = false).

§auto_discover_peers: bool

Automatically discover peer IPs from the PAN interface neighbor table.

§poll_interval_ms: u64

Poll interval used while waiting for the PAN interface to become ready.

§scan_interval_ms: u64

Poll interval used for radio-level device scans.

§peer_discovery_interval_ms: u64

Poll interval used for automatic peer discovery after the interface is ready.

§bluetoothctl_timeout_s: u64

Timeout for bluetoothctl operations, in seconds.

§discoverable_timeout_s: u64

How long the controller remains discoverable after startup.

§startup_timeout_ms: u64

Maximum time to wait for the PAN interface to appear before giving up.

§peer_cleanup: PeerCleanupConfig

Periodic cleanup of unreachable PAN-paired peers — see PeerCleanupConfig. Bluetooth-flavoured defaults (2 h / 1 h). The destructive action is bluetoothctl remove <bd_addr>. Coordinates with [bluetooth_rfcomm.peer_cleanup] via the BlueZ Connected check so an active session in either subsystem suppresses the unpair.

Trait Implementations§

Source§

impl Clone for BluetoothConfig

Source§

fn clone(&self) -> BluetoothConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BluetoothConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BluetoothConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for BluetoothConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for BluetoothConfig

Source§

fn eq(&self, other: &BluetoothConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BluetoothConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BluetoothConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,