# Class AdvertiseData

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

public class AdvertiseData extends Object

The payload to advertise via `BluetoothLE.startAdvertising`. Keep it small -- a legacy advertisement carries at most 31 bytes; oversized payloads fail with `BluetoothError.ADVERTISE_FAILED`. Fluent setters return `this` for chaining.

Platform note: iOS only broadcasts the local name and service UUIDs -- CoreBluetooth silently ignores manufacturer data, service data and TX power inclusion when advertising (Android broadcasts everything).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AdvertiseData()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AdvertiseData`
  `addManufacturerData(int companyId, byte[] data)`
  Adds manufacturer-specific data for the given company identifier.
  `AdvertiseData`
  `addServiceData(BluetoothUuid uuid, byte[] data)`
  Adds service data for the given service UUID.
  `AdvertiseData`
  `addServiceUuid(BluetoothUuid uuid)`
  Advertises the given service UUID so filtered scans can find this peripheral.
  `Map<Integer,byte[]>`
  `getManufacturerData()`
  The manufacturer data entries, keyed by company identifier.
  `Map<BluetoothUuid, byte[]>`
  `getServiceData()`
  The service data entries, keyed by service UUID.
  `List<BluetoothUuid>`
  `getServiceUuids()`
  The service UUIDs to advertise.
  `boolean`
  `isIncludeDeviceName()`
  Whether the device name is included.
  `boolean`
  `isIncludeTxPower()`
  Whether the TX power level is included.
  `AdvertiseData`
  `setIncludeDeviceName(boolean include)`
  Includes the device name in the advertisement (off by default -- names use up scarce advertisement bytes).
  `AdvertiseData`
  `setIncludeTxPower(boolean include)`
  Includes the TX power level in the advertisement.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AdvertiseData

    public AdvertiseData()

- ## Method Details

  - ### addServiceUuid

    public AdvertiseData addServiceUuid(BluetoothUuid uuid)
    Advertises the given service UUID so filtered scans can find this peripheral.

  - ### setIncludeDeviceName

    public AdvertiseData setIncludeDeviceName(boolean include)
    Includes the device name in the advertisement (off by default -- names use up scarce advertisement bytes).

  - ### setIncludeTxPower

    public AdvertiseData setIncludeTxPower(boolean include)
    Includes the TX power level in the advertisement.

  - ### addManufacturerData

    public AdvertiseData addManufacturerData(int companyId, byte[] data)
    Adds manufacturer-specific data for the given company identifier.

  - ### addServiceData

    public AdvertiseData addServiceData(BluetoothUuid uuid, byte[] data)
    Adds service data for the given service UUID.

  - ### getServiceUuids

    public List<BluetoothUuid> getServiceUuids()
    The service UUIDs to advertise.

  - ### isIncludeDeviceName

    public boolean isIncludeDeviceName()
    Whether the device name is included.

  - ### isIncludeTxPower

    public boolean isIncludeTxPower()
    Whether the TX power level is included.

  - ### getManufacturerData

    public Map<Integer,byte[]> getManufacturerData()
    The manufacturer data entries, keyed by company identifier.

  - ### getServiceData

    public Map<BluetoothUuid, byte[]> getServiceData()
    The service data entries, keyed by service UUID.