Home/Support/Support Forum/How can I use "uart_write" and "uart_read" to exchange data between Xbee programmable modules?

How can I use "uart_write" and "uart_read" to exchange data between Xbee programmable modules?

0 votes
I'm trying to implement the Dorbell example from Faluti's Book. But, in my case, I using 2 xbee programmable boards.

OK, I understood the example using arduino, but it has been hard to understand how the freescale microcontroller interacts with the xbee module.

I have been reading the Programming Guide <http://xbee-sdk-doc.readthedocs.org/>, but sometimes I fell lost.


Thanks
asked Feb 6, 2015 in XBee Programmable Development by tonofre New to the Community (6 points)

Please log in or register to answer this question.

2 Answers

0 votes
Try using the Help file found within the SDK. It has examples on how to use the different Write and Read functions. For example:
int radio_uart_config ( uint32_t baudrate,
uint8_t config
)
size_t uart_read ( void * buf,
size_t len
)
size_t uart_write ( const void * buf,
size_t len
)
answered Mar 3, 2015 by mvut Veteran of the Digi Community (11,755 points)
0 votes
Hi,

Doorbell is a good practical project to get going with! To get started, I'd recommend you to check out how the XBEE Transparent serial interface endpoint works ( http://exsilium.github.io/xbee-sdk-doc/group__xbee__transparent.html ). The following examples in the Codewarrior should help you get started:

The doorbell button
- WPAN / ZigBee / Transmit basic frames - Although the example is very easy, it shows how to send a frame using the transparent serial interface. Instead of sending the frame every second, tie this to your button press logic.
- Power Management / ZigBee / Wake up on packet receiving and on gpio press for transmitting. This example illustrates well how your doorbell button can be in sleep mode to save battery (it is probably planned to be a battery operated button, right?).

The receiver/coordinator:

- WPAN / ZigBee / Basic frame reception - this example shows you how to process incoming frames. Even running this example as is, it should make the received frames show up on the serial interface as printouts. Just make sure you put the coordinator and the end-device to the same network.

Good luck and cheers!
answered Mar 6, 2015 by exile Community Contributor (92 points)
...