Page 1 of 1
IP Adresses in AP/STA mode
Posted: Sat Jan 06, 2018 4:49 am
by tangray
Does anybody know ? When working in AP/STA mode how do a force a socket to be connected on either the STA or the AP net. Does LWIP maintain a routing table for each interface. Even then how do I send a broadcast on one or the other . I seem to be missing somehing at the socket bind stage of the API, I feel that I should be telling the socket which interface to use and I can find where to do this in the API call. Maybe in the struct sockaddr_in ???. Thanks .
Re: IP Adresses in AP/STA mode
Posted: Sat Jan 06, 2018 12:48 pm
by tangray
Well I seem to have solved this.
Basically one needs to maintain 2 Host IP address one for each interface. When the AP is configured it is assigned and IP address of ones choosing and the STA receives and IP adr by DHCP (normally). In AP/STA mode these need to be managed seperately. The LWIP stack tracks and routes TX packets to the corrrect interface by this address.
Re: IP Adresses in AP/STA mode
Posted: Sat Jan 06, 2018 3:00 pm
by cmorgan
Are you receiving connections or connecting outwardly? When receiving you'll specify the address to listen to when you call bind().
On outgoing connections I'm a bit less sure how that works. I'd be interested in seeing some code to show what you mean and how you've resolved the issue.