Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Python (http://www.chiefdelphi.com/forums/forumdisplay.php?f=187)
-   -   pynetworktables - change IP address after initialization (http://www.chiefdelphi.com/forums/showthread.php?t=151258)

RyanN 16-09-2016 12:36

pynetworktables - change IP address after initialization
 
I know this is probably a weird request. I'm working on an application that will relay I/O between our operator interface control board and the robot.

I want to add functionality to change the robot address because I will often switch to using a simulator (localhost) and our robot (roborio-4901-frc.local). I don't want to have to restart the application to do this.

Here's how the code starts up the network table service:

NetworkTable.setIPAddress(address)
NetworkTable.setClientMode()
NetworkTable.setWriteFlushPeriod(flushPeriod=flush _period)
NetworkTable.initialize()

What happens if I call NetworkTable.setIPAddress() after initialize is called? Can I reinitialize?

Thanks,
Ryan Nazaretian

euhlmann 16-09-2016 13:31

Re: pynetworktables - change IP address after initialization
 
If it implements NetworkTable.shutdown() as the C++ ntcore api does, then yes. Call shutdown, then set the address, then initialize again.

RyanN 16-09-2016 14:21

Re: pynetworktables - change IP address after initialization
 
Quote:

Originally Posted by euhlmann (Post 1607081)
If it implements NetworkTable.shutdown() as the C++ ntcore api does, then yes. Call shutdown, then set the address, then initialize again.

It doesn't. Thanks though.

virtuald 16-09-2016 14:27

Re: pynetworktables - change IP address after initialization
 
I'm anticipating rewriting NetworkTables in the style of ntcore before the start of the 2017 season, so it'll be there then.

RyanN 16-09-2016 14:49

Re: pynetworktables - change IP address after initialization
 
Thanks for the information. I'll pick around with the code and figure out a way to accomplish this.

RyanN 28-10-2016 10:04

Re: pynetworktables - change IP address after initialization
 
virtuald has the support integrated now. :)


All times are GMT -5. The time now is 21:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi