XBEE_SENDDATA(3)

NAME
xbee_senddata, xbee_nsenddata, xbee_vsenddata

SYNOPSIS
#include <xbee.h>

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);

DESCRIPTION
The xbee_senddata() function will send data via a provided connection. It takes at least 2 arguments, and possibly more depending on the format string.

The argument con points to a connection made previously with xbee_newcon().

The format string and any following parameters are passed to snprintf() 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).

RETURN VALUE
Upon successful completion, these functions return 0.

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.

EXAMPLE
To send the string "Hello World!" through a previously made connection:
#include <xbee.h>
xbee_senddata(con,"Hello World!");

AUTHOR
Attie Grande <attie@attie.co.uk>

SEE ALSO
libxbee(3), xbee_setup(3), xbee_newcon(3), xbee_getpacket(3)