mirror of
https://github.com/cesanta/mongoose.git
synced 2025-07-29 00:46:16 +08:00
Update examples to adopt to the new iface state
This commit is contained in:
parent
6957c379d5
commit
818f99b286
@ -37,7 +37,7 @@ static void timer_fn(void *arg) {
|
|||||||
gpio_put(PICO_DEFAULT_LED_PIN,
|
gpio_put(PICO_DEFAULT_LED_PIN,
|
||||||
!gpio_get_out_level(PICO_DEFAULT_LED_PIN)); // Blink LED
|
!gpio_get_out_level(PICO_DEFAULT_LED_PIN)); // Blink LED
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -21,7 +21,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
@ -43,7 +43,6 @@ static void ethernet_init(void) {
|
|||||||
RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN;
|
RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void server(void *args) {
|
static void server(void *args) {
|
||||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||||
mg_mgr_init(&mgr); // and attach it to the interface
|
mg_mgr_init(&mgr); // and attach it to the interface
|
||||||
|
@ -26,7 +26,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
gpio_toggle(LED); // Blink LED
|
gpio_toggle(LED); // Blink LED
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -21,7 +21,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
@ -43,7 +43,6 @@ static void ethernet_init(void) {
|
|||||||
RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN;
|
RCC_AHB1ENR_ETHMACEN | RCC_AHB1ENR_ETHMACTXEN | RCC_AHB1ENR_ETHMACRXEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void server(void *args) {
|
static void server(void *args) {
|
||||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||||
mg_mgr_init(&mgr); // and attach it to the interface
|
mg_mgr_init(&mgr); // and attach it to the interface
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
// All rights reserved
|
// All rights reserved
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "mongoose.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "mongoose.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
||||||
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
||||||
@ -24,7 +24,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_7); // Blink On-board blue LED
|
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_7); // Blink On-board blue LED
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
// All rights reserved
|
// All rights reserved
|
||||||
|
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "mongoose.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "mongoose.h"
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
|
|
||||||
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
||||||
@ -11,7 +11,8 @@
|
|||||||
extern void xPortSysTickHandler(void);
|
extern void xPortSysTickHandler(void);
|
||||||
void SysTick_Handler(void) {
|
void SysTick_Handler(void) {
|
||||||
HAL_IncTick();
|
HAL_IncTick();
|
||||||
// xPortSysTickHandler() must be called after vTaskStartScheduler() and mx_init() takes longer than 1ms
|
// xPortSysTickHandler() must be called after vTaskStartScheduler() and
|
||||||
|
// mx_init() takes longer than 1ms
|
||||||
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
|
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
|
||||||
xPortSysTickHandler();
|
xPortSysTickHandler();
|
||||||
}
|
}
|
||||||
@ -27,7 +28,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
// Copyright (c) 2023 Cesanta Software Limited
|
// Copyright (c) 2023 Cesanta Software Limited
|
||||||
// All rights reserved
|
// All rights reserved
|
||||||
|
|
||||||
#include "hal.h"
|
|
||||||
#include "mongoose.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "net.h"
|
|
||||||
#include "cmsis_os2.h"
|
#include "cmsis_os2.h"
|
||||||
|
#include "hal.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "mongoose.h"
|
||||||
|
#include "net.h"
|
||||||
|
|
||||||
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
||||||
|
|
||||||
|
|
||||||
void mg_random(void *buf, size_t len) { // Use on-board RNG
|
void mg_random(void *buf, size_t len) { // Use on-board RNG
|
||||||
extern RNG_HandleTypeDef hrng;
|
extern RNG_HandleTypeDef hrng;
|
||||||
for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
|
for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
|
||||||
@ -21,7 +20,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
@ -70,12 +69,13 @@ int main(void) {
|
|||||||
// Initialise random number generator
|
// Initialise random number generator
|
||||||
// Initialise ethernet pins
|
// Initialise ethernet pins
|
||||||
osKernelInitialize(); // Initialize CMSIS-RTOS
|
osKernelInitialize(); // Initialize CMSIS-RTOS
|
||||||
osThreadNew(blinker, NULL, NULL); // Create the blinker thread with a default stack size
|
osThreadNew(blinker, NULL,
|
||||||
|
NULL); // Create the blinker thread with a default stack size
|
||||||
const osThreadAttr_t server_attr = {
|
const osThreadAttr_t server_attr = {
|
||||||
.stack_size = 8192 // Create the server thread with a stack size of 8KB bytes
|
.stack_size =
|
||||||
|
8192 // Create the server thread with a stack size of 8KB bytes
|
||||||
};
|
};
|
||||||
osThreadNew(server, NULL, &server_attr);
|
osThreadNew(server, NULL, &server_attr);
|
||||||
osKernelStart(); // This blocks
|
osKernelStart(); // This blocks
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
// Copyright (c) 2023 Cesanta Software Limited
|
// Copyright (c) 2023 Cesanta Software Limited
|
||||||
// All rights reserved
|
// All rights reserved
|
||||||
|
|
||||||
#include "hal.h"
|
|
||||||
#include "mongoose.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "net.h"
|
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
|
#include "hal.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "mongoose.h"
|
||||||
|
#include "net.h"
|
||||||
|
|
||||||
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
||||||
|
|
||||||
|
|
||||||
void mg_random(void *buf, size_t len) { // Use on-board RNG
|
void mg_random(void *buf, size_t len) { // Use on-board RNG
|
||||||
extern RNG_HandleTypeDef hrng;
|
extern RNG_HandleTypeDef hrng;
|
||||||
for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
|
for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
|
||||||
@ -21,7 +20,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
@ -64,8 +63,10 @@ static void blinker(const void *args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern void mx_init(void);
|
extern void mx_init(void);
|
||||||
osThreadDef(server, osPriorityNormal, 1, 8192); // Create the server thread with a stack size of 8KB
|
osThreadDef(server, osPriorityNormal, 1,
|
||||||
osThreadDef(blinker, osPriorityNormal, 1, 0); // Create the blinker thread with default stack size
|
8192); // Create the server thread with a stack size of 8KB
|
||||||
|
osThreadDef(blinker, osPriorityNormal, 1,
|
||||||
|
0); // Create the blinker thread with default stack size
|
||||||
|
|
||||||
int main(void) { // this is not actually baremetal main() but the "main" thread
|
int main(void) { // this is not actually baremetal main() but the "main" thread
|
||||||
osKernelInitialize(); // Stop kernel
|
osKernelInitialize(); // Stop kernel
|
||||||
@ -77,4 +78,3 @@ int main(void) { // this is not actually baremetal main() but the "main" thread
|
|||||||
osKernelStart(); // Start kernel again and exit main thread
|
osKernelStart(); // Start kernel again and exit main thread
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
// Copyright (c) 2023 Cesanta Software Limited
|
// Copyright (c) 2023 Cesanta Software Limited
|
||||||
// All rights reserved
|
// All rights reserved
|
||||||
|
|
||||||
#include "hal.h"
|
|
||||||
#include "mongoose.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "net.h"
|
|
||||||
#include "cmsis_os2.h"
|
#include "cmsis_os2.h"
|
||||||
|
#include "hal.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "mongoose.h"
|
||||||
|
#include "net.h"
|
||||||
|
|
||||||
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis
|
||||||
|
|
||||||
|
|
||||||
void mg_random(void *buf, size_t len) { // Use on-board RNG
|
void mg_random(void *buf, size_t len) { // Use on-board RNG
|
||||||
extern RNG_HandleTypeDef hrng;
|
extern RNG_HandleTypeDef hrng;
|
||||||
for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
|
for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
|
||||||
@ -21,7 +20,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
@ -70,7 +69,8 @@ int main(void) {
|
|||||||
// Initialise random number generator
|
// Initialise random number generator
|
||||||
// Initialise ethernet pins
|
// Initialise ethernet pins
|
||||||
osKernelInitialize(); // Initialize CMSIS-RTOS
|
osKernelInitialize(); // Initialize CMSIS-RTOS
|
||||||
osThreadNew(blinker, NULL, NULL); // Create the blinker thread with a default stack size
|
osThreadNew(blinker, NULL,
|
||||||
|
NULL); // Create the blinker thread with a default stack size
|
||||||
const osThreadAttr_t server_attr = {
|
const osThreadAttr_t server_attr = {
|
||||||
.stack_size = 8192 // Create the server thread with a stack size of 8KB
|
.stack_size = 8192 // Create the server thread with a stack size of 8KB
|
||||||
};
|
};
|
||||||
@ -78,4 +78,3 @@ int main(void) {
|
|||||||
osKernelStart(); // This blocks
|
osKernelStart(); // This blocks
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
gpio_toggle(LED); // Blink LED
|
gpio_toggle(LED); // Blink LED
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -26,7 +26,7 @@ void mg_random(void *buf, size_t len) { // Use on-board RNG
|
|||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
gpio_toggle(LED); // Blink LED
|
gpio_toggle(LED); // Blink LED
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -25,7 +25,7 @@ uint64_t mg_millis(void) { // Let Mongoose use our uptime function
|
|||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
gpio_toggle(LED); // Blink LED
|
gpio_toggle(LED); // Blink LED
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
static void timer_fn(void *arg) {
|
static void timer_fn(void *arg) {
|
||||||
struct mg_tcpip_if *ifp = arg; // And show
|
struct mg_tcpip_if *ifp = arg; // And show
|
||||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
const char *names[] = {"down", "up", "req", "ready"}; // network stats
|
||||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||||
ifp->ndrop, ifp->nerr));
|
ifp->ndrop, ifp->nerr));
|
||||||
|
Loading…
Reference in New Issue
Block a user