C++ interface to XBee


I want to wirelessly control my lilypad motors. Someone on this forum suggested I should look at XBee as an intefacing device. It seems that XBee is a good choice. But, before I get one I have one question.

Are their C/C++ libraries that can directlly send and receive command/data from an XBee module? My system requires me to control the motors wirelessly and also get data from some sensors wirelessly.

The software to control the motors and sensors is a C++ program that runs on a computer/laptop. I have seen Java libraries that can directly interact with the XBee over a serial connection. I am wondering if there are C++ libraries that can do the same.

regards, A

All the major programming languages have facilities for reading and writing to a serial port.

You will need two XBees. One goes with the Arduino, and sends data from, or receives data for, the Arduino.

The other get connected to the computer using this kind of device:


Your C, C++, C#, or Basic application talks to that device using the serial class appropriate for the language. The XBee then transmits the data to the other device.


This might sound like a stupid question, specially since I havent looked at the CTU interface functions.

I have some experience in sending data over a serial interface, but its mostly byte data (raw data bytes that the other party interprets). What I want to do now is slightly more complicated. For example, ask a particular XBee module (there can be more than one) what the voltage is at a particular pin (or all of its pins to make it easier).

Does the CTU library provide me with C inteface functions that let me query/set a particular XBee module. What I want to avoid is creating a packet, byte-byte, in the XBee protocol and then send it to the module.

I am not sure if I am phrasing the question clearly enough, but please bear with me.

regards, A


What I mean is something like this only in C/C++.


I have googled enough but without success. My only other option seems to be to use an Arduino board as a bridge. Send commands to the board, the board (using the XBee API) sends commands to the XBee attached to the sensors and relays the response back to the computer.

I am desparately hoping to avoid that. Any help is greatly appreciated.

regards, A

Hello everyone, I participated into this group a few minutes ago. I emergently need a C# sample code for reading the serial data comes from a wireless XBee to serially connected XBee. Any help will be appriciated.