# XBEE_SENDDATA

Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index Return to Main Contents

## NAME

xbee_senddata, 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 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).

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

## Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 00:08:23 GMT, March 30, 2011