LeAutoConnectParameters.java
1.55 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
/*
* Copyright (C) 2015 The Telink Bluetooth Light Project
*
*/
package com.telink.bluetooth.light;
/**
* 自动重连参数
* <p>{@link LeAutoConnectParameters}定义了{@link LightService#autoConnect(Parameters)} 方法的必须要设置的几项参数.
*
* @see LightService#autoConnect(Parameters)
*/
public final class LeAutoConnectParameters extends Parameters {
/**
* 创建{@link LeAutoConnectParameters}实例
*
* @return
*/
public static LeAutoConnectParameters create() {
return new LeAutoConnectParameters();
}
/**
* 网络名
*
* @param value
* @return
*/
public LeAutoConnectParameters setMeshName(String value) {
this.set(PARAM_MESH_NAME, value);
return this;
}
/**
* 密码
*
* @param value
* @return
*/
public LeAutoConnectParameters setPassword(String value) {
this.set(PARAM_MESH_PASSWORD, value);
return this;
}
/**
* 是否在登录后开启打开Notification
*
* @param value
* @return
*/
public LeAutoConnectParameters autoEnableNotification(boolean value) {
this.set(PARAM_AUTO_ENABLE_NOTIFICATION, value);
return this;
}
/**
* 连接超时时间,单位秒.
*
* @param timeoutSeconds
* @return
*/
public LeAutoConnectParameters setTimeoutSeconds(int timeoutSeconds) {
this.set(PARAM_TIMEOUT_SECONDS, timeoutSeconds);
return this;
}
}