Sorry about my poor english, I hope that your undestand
I´m new in programming with Xbee DigiMesh 2.4, i was know if is possible program the Xbee with Arduino without use a specific library. I want program just the basic commands of arduino.
My question is if I can put the packages api in the code of arduino without use a specify library, as seen in many instances citing this library http://code.google.com/p/xbee-api/
I´m thinking in put the api package directly in arduino code, it is possible?
Okay - yes, you can easily program the API frames. They are just binary strings with a block-checksum. You might want to download and look over samples like the Google code (but it is Java).
Just remember that the API port will be full-duplex, so your Arduino might send a request, and the next ‘response’ it sees is NOT the answer, but something else (a TX status, a mesh event, a request from another XBee).
Just search google for “xbee ansi c source” and you should avoid seeing the Python/Java forms.
API frames are not hard to work with.
You main problem (if you are new programmer) is designing a system where you can handle when the next response/message is important, but NOT the one you need to wait for. It means you cannot make a simple “A, then B, then C” linear program.
a rotinue to decode each command you expect to receive
somethign smart enough to detect the received messages you do NOT expect, so that they can be ignored.
If you are competent in C/C++, these shouldn’t take you more than an afternoon (or a few days). I won’t expect the basic code to be more than 2 printed pages.