@Override
public void onSpeedTestResult(TRTCCloudDef.TRTCSpeedTestResult result) {
String tquality = "未定义";
switch (result.quality) {
case 0: tquality = "未定义";
break;
case 1: tquality = "当前网络非常好";
break;
case 2: tquality = "当前网络比较好";
break;
case 3: tquality = "当前网络一般";
break;
case 4: tquality = "当前网络较差";
break;
case 5: tquality = "当前网络很差";
break;
case 6: tquality = "当前网络不满足 TRTC 的最低要求";
break;
}
if (result.success) {
mTextTestResult.append("测速成功!" + "\\n");
mTextTestResult.append("IP 地址:" + result.ip + "\\n");
mTextTestResult.append("上行丢包率:" + result.upLostRate + "\\n");
mTextTestResult.append("下行丢包率:" + result.downLostRate + "\\n");
mTextTestResult.append("网络延迟:" + result.rtt + "ms\\n");
mTextTestResult.append("下行带宽:" + result.availableDownBandwidth + "kbps\\n");
mTextTestResult.append("上行带宽:" + result.availableUpBandwidth + "kbps\\n");
mTextTestResult.append("网络质量:" + tquality + "\\n");
} else {
mTextTestResult.append("测速失败!" + "\\n");
mTextTestResult.append("errMsg:" + result.errMsg + "\\n");
}
}
本页内容是否解决了您的问题?