IO Line Passing with Java Library

There are many example use cases for using the direct IO line passing of XBees to retrieve sensor data, but what I am trying to do is control a device rather than read a sensor. I understand that I can use Remote AT Commands to control the pins of my remote XBee, but I need the timeout feature of IO Line Passing.

Through proper configuration of an XBee connected via Sparkfun Explorer Board and a ConnectPort X2 Gateway, I have found that it is possible to pass digital signals the way I need to - but from the remote XBee to the gateway. My goal is to now reverse this process and pass digital information to the remote.

Put simply: I can use direct IO line passing to inform Java that a switch has been pressed. How do I use Java to light an LED with IO passing?

Any help is appreciated!

I found an answer to my own problem, which I will post here for others working on the same issue as I.

I’ve made use of the IR Sample Rate setting and PR Pull-up Resistors to send my signals. Instead of attempting to send a signal to my input pins, I’m changing the appropriate bits of PR so that the input pins default to high and low as needed, with automatic samples distributed by the IR setting at regular intervals.

For this project, the remote XBee is enabling a device for a specific length of time, and the primary concern is a loss of connection between local and remote XBee causing the device to remain enabled. Thus I am also using the T# settings to timeout the signal.

The full sequence of commands to send the data is thus:

  1. Ensure sample rate is 0 to prevent samples for being sent
  2. Change PR as needed for data sample
  3. Enable sample rate
  4. Wait slightly longer than the sample rate (to ensure at least one sample is sent)
  5. Disable automatic samples
  6. After a period, remote device times out.

Using the timeout to manage the duration of the signal ensures that the device controlled by the remote XBee is active for the required period and no longer.

If anyone else has found a different way of solving this problem, let me know. I hope this experience helps others who are using XBees for similar purposes!