Kevin,
I don't know if I've understood youre question very
well, but as u can see below I have this piece of code in
Main methode , and actually I've put it in a for loop and
I repeat it for diffrent values of sfportStr and packetSourceString.
Once I create the MoteIF object I pass it to another object
which is a thread and implements messageListener .
So the idea is to create,first, different Serial Forwarders on different
ports on this machine which connect to different packetsources,
theses packet sources might be serial ports on this machine or
Serial Forwarders on the other machines.
Afetr, I pass each serial forwareder that I creat on this machine
to a MoteIF and this MoteIf is passed to a thread which Listens
to the message of the mote associated to the moteIF.
Is that clear, or should I explain more..?
Thanks,
B.
> > > Hi,
> > >
> > > I'm using T2.
> > > I am trying to run a serial forwarder in a java programm,as below:
> > >
> > >
> > >
> > > try {
> > > Process p = null;
> > > int n=0;
> > > String SFCREATINGCMDL ="java net.tinyos.sf.SerialForwarder -port
> "+sfportStr+"
> > > -comm "+packetSourceString;
> > >
> > > p = Runtime.getRuntime().exec(SFCREATINGCMDL);
> > >
> > > }
> > >
> > > catch(Exception ex)
> > > {
> > > ex.printStackTrace();
> > > }
> > >
> > > PacketSource ps = BuildSource.makePacketSource(sfserver);
> > > PhoenixSource
> source=BuildSource.makePhoenix(ps,PrintStreamMessenger.err);
> > > source.start();
> > > MoteIF mif = new MoteIF(source);
> > >
> > > Where sfportStr is a numer like 9003 and packetSourceString is an
> expression
> > > like serial@/dev/ttyUSB0:57600 and sfserver is an expression like
> > > :sf at lca2-s1-pc3:9003
> > >
> > > So the thing is that I can see a sf window pop up after running the
> command
> > > but programm stops when it arrives to MoteIF creation and exits
> with
> > > this message:
> > >
> > >
> > > sf at lca2-s1-pc3:9003
> > > sf at lca2-s1-pc3:9003 died - exiting (java.net.ConnectException:
> Connection
> > > refused)
> > >
> > > I don't have another sf running on the same port and the bizarre
> thing is if
> > > I write the same expression as SFCREATINGCMDL in a console it
> works,and I will
> > > have no problem for creating MoteIF ,I've checked lot of times the
> expression
> > > SFCREATINGCMDL,and i've even printed using println ,and I think
> it's
> > > correct .
> > >
> > >
> > >
> > > Any ideas?
> > > B.
> > > _______________________________________________
> > > Tinyos-help mailing list
> > > [email protected]
> > >
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> >
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
>
> --
> ~Kevin
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help