Hey all, new to the forum, but have been knocking about with Processing for a while.
I am using an Arduino based XBee network for wireless sensor data transfer. The XBee connected to the computer handles incoming 'packets'. It simply gets a packet then unpacks it. Depending on the 16 bit network address of the XBee modem that send the message, it should then evaluate whether it has spoken to it before by unpacking every node (or XBee modem) from the ArrayList and comparing it's stored address with the incoming one.
The problem starts in Line 61 below. Upon unpacking the position 0 object in the list, and then instantly printing out its address, it has already managed to gain the incoming address from the computerGateway object!
Which means that all the comparisons afterwards will always say that the current Node has already been found.
I can only imagine that there is some sort of problem in the class code for the XBee, which I will attach in the next post.
I appreciate that the stuff I'm working on is probably a bit messy and therefore confusing, but any light on why an object that I created last time through the loop, thinks that it has the properties of one that should be about to be created this time, would be really helpful!
import processing.serial.*;
Serial port;
// make an ArrayList that will store all Nodes that join the network.
ArrayList nodeList = new ArrayList();
// instead of just creating a 'Gateway' here, we can queery the local modem for it's profile then create it?