Commit b53623d
committed
examples/usercmodule/iperf3_lwip: Refactor to unified transfer() API.
Implemented unified transfer() function with mode parameter to work around
3-function module globals table limit on OpenMV N6:
- transfer('tcp_client', host, port, duration): TCP client mode
- transfer('tcp_server', port, duration): TCP server mode
- transfer('udp_client', host, port, duration, bandwidth): UDP client
- transfer('udp_server', port, duration): UDP server
Also supports integer mode codes (0-3) for simplified API.
Added UDP support with iperf3-compatible packet format:
- 12-byte header: sec, usec, seq in network byte order
- RFC 1889 jitter calculation
- Packet loss detection from sequence gaps
- Bandwidth limiting via inter-packet delay
Tested on OpenMV N6 (STM32N657 @ 800MHz):
- Module boots successfully with unified API
- TCP modes confirmed working (previously 474 Mbits/sec)
- UDP modes implemented, testing pending
Resolves 3-function module limit documented in CLAUDE.local.md.
Signed-off-by: Andrew Leech <[email protected]>1 parent 91ec922 commit b53623d
1 file changed
+349
-24
lines changed
0 commit comments