- (void)onSpeedTestResult:(TRTCSpeedTestResult *)result {
NSString *tquality = @"未定义";
switch (result.quality) {
case TRTCQuality_Unknown:
tquality = @"未定义";
break;
case TRTCQuality_Excellent:
tquality = @"当前网络非常好";
break;
case TRTCQuality_Good:
tquality = @"当前网络比较好";
break;
case TRTCQuality_Poor:
tquality = @"当前网络一般";
break;
case TRTCQuality_Bad:
tquality = @"当前网络较差";
break;
case TRTCQuality_Vbad:
tquality = @"当前网络很差";
break;
case TRTCQuality_Down:
tquality = @"当前网络不满足 TRTC 的最低要求";
break;
default:
break;
}
if (result.success) {
[mTextTestResult addObject:@"测速成功!\\n"];
[mTextTestResult addObject:[NSString stringWithFormat:@"IP 地址:%@ \\n", result.ip]];
[mTextTestResult addObject:[NSString stringWithFormat:@"上行丢包率:%f \\n", result.upLostRate]];
[mTextTestResult addObject:[NSString stringWithFormat:@"下行丢包率:%f \\n", result.downLostRate]];
[mTextTestResult addObject:[NSString stringWithFormat:@"网络延迟:%u ms \\n", result.rtt]];
[mTextTestResult addObject:[NSString stringWithFormat:@"下行带宽:%ld kbps \\n", (long)result.availableDownBandwidth]];
[mTextTestResult addObject:[NSString stringWithFormat:@"上行带宽:%ld kbps \\n", result.availableUpBandwidth]];
[mTextTestResult addObject:[NSString stringWithFormat:@"下行带宽:%@ \\n", tquality]];
} else {
[mTextTestResult addObject:@"测速成功!\\n"];
[mTextTestResult addObject:[NSString stringWithFormat:@"errMsg:%@ \\n", result.errMsg]];
}
}
本页内容是否解决了您的问题?