java.lang.Object | |
↳ | android.bluetooth.le.AdvertisementData.Builder |
Builder for AdvertisementData
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build the
AdvertisementData . | |||||||||||
Whether the transmission power level should be included in the advertising packet.
| |||||||||||
Set manufacturer id and data.
| |||||||||||
Add service data to advertisement.
| |||||||||||
Set the service uuids.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Build the AdvertisementData
.
IllegalArgumentException | If the data size is larger than 31 bytes. |
---|
Whether the transmission power level should be included in the advertising packet.
Set manufacturer id and data. See assigned manufacturer identifies for the existing company identifiers.
manufacturerId | Manufacturer id assigned by Bluetooth SIG. |
---|---|
manufacturerSpecificData | Manufacturer specific data - the first two bytes of the manufacturer specific data are the manufacturer id. |
IllegalArgumentException | If the manufacturerId is negative or
manufacturerSpecificData is null.
|
---|
Add service data to advertisement.
serviceDataUuid | A 16 bit uuid of the service data |
---|---|
serviceData | Service data - the first two bytes of the service data are the service data uuid. |
IllegalArgumentException | If the serviceDataUuid or serviceData is
empty.
|
---|
Set the service uuids. Note the corresponding bluetooth Gatt services need to be already added on the device before start BLE advertising.
serviceUuids | Service uuids to be advertised, could be 16-bit, 32-bit or 128-bit uuids. |
---|
IllegalArgumentException | If the serviceUuids are null.
|
---|