Skip to content

Commit d8dfadb

Browse files
committed
ping: stop and delete session on end
1 parent 44ca1d2 commit d8dfadb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

UNOR4USBBridge/ping.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ static void ping_timeout(esp_ping_handle_t hdl, void *args) {
2525

2626
static void ping_end(esp_ping_handle_t hdl, void *args) {
2727
_stats.status = ping_status::SUCCESS;
28+
esp_ping_stop(hdl);
29+
esp_ping_delete_session(hdl);
2830
}
2931

3032
ping_statistics execute_ping(const char* address, uint8_t ttl, uint8_t count) {
@@ -73,6 +75,8 @@ ping_statistics execute_ping(const char* address, uint8_t ttl, uint8_t count) {
7375
delay(10);
7476
}
7577

78+
// session is deleted inside ping_end() callback
79+
7680
return _stats;
7781
}
7882

0 commit comments

Comments
 (0)