Methods Summary |
---|
protected void | setUp()
mAdvertiseDataBuilder = new AdvertiseData.Builder();
|
public void | testEmptyData()
Parcel parcel = Parcel.obtain();
AdvertiseData data = mAdvertiseDataBuilder.build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|
public void | testEmptyManufacturerData()
Parcel parcel = Parcel.obtain();
int manufacturerId = 50;
byte[] manufacturerData = new byte[0];
AdvertiseData data =
mAdvertiseDataBuilder.setIncludeDeviceName(true)
.addManufacturerData(manufacturerId, manufacturerData).build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|
public void | testEmptyServiceData()
Parcel parcel = Parcel.obtain();
ParcelUuid uuid = ParcelUuid.fromString("0000110A-0000-1000-8000-00805F9B34FB");
byte[] serviceData = new byte[0];
AdvertiseData data =
mAdvertiseDataBuilder.setIncludeDeviceName(true)
.addServiceData(uuid, serviceData).build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|
public void | testEmptyServiceUuid()
Parcel parcel = Parcel.obtain();
AdvertiseData data = mAdvertiseDataBuilder.setIncludeDeviceName(true).build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|
public void | testManufacturerData()
Parcel parcel = Parcel.obtain();
ParcelUuid uuid = ParcelUuid.fromString("0000110A-0000-1000-8000-00805F9B34FB");
ParcelUuid uuid2 = ParcelUuid.fromString("0000110B-0000-1000-8000-00805F9B34FB");
int manufacturerId = 50;
byte[] manufacturerData = new byte[] {
(byte) 0xF0, 0x00, 0x02, 0x15 };
AdvertiseData data =
mAdvertiseDataBuilder.setIncludeDeviceName(true)
.addServiceUuid(uuid).addServiceUuid(uuid2)
.addManufacturerData(manufacturerId, manufacturerData).build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|
public void | testServiceData()
Parcel parcel = Parcel.obtain();
ParcelUuid uuid = ParcelUuid.fromString("0000110A-0000-1000-8000-00805F9B34FB");
byte[] serviceData = new byte[] {
(byte) 0xF0, 0x00, 0x02, 0x15 };
AdvertiseData data =
mAdvertiseDataBuilder.setIncludeDeviceName(true)
.addServiceData(uuid, serviceData).build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|
public void | testServiceUuid()
Parcel parcel = Parcel.obtain();
ParcelUuid uuid = ParcelUuid.fromString("0000110A-0000-1000-8000-00805F9B34FB");
ParcelUuid uuid2 = ParcelUuid.fromString("0000110B-0000-1000-8000-00805F9B34FB");
AdvertiseData data =
mAdvertiseDataBuilder.setIncludeDeviceName(true)
.addServiceUuid(uuid).addServiceUuid(uuid2).build();
data.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
AdvertiseData dataFromParcel =
AdvertiseData.CREATOR.createFromParcel(parcel);
assertEquals(data, dataFromParcel);
|