XBEE_CONDATAGET

Section: Linux Programmer's Manual (3)
Updated: 04-Mar-2012
Index Return to Main Contents
 

NAME

xbee_conDataGet, xbee_conDataSet  

SYNOPSIS

#include <xbee.h>

xbee_err xbee_conDataSet(struct xbee_con *con, void *newData, void **oldData);

xbee_err xbee_conDataGet(struct xbee_con *con, void **curData);  

DESCRIPTION

xbee_conDataSet() allows you to associate any data you wish with a connection. This data will then be avaliable from within callback functions (see xbee_conCallbackSet(3) for more), or by calling xbee_conDataGet(3).

con indicates which connection you would like to use, and newData indicates the data you wish to associate.

The oldData parameter allows you to retrieve the data that was assigned before you assigned new data. If it is NULL then the data will not be returned.

The xbee_conDataGet() function allows you to retrieve the current data, without assigning new data to the connection.  

Return Value

On success these functions will return XBEE_ENONE, otherwise an error number from enum xbee_errors (as specified in <xbee.h>)  

EXAMPLE

#include <xbee.h>

struct xbee *xbee;
struct xbee_con *con;
struct my_struct my_info;

/* initialize xbee, using xbee_setup() */

/* initialize con, using xbee_conNew() */

/* keep scope in mind! if this function returns, the pointer will be invalid */
if (xbee_conDataSet(con, &my_info, NULL) != XBEE_ENONE) return;
 

AUTHOR

Attie Grande <attie@attie.co.uk>  

SEE ALSO

libxbee(3), xbee_setup(3), xbee_conNew(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
Return Value
EXAMPLE
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 13:52:18 GMT, August 11, 2019