mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #14464 from mikaleppanen/mbed_os_5_15_start_wisun_if
mbed-os-5.15: Added new start methods to Wi-SUN BR with WisunInterface parameter and deprecated the old onespull/14818/head
commit
32ecdb34b3
|
@ -86,6 +86,21 @@ public:
|
||||||
* \return MESH_ERROR_NONE on success.
|
* \return MESH_ERROR_NONE on success.
|
||||||
* \return MESH_ERROR_UNKNOWN in case of failure.
|
* \return MESH_ERROR_UNKNOWN in case of failure.
|
||||||
* */
|
* */
|
||||||
|
mesh_error_t start(WisunInterface *mesh_if, NetworkInterface *backbone_if);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Start Wi-SUN Border Router
|
||||||
|
*
|
||||||
|
* Starts Wi-SUN Border Router and routing between the mesh and backbone interfaces. Network interfaces
|
||||||
|
* must be initialized and connected before calling the start. Backbone interface can be either Ethernet
|
||||||
|
* (EMAC) or Cellular.
|
||||||
|
*
|
||||||
|
* \param mesh_if Wi-SUN mesh network interface
|
||||||
|
* \param backbone_if Backbone network interface
|
||||||
|
* \return MESH_ERROR_NONE on success.
|
||||||
|
* \return MESH_ERROR_UNKNOWN in case of failure.
|
||||||
|
* */
|
||||||
|
MBED_DEPRECATED_SINCE("mbed-os-5.15.8", "Using NetworkInterface type for mesh_if is deprecated, use WisunInterface instead")
|
||||||
mesh_error_t start(NetworkInterface *mesh_if, NetworkInterface *backbone_if);
|
mesh_error_t start(NetworkInterface *mesh_if, NetworkInterface *backbone_if);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,6 +115,21 @@ public:
|
||||||
* \return MESH_ERROR_NONE on success.
|
* \return MESH_ERROR_NONE on success.
|
||||||
* \return MESH_ERROR_UNKNOWN in case of failure.
|
* \return MESH_ERROR_UNKNOWN in case of failure.
|
||||||
* */
|
* */
|
||||||
|
mesh_error_t start(WisunInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Start Wi-SUN Border Router
|
||||||
|
*
|
||||||
|
* Starts Wi-SUN Border Router and routing between the mesh and backbone interfaces. Mesh network interface
|
||||||
|
* must be initialized and connected before calling the start. Backbone OnboardNetworkStack::Interface must
|
||||||
|
* be brought up before calling the start. Backbone interface can be either Ethernet (EMAC) or Cellular (PPP).
|
||||||
|
*
|
||||||
|
* \param mesh_if Wi-SUN mesh network interface
|
||||||
|
* \param backbone_if Backbone OnboardNetworkStack::Interface interface
|
||||||
|
* \return MESH_ERROR_NONE on success.
|
||||||
|
* \return MESH_ERROR_UNKNOWN in case of failure.
|
||||||
|
* */
|
||||||
|
MBED_DEPRECATED_SINCE("mbed-os-5.15.8", "Using NetworkInterface type for mesh_if is deprecated, use WisunInterface instead")
|
||||||
mesh_error_t start(NetworkInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if);
|
mesh_error_t start(NetworkInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,8 +40,17 @@ mesh_error_t WisunBorderRouter::start(NetworkInterface *mesh_if, NetworkInterfac
|
||||||
return MESH_ERROR_PARAM;
|
return MESH_ERROR_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
InterfaceNanostack *nano_mesh_if = reinterpret_cast<InterfaceNanostack *>(mesh_if);
|
WisunInterface *wisun_mesh_if = reinterpret_cast<WisunInterface *>(mesh_if);
|
||||||
int8_t mesh_if_id = nano_mesh_if->get_interface_id();
|
return start(wisun_mesh_if, backbone_if);
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh_error_t WisunBorderRouter::start(WisunInterface *mesh_if, NetworkInterface *backbone_if)
|
||||||
|
{
|
||||||
|
if (mesh_if == NULL || backbone_if == NULL) {
|
||||||
|
return MESH_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
int8_t mesh_if_id = mesh_if->get_interface_id();
|
||||||
if (mesh_if_id < 0) {
|
if (mesh_if_id < 0) {
|
||||||
return MESH_ERROR_UNKNOWN;
|
return MESH_ERROR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
@ -71,10 +80,24 @@ mesh_error_t WisunBorderRouter::start(NetworkInterface *mesh_if, NetworkInterfac
|
||||||
return MESH_ERROR_NONE;
|
return MESH_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mesh_error_t WisunBorderRouter::start(NetworkInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if)
|
mesh_error_t WisunBorderRouter::start(NetworkInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if)
|
||||||
{
|
{
|
||||||
InterfaceNanostack *nano_mesh_if = reinterpret_cast<InterfaceNanostack *>(mesh_if);
|
if (mesh_if == NULL || backbone_if == NULL) {
|
||||||
int8_t mesh_if_id = nano_mesh_if->get_interface_id();
|
return MESH_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
WisunInterface *wisun_mesh_if = reinterpret_cast<WisunInterface *>(mesh_if);
|
||||||
|
return start(wisun_mesh_if, backbone_if);
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh_error_t WisunBorderRouter::start(WisunInterface *mesh_if, OnboardNetworkStack::Interface *backbone_if)
|
||||||
|
{
|
||||||
|
if (mesh_if == NULL || backbone_if == NULL) {
|
||||||
|
return MESH_ERROR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
int8_t mesh_if_id = mesh_if->get_interface_id();
|
||||||
if (mesh_if_id < 0) {
|
if (mesh_if_id < 0) {
|
||||||
return MESH_ERROR_UNKNOWN;
|
return MESH_ERROR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue