diff options
| author | chenyong <[email protected]> | 2019-07-02 20:11:41 +0800 |
|---|---|---|
| committer | chenyong <[email protected]> | 2019-07-02 20:11:41 +0800 |
| commit | 48857d1e67848fa999ef6454756522fb06f42bcf (patch) | |
| tree | d36c971c44cf70d3d545f8c161dfae8e8042aaac /components/net/netdev | |
| parent | 61e4140db2427be1c4fd5d107c1069774fc3c820 (diff) | |
[net][netdev] Add FINSH_USING_MSH control for netdev network commands
Diffstat (limited to 'components/net/netdev')
| -rw-r--r-- | components/net/netdev/include/netdev.h | 3 | ||||
| -rw-r--r-- | components/net/netdev/src/netdev.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/components/net/netdev/include/netdev.h b/components/net/netdev/include/netdev.h index 71a61be3c0..25a8493a8f 100644 --- a/components/net/netdev/include/netdev.h +++ b/components/net/netdev/include/netdev.h @@ -132,10 +132,11 @@ struct netdev_ops int (*set_dns_server)(struct netdev *netdev, uint8_t dns_num, ip_addr_t *dns_server); int (*set_dhcp)(struct netdev *netdev, rt_bool_t is_enabled); +#ifdef FINSH_USING_MSH /* set network interface device common network interface device operations */ int (*ping)(struct netdev *netdev, const char *host, size_t data_len, uint32_t timeout, struct netdev_ping_resp *ping_resp); void (*netstat)(struct netdev *netdev); - +#endif }; /* The network interface device registered and unregistered*/ diff --git a/components/net/netdev/src/netdev.c b/components/net/netdev/src/netdev.c index eb2835364a..2c484f520e 100644 --- a/components/net/netdev/src/netdev.c +++ b/components/net/netdev/src/netdev.c @@ -985,7 +985,7 @@ FINSH_FUNCTION_EXPORT_ALIAS(netdev_ifconfig, __cmd_ifconfig, list the informatio #endif /* NETDEV_USING_IFCONFIG */ #ifdef NETDEV_USING_PING -static int netdev_cmd_ping(char* target_name, rt_uint32_t times, rt_size_t size) +int netdev_cmd_ping(char* target_name, rt_uint32_t times, rt_size_t size) { #define NETDEV_PING_DATA_SIZE 32 /** ping receive timeout - in milliseconds */ |
