@WorkerThread
T getVariable(String variableName)
throws ParticleCloudException, IOException, VariableDoesNotExistException {
if (!device.deviceState.variables.containsKey(variableName)) {
throw new VariableDoesNotExistException(variableName);
}
R reply;
try {
reply = callApi(variableName);
} catch (RetrofitError e) {
throw new ParticleCloudException(e);
}
if (!reply.coreInfo.connected) {
// FIXME: we should be doing this "connected" check on _any_ reply that comes back
// with a "coreInfo" block.
device.cloud.onDeviceNotConnected(device.deviceState);
throw new IOException("Device is not connected.");
} else {
return reply.result;
}
}
ParticleDevice.java 文件源码
java
阅读 60
收藏 0
点赞 0
评论 0
项目:xlight_android_native
作者:
评论列表
文章目录