MeterLogger
ping.h
Go to the documentation of this file.
1 /*
2  * ESPRSSIF MIT License
3  *
4  * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5  *
6  * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
7  * it is free of charge, to any person obtaining a copy of this software and associated
8  * documentation files (the "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11  * to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or
14  * substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef __PING_H__
26 #define __PING_H__
27 
28 
29 typedef void (* ping_recv_function)(void* arg, void *pdata);
30 typedef void (* ping_sent_function)(void* arg, void *pdata);
31 
32 struct ping_option{
33  uint32 count;
34  uint32 ip;
38  void* reverse;
39 };
40 
41 struct ping_resp{
42  uint32 total_count;
43  uint32 resp_time;
44  uint32 seqno;
45  uint32 timeout_count;
46  uint32 bytes;
47  uint32 total_bytes;
48  uint32 total_time;
49  sint8 ping_err;
50 };
51 
52 bool ping_start(struct ping_option *ping_opt);
53 bool ping_regist_recv(struct ping_option *ping_opt, ping_recv_function ping_recv);
54 bool ping_regist_sent(struct ping_option *ping_opt, ping_sent_function ping_sent);
55 
56 #endif /* __PING_H__ */
bool ping_regist_recv(struct ping_option *ping_opt, ping_recv_function ping_recv)
void(* ping_sent_function)(void *arg, void *pdata)
Definition: ping.h:48
ping_recv_function recv_function
Definition: ping.h:54
ping_sent_function sent_function
Definition: ping.h:55
uint32 ip
Definition: ping.h:52
uint32 count
Definition: ping.h:51
uint32 coarse_time
Definition: ping.h:53
unsigned int uint32
Definition: c_types.h:54
void * reverse
Definition: ping.h:56
Definition: ping.h:70
void(* ping_recv_function)(void *arg, void *pdata)
Definition: ping.h:47
signed char sint8
Definition: c_types.h:47
bool ping_start(struct ping_option *ping_opt)
bool ping_regist_sent(struct ping_option *ping_opt, ping_sent_function ping_sent)