1 /** @file wifi_ping.h 2 * 3 * @brief This file provides the support for network utility ping 4 */ 5 /* 6 * Copyright 2008-2024 NXP 7 * 8 * SPDX-License-Identifier: BSD-3-Clause 9 * 10 */ 11 12 #ifndef _WIFI_PING_H_ 13 #define _WIFI_PING_H_ 14 15 #include <wmlog.h> 16 17 #define ping_e(...) wmlog_e("ping", ##__VA_ARGS__) 18 #define ping_w(...) wmlog_w("ping", ##__VA_ARGS__) 19 20 #define PING_ID 0xAFAFU 21 #define PING_INTERVAL 1000 22 #define PING_DEFAULT_TIMEOUT_SEC 2 23 #define PING_DEFAULT_COUNT 10 24 #define PING_DEFAULT_SIZE 56 25 #define PING_MAX_SIZE 65507U 26 #define PING_MAX_COUNT 65535U 27 28 /** Register Network Utility CLI commands. 29 * 30 * Register the Network Utility CLI commands. Currently, only ping command is 31 * supported. 32 * 33 * \note This function can only be called by the application after \ref 34 * wlan_init() called. 35 * 36 * \return WM_SUCCESS if the CLI commands are registered 37 * \return -WM_FAIL otherwise (for example if this function 38 * was called while the CLI commands were already registered) 39 */ 40 41 int ping_cli_init(void); 42 43 int ping(uint16_t count, int interval, unsigned short size, unsigned int r_timeout, const char *addr); 44 45 void ping_stats(int *total, int *recvd); 46 47 /** Unregister Network Utility CLI commands. 48 * 49 * Unregister the Network Utility CLI commands. 50 * 51 * \return WM_SUCCESS if the CLI commands are unregistered 52 * \return -WM_FAIL otherwise 53 */ 54 55 int ping_cli_deinit(void); 56 #endif /*_WIFI_PING_H_ */ 57