|
|
@@ -6,8 +6,7 @@
|
|
|
@date 2025.02.14
|
|
|
@tag LUAT_USE_IPERF
|
|
|
@usage
|
|
|
--- 本库仅部分模组固件已添加
|
|
|
--- 当前仅支持server模式, client模式未添加
|
|
|
+-- 支持server模式, 也支持client模式
|
|
|
*/
|
|
|
|
|
|
#include "luat_base.h"
|
|
|
@@ -108,10 +107,15 @@ static int start_gogogo(int adpater_id, int is_server, const ip_addr_t* remote_i
|
|
|
@return boolean 成功返回true, 失败返回false
|
|
|
@usage
|
|
|
-- 启动server模式, 监听5001端口
|
|
|
+-- 注意, 该网卡必须已经联网成功, 并且有ip地址
|
|
|
if iperf then
|
|
|
log.info("启动iperf服务器端")
|
|
|
iperf.server(socket.LWIP_ETH)
|
|
|
end
|
|
|
+-- 测试结果回调
|
|
|
+sys.subscribe("IPERF_REPORT", function(bytes, ms_duration, bandwidth)
|
|
|
+ log.info("iperf", bytes, ms_duration, bandwidth)
|
|
|
+end)
|
|
|
*/
|
|
|
static int l_iperf_server(lua_State *L) {
|
|
|
if (iperf_session != NULL) {
|
|
|
@@ -134,6 +138,7 @@ static int l_iperf_server(lua_State *L) {
|
|
|
@return boolean 成功返回true, 失败返回false
|
|
|
@usage
|
|
|
-- 启动client模式, 连接服务器的5001端口
|
|
|
+-- 注意, 该网卡必须已经联网成功, 并且有ip地址
|
|
|
if iperf then
|
|
|
log.info("启动iperf客户端端")
|
|
|
-- 47.94.236.172 是演示服务器, 不一定有开启
|