Search in sources :

Example 1 with XBeeAPIPacket

use of com.digi.xbee.api.packet.XBeeAPIPacket in project JMRI by JMRI.

the class PacketGenFrame method sendButtonActionPerformed.

@Override
public void sendButtonActionPerformed(java.awt.event.ActionEvent e) {
    String packetString = packetTextField.getSelectedItem().toString();
    byte[] packetByteArray = jmri.util.StringUtil.bytesFromHexString(packetString);
    XBeeAPIPacket packet = GenericXBeePacket.createPacket(packetByteArray);
    try {
        tc.getXBee().sendPacketAsync(packet);
    } catch (XBeeException xbe) {
        log.error("Error Sending message to XBee: " + xbe);
    }
}
Also used : XBeeAPIPacket(com.digi.xbee.api.packet.XBeeAPIPacket) XBeeException(com.digi.xbee.api.exceptions.XBeeException)

Aggregations

XBeeException (com.digi.xbee.api.exceptions.XBeeException)1 XBeeAPIPacket (com.digi.xbee.api.packet.XBeeAPIPacket)1