Skip to content

Commit 2e6dd1b

Browse files
committed
Radio.c no longer needs ping.h
1 parent e6a4e29 commit 2e6dd1b

File tree

1 file changed

+5
-6
lines changed
  • ports/raspberrypi/common-hal/wifi

1 file changed

+5
-6
lines changed

ports/raspberrypi/common-hal/wifi/Radio.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include "lwip/dns.h"
5151
#include "lwip/icmp.h"
5252
#include "lwip/raw.h"
53-
#include "lwip_src/ping.h"
5453

5554
#ifndef PING_ID
5655
#define PING_ID 0xAFAF
@@ -60,11 +59,6 @@
6059
#define PING_DEBUG LWIP_DBG_ON
6160
#endif
6261

63-
#ifdef LWIP_DEBUG
64-
static uint32_t ping_time;
65-
#endif
66-
67-
6862
#define MAC_ADDRESS_LENGTH 6
6963

7064
#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
305299
}
306300

307301
volatile bool ping_received;
302+
u16_t ping_seq_num;
303+
304+
void ping_set_target(const ip_addr_t *ping_addr);
305+
int ping_send(struct raw_pcb *raw, const ip_addr_t *addr);
308306

309307
static u8_t
310308
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)
313311

314312
if ((p->tot_len >= (PBUF_IP_HLEN + sizeof(struct icmp_echo_hdr))) &&
315313
pbuf_remove_header(p, PBUF_IP_HLEN) == 0) {
314+
uint32_t ping_time = sys_now();
316315
iecho = (struct icmp_echo_hdr *)p->payload;
317316

318317
if ((iecho->id == PING_ID) && (iecho->seqno == lwip_htons(ping_seq_num))) {

0 commit comments

Comments
 (0)