DeviceInfo.java
2.1 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* Copyright (C) 2015 The Telink Bluetooth Light Project
*
*/
package com.telink.bluetooth.light;
import android.os.Parcel;
import android.os.Parcelable;
/**
* 设备信息类
*/
public class DeviceInfo implements Parcelable {
public static final Creator<DeviceInfo> CREATOR = new Creator<DeviceInfo>() {
@Override
public DeviceInfo createFromParcel(Parcel in) {
return new DeviceInfo(in);
}
@Override
public DeviceInfo[] newArray(int size) {
return new DeviceInfo[size];
}
};
/**
* Mac地址
*/
public String macAddress;
/**
* 设备名称
*/
public String deviceName;
/**
* 网络名称
*/
public String meshName;
/**
* 网络地址
*/
public int meshAddress;
public int meshUUID;
/**
* 设备的产品标识符
*/
public int productUUID;
public int status;
public byte[] longTermKey = new byte[16];
/**
* 设备的firmware版本
*/
public String firmwareRevision;
public DeviceInfo() {
}
public DeviceInfo(Parcel in) {
this.macAddress = in.readString();
this.deviceName = in.readString();
this.meshName = in.readString();
this.firmwareRevision = in.readString();
this.meshAddress = in.readInt();
this.meshUUID = in.readInt();
this.productUUID = in.readInt();
this.status = in.readInt();
in.readByteArray(this.longTermKey);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.macAddress);
dest.writeString(this.deviceName);
dest.writeString(this.meshName);
dest.writeString(this.firmwareRevision);
dest.writeInt(this.meshAddress);
dest.writeInt(this.meshUUID);
dest.writeInt(this.productUUID);
dest.writeInt(this.status);
dest.writeByteArray(this.longTermKey);
}
}