Class ShadowBluetoothLeAdvertiser

    • Field Detail

      • bluetoothLeAdvertiserReflector

        @ReflectorObject
        protected org.robolectric.shadows.ShadowBluetoothLeAdvertiser.BluetoothLeAdvertiserReflector bluetoothLeAdvertiserReflector
    • Constructor Detail

      • ShadowBluetoothLeAdvertiser

        public ShadowBluetoothLeAdvertiser()
    • Method Detail

      • __constructor__

        @Implementation(maxSdk=30)
        protected void __constructor__​(IBluetoothManager bluetoothManager)
      • __constructor__

        @Implementation(minSdk=31)
        protected void __constructor__​(BluetoothAdapter bluetoothAdapter)
      • startAdvertising

        @Implementation
        protected void startAdvertising​(AdvertiseSettings settings,
                                        AdvertiseData advertiseData,
                                        AdvertiseCallback callback)
        Start Bluetooth LE Advertising. This method returns immediately, the operation status is delivered through callback.
        Parameters:
        settings - Settings for Bluetooth LE advertising.
        advertiseData - Advertisement data to be broadcasted.
        callback - Callback for advertising status.
      • startAdvertising

        @Implementation
        protected void startAdvertising​(AdvertiseSettings settings,
                                        AdvertiseData advertiseData,
                                        AdvertiseData scanResponse,
                                        AdvertiseCallback callback)
        Start Bluetooth LE Advertising. This method returns immediately, the operation status is delivered through callback.
        Parameters:
        settings - Settings for Bluetooth LE advertising.
        advertiseData - Advertisement data to be broadcasted.
        scanResponse - Scan response associated with the advertisement data.
        callback - Callback for advertising status.
        Throws:
        IllegalArgumentException - When callback is not present.
      • getAdvertisementRequestCount

        public int getAdvertisementRequestCount()
        Returns the count of current ongoing Bluetooth LE advertising requests.