lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] [EXTERNAL] 2 Devices


From: Xiaomin Lin
Subject: Re: [lwip-users] [EXTERNAL] 2 Devices
Date: Tue, 7 Nov 2017 14:20:15 +0000

Hi, 

I am doing similar thing. I think I will use one thread to collect data from 
multiple devices and feed them to corresponding netif->input.
Don't feed data directly to tcpip_input, if you do so, make sure you pass the 
right netif to it. Anyway make sure you have two individual netif.

For UDP, I believe you can bind with IP_ANY to listen on same port on all 
devices. In UDP recv callback, you can find the source IP in the parameters.

Are you working on something like a router? If so, what protocol you are 
working on and do you have any code resources to share, please?

xiaomin

-----Original Message-----
From: lwip-users [mailto:address@hidden On Behalf Of Fabian Cenedese
Sent: Tuesday, November 07, 2017 5:16 AM
To: address@hidden
Subject: [EXTERNAL] [lwip-users] 2 Devices

External Sender: Use caution with links/attachments.



Hello

I'm trying to implement 2 physical devices with LwIP.
This is what I have so far:

"One" LwIP (functions and global variables) One tcpip_thread Twice netif_add() 
and netif_set_up() Two threads to read the frames from the PHY and giving it to 
LwIP with tcpip_input

One PHY is working correctly but the second is not.
Somehow the frames from 1 end up in the handling from PHY 0 (recv or send).

Is my general way to go correct? Can this work with same IP addresses (of 
course not in the same network) or is the IP address/network mask needed to 
determine the outgoing interface?

With different IP addresses: Can I have one udp socket for each device bound to 
the same port?
If I can bind only one socket to one port, how can I handle frames incoming 
from two devices and send the replies with the correct (same) outgoing device?

Thanks

bye  Fabi


_______________________________________________
lwip-users mailing list
address@hidden
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.nongnu.org_mailman_listinfo_lwip-2Dusers&d=DwICAg&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=e0JI4-Gk-QH7t_Vo8wSGrulspk1hetLqNZfo7xaKCMo&m=Uya5pDzN7kdUxlvJR5FDEmJD6lNFSrhRUOmjPPrbXxo&s=2V2v0pPrbAtLkmUi_Lq4YlQjnqHW12Y7qHHnoE-VIAo&e=

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]