LeUpdateParameters.java
1.89 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
89
90
91
/*
* Copyright (C) 2015 The Telink Bluetooth Light Project
*
*/
package com.telink.bluetooth.light;
import java.util.Arrays;
/**
* 更新网络参数
*
* @see LightService#updateMesh(Parameters)
*/
public final class LeUpdateParameters extends Parameters {
/**
* 创建{@link LeOtaParameters}实例
*
* @return
*/
public static LeUpdateParameters create() {
return new LeUpdateParameters();
}
/**
* 旧的网络名
*
* @param value
* @return
*/
public LeUpdateParameters setOldMeshName(String value) {
this.set(PARAM_MESH_NAME, value);
return this;
}
/**
* 新的网络名
*
* @param value
* @return
*/
public LeUpdateParameters setNewMeshName(String value) {
this.set(PARAM_NEW_MESH_NAME, value);
return this;
}
/**
* 旧的密码
*
* @param value
* @return
*/
public LeUpdateParameters setOldPassword(String value) {
this.set(PARAM_MESH_PASSWORD, value);
return this;
}
/**
* 新的密码
*
* @param value
* @return
*/
public LeUpdateParameters setNewPassword(String value) {
this.set(PARAM_NEW_PASSWORD, value);
return this;
}
/**
* LTK,如果不设置将使用厂商默认值,即{@link Manufacture#getFactoryLtk()}
*
* @param value
* @return
*/
public LeUpdateParameters setLtk(byte[] value) {
this.set(PARAM_LONG_TERM_KEY, value);
return this;
}
/**
* 更新的设备列表
*
* @param value
* @return
* @see DeviceInfo
*/
public LeUpdateParameters setUpdateDeviceList(DeviceInfo... value) {
this.set(PARAM_DEVICE_LIST, Arrays.asList(value));
return this;
}
}