示例#1
0
 /// <summary>
 /// Constructor. Connects with nodeManager and sets up variables.
 /// </summary>
 /// <param name="jausAddress">The JausAddress of the current component.</param>
 public JausRouter(JausAddress jausAddress, InternalEventHandler ieHandler)
 {
     this.jausAddress = jausAddress;
     this.ieHandler   = ieHandler;
     jrHandle         = 0;
     if (JuniorAPI.JrConnect((int)jausAddress.get(), "nm.cfg", ref jrHandle) != 0)
     {
         Console.WriteLine("UNABLE TO CONNECT TO THE NODE MANAGER.  IS IT RUNNING?");
     }
 }
示例#2
0
        public void updateJausID(JausAddress jausAddress, bool allowWildcards = false)
        {
            // Request to change our JAUS ID.  This means we have to close the current connection
            // to junior, and recreate it.  But first we need to stop the receive thread.
            stop();
            JuniorAPI.JrDisconnect((int)jrHandle);
            this.jausAddress = jausAddress;
            jrHandle         = 0;
            int jWildcards = allowWildcards ? 1 : 0;

            if (JuniorAPI.JrConnect((int)jausAddress.get(), "nm.cfg", ref jrHandle, jWildcards) != 0)
            {
                Console.WriteLine("UNABLE TO CONNECT TO THE NODE MANAGER.  IS IT RUNNING?");
            }

            start();
        }