xbee_err xbee_conDataSet(struct xbee_con *con, void *newData, void **oldData);
xbee_err xbee_conDataGet(struct xbee_con *con, void **curData);
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.
#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;