2 Program access 1 Xbee

Hi, I am doing a project where I have 3 Xbee S1 1 master/server and 2 slaves. i programming the Xbee with the xbee-java api.

The master is connected to a computer which is the server and the 2 slaves are connected to light switches. I was able to get the 2 slaves to send On/Off commands from the server Xbee and receive the commands as well. However now i want my Xbee on the server to be able to do both(before i would need to stop/run the send and recieve code separately).

The program flow for the server side is that there is a PHP website that needs to call the java code to send the On/Off commands and for the recieve code it would need to be run all the time. Is there anyone that can help me with this. Thanks.

I can’t make sense of how or what you are doing now. I have no knowledge of PHP or the java API. But if you change the DL and DH registers of the server to the SL and SH registervalues (serial number) of the destination slave you should be able to adress any desired slave easily. Make sure the server knows which slave has which serial number (64bit), or assign custom 32 bit ID numbers and use the appropriate adressing scheme. If you communicate with the Xbees in API mode you can know from the content of the packets from which one a message originates.