
8 Control devices and groups
1
mTuyaBlueMeshDevice
.
registerMeshDevListener
(
new
IMeshDevListener
() {
2
/**
3
* Data is updated .
4
* @param nodeId
The value of `nodeId ` for the device .
5
* @param dps
DP data.
6
* @param isFromLocal
The data source . Valid values : `true ` to indi
7
cate the local Bluetooth mesh network , and `false ` to indicate the c
8
loud.
9
*/
10
@Override
11
public
void
onDpUpdate
(
String
nodeId
,
String
dps
,
boolean
isFromLocal
12
) {
13
// Returns `DeviceBean ` by using `node `.
14
DeviceBean deviceBean
=
mTuyaBlueMeshDevice
.
getMeshSubDevBeanByNodeI
15
d
(
nodeId
);
16
}
17
/**
18
* Reports the device status .
19
* @param online
The list of online devices .
20
* @param offline
The list of offline devices .
21
* @param gwId
The source of the status . If `gwId ` is not empty ,
22
the cloud returns the status . `gwId ` indicates the ID of the gatewa
23
y that reports the data. If `gwId ` is empty , the local Bluetooth mes
24
h network returns the status .
25
*/
26
@Override
27
public
void
onStatusChanged
(
List
<
String
>
online
,
List
<
String
>
offlin
28
e
,
String
gwId
) {
29
}
30
/**
31
* The changed network status .
32
* @param devId
33
* @param status
34
*/
35
@Override
36
public
void
onNetworkStatusChanged
(
String
devId
,
boolean
status
) {
37
}
38
/**
39
* Reports the Raw type of data.
40
* @param bytes
41
*/
42
@Override
43
public
void
onRawDataUpdate
(
byte
[]
bytes
) {
44
}
45
/**
46
* The changes of device information , such as the device name.
47
* @param bytes
48
*/
49
@Override
50
public
void
onDevInfoUpdate
(
String
devId
) {
51
}
52
/**
53
* The device is removed .
54
* @param devId
55
*/
56
@Override
57
public
void
onRemoved
(
String
devId
) {
58
}
59
});
30 / 31