int xbee_senddata(xbee_con *con, char *format, ...);
int xbee_nsenddata(xbee_con *con, char *data, int length);
#include <stdarg.h>
int xbee_vsenddata(xbee_con *con, char *format, va_list ap);
The argument con points to a connection made previously with xbee_newcon().
The format string and any following parameters are passed to sprintf() within these functions. Please see the printf(3) man page for more information.
If you are using xbee_nsenddata() you must provide a character array of the data, and the data's length.
If you are using xbee_vsenddata() you must provide a va_list. See stdarg(3).
If an invalid packet or connection was provided, -1 is returned.
If an unknown error occured, -2 is returned.
If con has waitforACK enabled, then these functions return 1 when an ACK was not recieved within 1 second.
#include <xbee.h> xbee_senddata(con,"Hello World!");