Snippet - Simple XBee Class

Simple XBee Class

This simple XBee class encapsulates the sending and receiving of messages. With a constructor that takes enums and a simple event for receiving messages this class is a quick way to get into XBee communication.

You have to make sure you correctly connect the Tx and Rx pins of the XBee to the COM port you want to use on the host device. You also need to verify that you have the 2 XBee radios setup with the same PAN and speed settings or else they will not communicate with each other.

I have used the same class file successfully with a FEZ-Mini, FEZ-Panda II, and a CeruinoBee (both in NETMF and Gadgeteer projects).


I wanted to say this is an excellent class that I’m going to use in my next project, but I wanted to let you know the usage example is missing baud:

should be something like

```cs] xbee = new PintSize.SPOT.Hardware.XBee(PintSize.SPOT.Hardware.XBee.COMS.COM1, PintSize.SPOT.Hardware.XBee.Bauds.B6_38400 );[/code

Not a big deal or hard to figure out, but I though you might want to know.