
6 Manage devices
1
mTuyaBlueMesh
.
renameMeshSubDev
(
devBean
.
getDevId
() ,
" Device name"
,
new
2
IResultCallback
() {
3
@Override
4
public
void
onError
(
String
code
,
String
errorMsg
) {
5
}
6
@Override
7
public
void
onSuccess
() {
8
}
9
});
6.3 Connect to a mesh network and a gateway
Example
1
DeviceBean deviceBean
=
TuyaHomeSdk
.
getDataInstance
().
getDeviceBean
(
mD
2
evId
);
3
DeviceBean gwBean
=
TuyaHomeSdk
.
getDataInstance
().
getDeviceBean
(
device
4
Bean
.
getParentId
());
5
// The online status , including the status of connections to the loc
6
al mesh network and gateway
.
7
boolean
online
=
deviceBean
.
getIsOnline
()
8
// The device online status of connections to the local Bluetooth me
9
sh network
.
10
boolean
localOnline
=
deviceBean
.
getIsLocalOnline
()
11
// The device online status of connections to the gateway . The gatew
12
ay is online only when the gateway and its sub
-
devices are both onli
13
ne
.
14
boolean
wifiOnline
=
deviceBean
.
isCloudOnline
() &&
gwBean
.
getIsOnline
(
15
)
6.4 Remove a sub-device
API description
1
void
removeMeshSubDev
(
String
devId
,
IResultCallback callback
);
18 / 31