Hi people,
           I previously raised a question that "packets" variable of
simcore is not being accessible in Tython environment. I finally solved
that problem. It is a bug in Jython area. The __getitem__ was not
implemented in file
./tools/java/net/tinyos/sim/script/reflect/Packets.java

Just add 
*************************************************************************
 public PyObject __getitem__(PyObject key) {
        if (!(key instanceof PyInteger)) {
            return null;
        }
        else {
            PyInteger pi = (PyInteger)key;
            int mote = pi.getValue();
            Vector v = driver.getPacketLogger().getPackets(mote);
            Vector v2 = new Vector();
            for (int i = 0; i < v.size(); i++) {
          v2.addElement(new PyJavaInstance(v.elementAt(i)));
            }
            return new PyList(v2);
        }
    }


**************************************************************************


In Packets.java to get that solved!


Wr,
Giri


_______________________________________________
Tinyos-users mailing list
[EMAIL PROTECTED]
http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users

Reply via email to