2
\$\begingroup\$

I am trying to communicate two xbee version 2, one of them coordinator and the other is end point xbee.

I have tried to write two functions namely receive and transmit.

void receive ( string &data ) {
 // construct data format with xbee id and checksum

 // ?
}

What should I write the position marked as ? in order to take data from usb ?

Operating system : Linux

Desktop edition : Ubuntu 12.04

\$\endgroup\$
1
\$\begingroup\$

Why not use a library? Andrew Rapp's XBee API (http://code.google.com/p/xbee-api/) is the best I've found so far.

\$\endgroup\$
  • \$\begingroup\$ Thank you for giving answer. Hovewer, l will use a machine with 256 mb ram. Since l do not have enough memory, l prefer to use c/c++ api. But l have not seen any. So l have tried to write my own. lf you know c/c++ api, can you share your knowledge? \$\endgroup\$ – user5140 Dec 20 '12 at 17:04
  • \$\begingroup\$ then xbee-arduino library from the same author. It's in C/C++, albeit the Arduino version of C/C++. This is not as bad as it sounds, it's generally OK but you have to adapt it to your specific serial ports. \$\endgroup\$ – Erion Dec 21 '12 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy