![]() |
Morse Micro IoT SDK
2.9.7
|
Throughput measurement using iperf.
This file demonstrates how to run iperf using the Morse Micro WLAN API.
This file loads the required Wi-Fi and iperf parameters like SSID and password from the config store to initialize the wlan interface.
See Application helper routines for Wireless LAN interface for details of WLAN and IP stack configuration. Additional configuration options for this application can be found in the config.hjson file.
Definition in file iperf.c.
#include <string.h>#include "mmosal.h"#include "mmwlan.h"#include "mmconfig.h"#include "mmiperf.h"#include "mmipal.h"#include "mm_app_common.h"
Go to the source code of this file.
Macros | |
| #define | IPERF_TYPE IPERF_UDP_SERVER |
| Type of iperf instance to start. More... | |
| #define | IPERF_TIME_AMOUNT -10 |
| Duration for client transfers specified either in seconds or bytes. More... | |
| #define | IPERF_SERVER_PORT 5001 |
| Specifies the port to listen on in server mode. More... | |
Enumerations | |
| enum | iperf_type { IPERF_TCP_SERVER , IPERF_UDP_SERVER , IPERF_TCP_CLIENT , IPERF_UDP_CLIENT } |
| Iperf configurations. More... | |
Functions | |
| static uint32_t | format_bytes (uint64_t bytes, uint8_t *unit_index) |
| Function to format a given number of bytes into an appropriate SI base. More... | |
| static void | iperf_report_handler (const struct mmiperf_report *report, void *arg, mmiperf_handle_t handle) |
| Handle a report at the end of an iperf transfer. More... | |
| static void | start_tcp_client (void) |
| Start iperf as a TCP client. More... | |
| static void | start_udp_client (void) |
| Start iperf as a UDP client. More... | |
| static void | start_tcp_server (void) |
| Start iperf as a TCP server. More... | |
| static void | start_udp_server (void) |
| Start iperf as a UDP server. More... | |
| void | app_init (void) |
| Main entry point to the application. More... | |
Variables | |
| static const char | units [] = {' ', 'K', 'M', 'G', 'T'} |
| Array of power of 10 unit specifiers. More... | |
| #define IPERF_SERVER_PORT 5001 |
| #define IPERF_TIME_AMOUNT -10 |
| #define IPERF_TYPE IPERF_UDP_SERVER |
| enum iperf_type |
| void app_init | ( | void | ) |
|
static |
Function to format a given number of bytes into an appropriate SI base.
I.e if you give it 1400 it will return 1 with unit_index set to 1 for Kilo.
| [in] | bytes | Original number of bytes |
| [out] | unit_index | Index into the units array. Must not be NULL |
|
static |
|
static |
|
static |
|
static |
|
static |