You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.4 KiB
86 lines
2.4 KiB
.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules |
|
.\" running in API mode (AP=2). |
|
.\" |
|
.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) |
|
.\" |
|
.\" This program is free software: you can redistribute it and/or modify |
|
.\" it under the terms of the GNU General Public License as published by |
|
.\" the Free Software Foundation, either version 3 of the License, or |
|
.\" (at your option) any later version. |
|
.\" |
|
.\" This program is distributed in the hope that it will be useful, |
|
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
.\" GNU General Public License for more details. |
|
.\" |
|
.\" You should have received a copy of the GNU General Public License |
|
.\" along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
.TH XBEE_SENDDATA 3 2009-11-01 "GNU" "Linux Programmer's Manual" |
|
.SH NAME |
|
xbee_senddata, xbee_nsenddata, xbee_vsenddata |
|
.SH SYNOPSIS |
|
.B #include <xbee.h> |
|
.sp |
|
.BI "int xbee_senddata(xbee_con *" con ", char *" format ", ...);" |
|
.sp |
|
.BI "int xbee_nsenddata(xbee_con *" con ", char *" data ", int " length ");" |
|
.sp |
|
.B #include <stdarg.h> |
|
.sp |
|
.BI "int xbee_vsenddata(xbee_con *" con ", char *" format ", va_list " ap "); |
|
.ad b |
|
.SH DESCRIPTION |
|
The |
|
.BR xbee_senddata () |
|
function will send data via a provided connection. |
|
It takes at least 2 arguments, and possibly more depending on the format string. |
|
.sp |
|
The argument |
|
.I con |
|
points to a connection made previously with |
|
.BR xbee_newcon (). |
|
.sp |
|
The |
|
.I format |
|
string and any following parameters are passed to |
|
.BR snprintf () |
|
within these functions. |
|
Please see the |
|
.BR printf (3) |
|
man page for more information. |
|
.sp |
|
If you are using |
|
.BR xbee_nsenddata () |
|
you must provide a character array of the data, and the data's length. |
|
.sp |
|
If you are using |
|
.BR xbee_vsenddata () |
|
you must provide a va_list. See |
|
.BR stdarg (3). |
|
.SH "RETURN VALUE" |
|
Upon successful completion, these functions return 0. |
|
.sp |
|
If an invalid packet or connection was provided, -1 is returned. |
|
.sp |
|
If an unknown error occured, -2 is returned. |
|
.sp |
|
If |
|
.I con |
|
has |
|
.I waitforACK |
|
enabled, then these functions return 1 when an ACK was not recieved within 1 second. |
|
.SH EXAMPLE |
|
To send the string "Hello World!" through a previously made connection: |
|
.in +4n |
|
.nf |
|
#include <xbee.h> |
|
xbee_senddata(con,"Hello World!"); |
|
.fi |
|
.in |
|
.SH AUTHOR |
|
Attie Grande <attie@attie.co.uk> |
|
.SH "SEE ALSO" |
|
.BR libxbee (3), |
|
.BR xbee_setup (3), |
|
.BR xbee_newcon (3), |
|
.BR xbee_getpacket (3)
|
|
|