Skip to content

Commit 5cc5260

Browse files
committed
ping: make handle static
1 parent f77bdd8 commit 5cc5260

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UNOR4USBBridge/ping.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// one ping session can be performed
1212

1313
static ping_statistics _stats;
14+
static esp_ping_handle_t esp_ping_handle = nullptr;
1415

1516
static void ping_success(esp_ping_handle_t hdl, void *args) {
1617
uint32_t elapsed_time;
@@ -69,9 +70,8 @@ ping_statistics execute_ping(const char* address, uint8_t ttl, uint8_t count) {
6970

7071
_stats.status = ping_status::RUNNING;
7172

72-
esp_ping_handle_t ping; // FIXME do I need this?
73-
esp_ping_new_session(&ping_config, &cbs, &ping);
74-
esp_ping_start(ping);
73+
esp_ping_new_session(&ping_config, &cbs, &esp_ping_handle);
74+
esp_ping_start(esp_ping_handle);
7575

7676
// wait for the end of ping session
7777
while(_stats.status == ping_status::RUNNING) {

0 commit comments

Comments
 (0)