Skip to content

Commit ff7076b

Browse files
committed
feat(netif): Allow setting interface's routing priority
1 parent 3ad17de commit ff7076b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libraries/Network/src/NetworkInterface.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,15 @@ int NetworkInterface::route_prio() const {
613613
return esp_netif_get_route_prio(_esp_netif);
614614
}
615615

616+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
617+
int NetworkInterface::route_prio(int prio) {
618+
if (_esp_netif == NULL) {
619+
return -1;
620+
}
621+
return esp_netif_set_route_prio(_esp_netif, prio);
622+
}
623+
#endif
624+
616625
bool NetworkInterface::setDefault() {
617626
if (_esp_netif == NULL) {
618627
return false;

libraries/Network/src/NetworkInterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class NetworkInterface : public Printable {
5858
String impl_name() const;
5959
int impl_index() const;
6060
int route_prio() const;
61+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
62+
int route_prio(int prio);
63+
#endif
6164
bool setDefault();
6265
bool isDefault() const;
6366

0 commit comments

Comments
 (0)