+
+libxbee / xbee module
+=====================
+
+Library
+-------
+
+xbee_dev = structure describing an xbee device
+xbee_channel = structure describing a channel, used to associates a req
+ with its answer
+
+xbee.[ch]: main interface to libxbee, creation of dev, registeration of channels
+xbee_atcmd.[ch]: get an AT command from its name or small id string
+xbee_buf.[ch]: not used
+xbee_neighbor.[ch]: helper to add/delete neighbors, use malloc()/free()
+xbee_rxtx.[ch]: parse rx frames, provides xbee_proto_xmit()
+xbee_stats.[ch]: helper to maintain stats
+
+App
+---
+
+move this in library ?
+
+xbeeapp_send(addr, data, len, timeout, cb, arg)
+XXX to detail
+
+Timeout for xbee commands
+=========================
+
+- send_atcmd or send_msg (xbee_prio)
+
+ - allocate a channel and a context
+ - fill the context with info
+ - send the message
+ - load a timeout (xbee_prio)
+
+- on timeout (xbee_prio)
+
+ - log error
+ - call the cb with retcode == TIMEOUT
+ - unregister channel
+ - remove timer
+ - this could be a critical error
+ - if it's a comm error, it's ok
+ - but if the channel is registered again and 1st callback finally occurs...
+
+- on rx (xbee_prio)
+
+ - if there is a context, it's related to a query:
+ - remove the timeout
+ - unregister channel
+ - do basic checks on the frame
+ - log (hexdump)
+ - the frame must be checked in the cb, we can provide helpers
+
+