Package live.ditto.transports

Types

Link copied to clipboard

How often to transmit Bluetooth LE advertisements. Higher settings will aid in faster discovery, especially when some devices are locked or running Ditto in the background, at the cost of more battery consumption.

Link copied to clipboard
enum DittoAdvertisementPower : Enum<DittoAdvertisementPower>

How much power to use when transmitting Bluetooth LE advertisements. Higher settings will achieve connections over longer distances at the cost of more battery consumption.

Link copied to clipboard
data class DittoBluetoothLeConfig(    var enabled: Boolean = false,     var advertisementPower: DittoAdvertisementPower = DittoAdvertisementPower.MEDIUM,     var advertisementInterval: DittoAdvertisementFrequency = DittoAdvertisementFrequency.HIGH,     var maxOutgoing: Int? = null,     var mtuRequest: Int? = null)
Link copied to clipboard
class DittoBluetoothManager(    val context: Context,     val dittoHandleWrapper: DittoHandle,     val config: DittoBluetoothLeConfig)

Owns the BluetoothPlatform and references to the Rust-based BLE Client and Server transports. Previously these were long-lived instances but sometimes the Android BLE stack gums up and stops reporting events properly until the app is restarted. The nuclear solution of dropping and recreating the BluetoothPlatform resolves this situation. At the expense of background support, this manager class will track disabled/enabled/background/foreground events and fully stop or start the platform accordingly.

Link copied to clipboard
data class DittoConnect(    var tcpServers: MutableSet<String> = mutableSetOf(),     var websocketUrls: MutableSet<String> = mutableSetOf(),     var retryIntervalMs: Long = 5000) : DittoConnect

Specific servers that Ditto should attempt to connect to.

Link copied to clipboard
data class DittoListen(var tcp: DittoTcpListenConfig = DittoTcpListenConfig(), var http: DittoHttpListenConfig = DittoHttpListenConfig())

Configure this device as a Ditto server. Disabled by default.

Link copied to clipboard
data class DittoPeerToPeer(    var bluetoothLe: DittoBluetoothLeConfig = DittoBluetoothLeConfig(),     var lan: DittoLanConfig = DittoLanConfig(),     var wifiAware: DittoWifiAwareConfig = DittoWifiAwareConfig())

Configuration of peer-to-peer transports, which are able to discover and connect to peers on their own.

Link copied to clipboard
class DittoSyncPermissions(context: Context?)

A utility class for identifying and requesting missing platform permissions on Android.

Link copied to clipboard
data class DittoTransportConfig(    var peerToPeer: DittoPeerToPeer = DittoPeerToPeer(),     var connect: DittoConnect = DittoConnect(),     var listen: DittoListen = DittoListen(),     var global: DittoGlobalConfig = DittoGlobalConfig()) : DittoTransportConfig

A configuration object specifying which network transports Ditto should use to sync data.

Link copied to clipboard
enum RegistrationState : Enum<RegistrationState>
Link copied to clipboard
annotation class WiFiDirectFeature
Link copied to clipboard
interface WifiDirectPlatformLeaderListener
Link copied to clipboard
interface WifiDirectPlatformPeerListener