zhuguifei
2025-12-30 61eee1173c00a7ba9d9c748d28fe3acdb33b9441
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.blakequ.bluetooth_manager_lib.device;
 
import java.util.Arrays;
 
/**
 *
 */
public abstract class BeaconManufacturerData {
        private final BeaconType mBeaconType;
        private final byte[] mData;
 
    protected BeaconManufacturerData(final BeaconType expectedType, final byte[] data){
        if (BeaconUtils.getBeaconType(data) != expectedType) {
            throw new IllegalArgumentException(
                    "Manufacturer record '"
                            + Arrays.toString(data)
                            + "' is not from a " + expectedType);
        }
 
        this.mData = data;
        this.mBeaconType = expectedType;
    }
 
    public BeaconType getBeaconType(){
        return mBeaconType;
    }
 
    public byte[] getData(){
        return mData;
    }
}