[net][netdev] Add FINSH_USING_MSH control for netdev network commands

This commit is contained in:
chenyong
2019-07-02 20:11:41 +08:00
parent 61e4140db2
commit 48857d1e67
5 changed files with 21 additions and 8 deletions
+2 -1
View File
@@ -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*/
+1 -1
View File
@@ -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 */