<HTML><HEAD><TITLE>Manpage of XBEE_SENDDATA</TITLE> </HEAD><BODY> <H1>XBEE_SENDDATA</H1> Section: Linux Programmer's Manual (3)<BR>Updated: 2009-11-01<BR><A HREF="#index">Index</A> <A HREF="../index.html">Return to Main Contents</A><HR> <A NAME="lbAB"> </A> <H2>NAME</H2> xbee_senddata, xbee_vsenddata <A NAME="lbAC"> </A> <H2>SYNOPSIS</H2> <B>#include <<A HREF="file:/usr/include/xbee.h">xbee.h</A>></B> <P> <B>int xbee_senddata(xbee_con *</B><I>con</I><B>, char *</B><I>format</I><B>, ...);</B> <P> <B>int xbee_nsenddata(xbee_con *</B><I>con</I><B>, char *</B><I>data</I><B>, int </B><I>length</I><B>);</B> <P> <B>#include <<A HREF="file:/usr/include/stdarg.h">stdarg.h</A>></B> <P> <B>int xbee_vsenddata(xbee_con *</B><I>con</I><B>, char *</B><I>format</I><B>, va_list </B><I>ap</I><B>);</B> <A NAME="lbAD"> </A> <H2>DESCRIPTION</H2> The <B>xbee_senddata</B>() function will send data via a provided connection. It takes at least 2 arguments, and possibly more depending on the format string. <P> The argument <I>con</I> points to a connection made previously with <B>xbee_newcon</B>(). <P> The <I>format</I> string and any following parameters are passed to <B>sprintf</B>() within these functions. Please see the <B><A HREF="../man3/printf.3.html">printf</A></B>(3) man page for more information. <P> If you are using <B>xbee_nsenddata</B>() you must provide a character array of the data, and the data's length. <P> If you are using <B>xbee_vsenddata</B>() you must provide a va_list. See <B><A HREF="../man3/stdarg.3.html">stdarg</A></B>(3). <A NAME="lbAE"> </A> <H2>RETURN VALUE</H2> Upon successful completion, these functions return 0. <P> If an invalid packet or connection was provided, -1 is returned. <P> If an unknown error occured, -2 is returned. <P> If <I>con</I> has <I>waitforACK</I> enabled, then these functions return 1 when an ACK was not recieved within 1 second. <A NAME="lbAF"> </A> <H2>EXAMPLE</H2> To send the string "Hello World!" through a previously made connection: <PRE> #include <<A HREF="file:/usr/include/xbee.h">xbee.h</A>> xbee_senddata(con,"Hello World!"); </PRE> <A NAME="lbAG"> </A> <H2>AUTHOR</H2> Attie Grande <<A HREF="mailto:attie@attie.co.uk">attie@attie.co.uk</A>> <A NAME="lbAH"> </A> <H2>SEE ALSO</H2> <B><A HREF="../man3/libxbee.3.html">libxbee</A></B>(3), <B><A HREF="../man3/xbee_setup.3.html">xbee_setup</A></B>(3), <B><A HREF="../man3/xbee_newcon.3.html">xbee_newcon</A></B>(3), <B><A HREF="../man3/xbee_getpacket.3.html">xbee_getpacket</A></B>(3) <P> <HR> <A NAME="index"> </A><H2>Index</H2> <DL> <DT><A HREF="#lbAB">NAME</A><DD> <DT><A HREF="#lbAC">SYNOPSIS</A><DD> <DT><A HREF="#lbAD">DESCRIPTION</A><DD> <DT><A HREF="#lbAE">RETURN VALUE</A><DD> <DT><A HREF="#lbAF">EXAMPLE</A><DD> <DT><A HREF="#lbAG">AUTHOR</A><DD> <DT><A HREF="#lbAH">SEE ALSO</A><DD> </DL> <HR> This document was created by <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>, using the manual pages.<BR> Time: 00:08:23 GMT, March 30, 2011 </BODY> </HTML>