mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 06:53:52 +01:00
cpu/esp32: add NETOPT_LINK_CONNECTED in esp_eth
Support for NETOPT_LINK_CONNECTED added to esp_eth_netdev::_get
This commit is contained in:
parent
bb095e45ce
commit
12be613e63
@ -288,11 +288,18 @@ static int _esp_eth_get(netdev_t *netdev, netopt_t opt, void *val, size_t max_le
|
||||
CHECK_PARAM_RET (netdev != NULL, -ENODEV);
|
||||
CHECK_PARAM_RET (val != NULL, -EINVAL);
|
||||
|
||||
esp_eth_netdev_t* dev = (esp_eth_netdev_t*)netdev;
|
||||
|
||||
switch (opt) {
|
||||
case NETOPT_ADDRESS:
|
||||
assert(max_len == ETHERNET_ADDR_LEN);
|
||||
esp_eth_get_mac((uint8_t *)val);
|
||||
return ETHERNET_ADDR_LEN;
|
||||
case NETOPT_LINK_CONNECTED:
|
||||
assert(max_len == 1);
|
||||
*((netopt_enable_t *)val) = (dev->link_up) ? NETOPT_ENABLE
|
||||
: NETOPT_DISABLE;
|
||||
return sizeof(netopt_enable_t);
|
||||
default:
|
||||
return netdev_eth_get(netdev, opt, val, max_len);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user