Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating the function setStaticIP #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joaquinbvw
Copy link

I am currently working on a project and needed a function to change the network configuration while the Tiva was active and because of local requeriments we can't use a DHCP server, so I checked the lwiplib library and found the lwIPNetworkConfigChange function and decide to add that functionality to my local Ethernet library. I think this could be a useful function, I saw some people on the internet asking for such functionality.

I am currently working on a project and needed a function to change the network configuration while the Tiva was active and because of local requeriments we can't use a DHCP server, so I checked the lwiplib library and found the lwIPNetworkConfigChange function and decide to add that functionality to my local Ethernet library. I think this could be a useful function, I saw some people on the internet asking for such functionality.
I am currently working on a project and needed a function to change the network configuration while the Tiva was active and because of local requeriments we can't use a DHCP server, so I checked the lwiplib library and found the lwIPNetworkConfigChange function and decide to add that functionality to my local Ethernet library. I think this could be a useful function, I saw some people on the internet asking for such functionality.
@robertinant
Copy link
Member

robertinant commented Jan 26, 2017

There is are Ethernet.begin() member functions that allows you to configure a static IP address.

void begin(IPAddress local_ip, IPAddress dns_server) { begin(0, local_ip, dns_server); };
void begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway) { begin(0, local_ip, dns_server, gateway); };
void begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet) { begin(0, local_ip, dns_server, gateway, subnet); };

@robertinant
Copy link
Member

I just read the comment again and if I understand correctly, you need to change to static after you detect that a DHCP address is not provided indicating to switch to static?

@robertinant
Copy link
Member

In reviewing the pull request, I noticed that the DNS server is missing in the proposed API's. Is there a reason for not including DNS server(s) in the configuration?

@robertinant
Copy link
Member

I think this is a great addition if we could have it follow:

setStaticIP(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)

@joaquinbvw
Copy link
Author

joaquinbvw commented Jan 31, 2017

Hello robertinant. Yes, this feature is only for those cases that don't have a DHCP server (and I saw on the internet that I'm not the only one with this particular setting). On the other hand, I'm not sure if there is a way to detect the presence of a DHCP server from the Tiva itself, do you mean that is better to include the detection of the DHCP server inside this function? I think this detection should be made outside, since the only job for the function is to change the network configuration.

Also you're right, I forgot to include the DNS address. I will do this and post the changes after that.

Thank you for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants