![]() |
Morse Micro IoT SDK
2.9.7
|
Simple ping demonstration.
This file demonstrates how to ping a target using the Morse Micro WLAN API.
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 ping.c.
#include <string.h>#include "mmhal.h"#include "mmosal.h"#include "mmwlan.h"#include "mmconfig.h"#include "mmping.h"#include "mmipal.h"#include "mm_app_common.h"
Go to the source code of this file.
Macros | |
| #define | PING_COUNT 10 |
| Number of ping requests to send. More... | |
| #define | PING_DATA_SIZE 56 |
| Size of the ping request data, excluding 8-byte ICMP header. More... | |
| #define | PING_INTERVAL_MS 1000 |
| Interval between successive ping requests. More... | |
| #define | POST_PING_DELAY_MS 10000 |
| Delay in ms to wait before terminating connection on completion of ping. More... | |
| #define | UPDATE_INTERVAL_MS (5000) |
| Interval (in milliseconds) at which to provide updates when the receive count has not changed. More... | |
Enumerations | |
| enum | debug_state { DEBUG_STATE_INIT = 0x00 , DEBUG_STATE_BOOTING_CHIP = 0x01 , DEBUG_STATE_CONNECTING = 0x03 , DEBUG_STATE_CONNECTED = 0x02 , DEBUG_STATE_CONNECTED_IDLE = 0x00 , DEBUG_STATE_PINGING = 0x02 , DEBUG_STATE_PING_DONE = 0x03 , DEBUG_STATE_IDLE = 0x01 , DEBUG_STATE_TERMINATING = 0x00 , DEBUG_STATE_INIT = 0x00 , DEBUG_STATE_CONNECTING = 0x01 , DEBUG_STATE_CONNECTED = 0x03 , DEBUG_STATE_PINGING_0 = 0x02 , DEBUG_STATE_PING_0_DONE = 0x00 , DEBUG_STATE_WNM_SLEEP = 0x01 , DEBUG_STATE_EXITING_WNM_SLEEP = 0x03 , DEBUG_STATE_WNM_SLEEP_DONE = 0x02 , DEBUG_STATE_PINGING_1 = 0x00 , DEBUG_STATE_PING_1_DONE = 0x01 , DEBUG_STATE_WNM_SLEEP_POWER_DOWN = 0x03 , DEBUG_STATE_EXITING_WNM_SLEEP_POWER_DOWN = 0x02 , DEBUG_STATE_WNM_SLEEP_POWER_DOWN_DONE = 0x00 , DEBUG_STATE_TERMINATING = 0x01 } |
| Enumeration of debug states that will be reflected on debug pins. More... | |
Functions | |
| static void | set_debug_state (enum debug_state state) |
| Perform necessary operation (i.e., setting GPIO pins) upon entering the given debug state. More... | |
| void | app_init (void) |
| Main entry point to the application. More... | |
| #define PING_COUNT 10 |
| #define PING_DATA_SIZE 56 |
| #define PING_INTERVAL_MS 1000 |
| #define POST_PING_DELAY_MS 10000 |
| #define UPDATE_INTERVAL_MS (5000) |
| enum debug_state |
Enumeration of debug states that will be reflected on debug pins.
Note that due to limited availability of pins, the values are mapped to 2-bit codes and so are not unique. The code sequence has been chosen to be gray code like in that only one bit changes at a time, but it does not return to zero so a zero code can be used to identify the first state.
| void app_init | ( | void | ) |
|
static |
Perform necessary operation (i.e., setting GPIO pins) upon entering the given debug state.
| state | The debug state to enter. See debug_state. |