Radio.c no longer needs ping.h
This commit is contained in:
parent
e6a4e2982f
commit
2e6dd1bf1f
@ -50,7 +50,6 @@
|
|||||||
#include "lwip/dns.h"
|
#include "lwip/dns.h"
|
||||||
#include "lwip/icmp.h"
|
#include "lwip/icmp.h"
|
||||||
#include "lwip/raw.h"
|
#include "lwip/raw.h"
|
||||||
#include "lwip_src/ping.h"
|
|
||||||
|
|
||||||
#ifndef PING_ID
|
#ifndef PING_ID
|
||||||
#define PING_ID 0xAFAF
|
#define PING_ID 0xAFAF
|
||||||
@ -60,11 +59,6 @@
|
|||||||
#define PING_DEBUG LWIP_DBG_ON
|
#define PING_DEBUG LWIP_DBG_ON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
|
||||||
static uint32_t ping_time;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define MAC_ADDRESS_LENGTH 6
|
#define MAC_ADDRESS_LENGTH 6
|
||||||
|
|
||||||
#define NETIF_STA (&cyw43_state.netif[CYW43_ITF_STA])
|
#define NETIF_STA (&cyw43_state.netif[CYW43_ITF_STA])
|
||||||
@ -305,6 +299,10 @@ void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv
|
|||||||
}
|
}
|
||||||
|
|
||||||
volatile bool ping_received;
|
volatile bool ping_received;
|
||||||
|
u16_t ping_seq_num;
|
||||||
|
|
||||||
|
void ping_set_target(const ip_addr_t *ping_addr);
|
||||||
|
int ping_send(struct raw_pcb *raw, const ip_addr_t *addr);
|
||||||
|
|
||||||
static u8_t
|
static u8_t
|
||||||
ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) {
|
ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) {
|
||||||
@ -313,6 +311,7 @@ ping_recv(void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr)
|
|||||||
|
|
||||||
if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) &&
|
if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) &&
|
||||||
pbuf_remove_header(p, PBUF_IP_HLEN) == 0) {
|
pbuf_remove_header(p, PBUF_IP_HLEN) == 0) {
|
||||||
|
uint32_t ping_time = sys_now();
|
||||||
iecho = (struct icmp_echo_hdr *)p->payload;
|
iecho = (struct icmp_echo_hdr *)p->payload;
|
||||||
|
|
||||||
if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) {
|
if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user