Class AdvertiseSettings

java.lang.Object
com.codename1.bluetooth.le.server.AdvertiseSettings

public class AdvertiseSettings extends Object
Options for BluetoothLE.startAdvertising. Fluent setters return this for chaining.
  • Constructor Details

    • AdvertiseSettings

      public AdvertiseSettings()
  • Method Details

    • setMode

      public AdvertiseSettings setMode(AdvertiseMode mode)
      The advertising-interval trade-off; defaults to AdvertiseMode.BALANCED.
    • setTxPower

      public AdvertiseSettings setTxPower(TxPowerLevel level)
      The transmit power; defaults to TxPowerLevel.MEDIUM.
    • setConnectable

      public AdvertiseSettings setConnectable(boolean connectable)
      Whether centrals may connect (the default) or the advertisement is broadcast-only (beacons).
    • setTimeout

      public AdvertiseSettings setTimeout(int millis)
      Stops advertising automatically after the given number of milliseconds; 0 (the default) advertises until BleAdvertisement.stop().
    • getMode

      public AdvertiseMode getMode()
      The configured advertise mode.
    • getTxPower

      public TxPowerLevel getTxPower()
      The configured transmit power.
    • isConnectable

      public boolean isConnectable()
      Whether the advertisement accepts connections.
    • getTimeout

      public int getTimeout()
      The configured timeout in milliseconds; 0 means until stopped.