How xNetworkInterfaceInitialise works when multiple network controllers are active?


I have a case where there are more than one active network controllers. And it’s configurable from the upper layers which one to use. Can someone clarify how FreeRTO_IPInit and xNetworkInterfaceInitialise works when there are more than one active network controller?

I have the Device and Vendor ID for the controller to use, but when calling FreeRTOS_IPInit (which down the line calls xNetworkInterfaceInitialise) I don’t see an option to pass DID and VID for controller to be used. So, how can I approach this?

I see couple of links saying multiple interface support being worked on. Is it currently released?

  1. FreeRTOS+TCP multiple network interfaces support
  2. FreeRTOS+TCP multiple network interfaces request


There is no simple way of doing this in the single interface version as FreeRTOS_IPInit() is going to call xNetworkInterfaceInitialise() regardless. Therefore probably the easiest thing to do would be to add the logic into that function. So create a function called xNetworkInterfaceInitialise() that then checks which network controller it is supposed to be used, and then call the appropriate initialise function.

You can find preliminary information on the multi-interface version here: FreeRTOS+TCP Multiple Interfaces - FreeRTOS - there is a link to the code at the blue box at the top of that page.

Thanks @rtel.

I can try implementing the wrapper xNetworkInterfaceInitialise() logic to diverge between two network interfaces.

Thanks for the pointer on Multiple interfaces support.