xbee_err xbee_conSettings(struct xbee_con *con, struct xbee_conSettings *newSettings, struct xbee_conSettings *oldSettings);
struct xbee_conSettings { /* libxbee options: */ unsigned char noBlock; unsigned char catchAll; unsigned char noWaitForAck; /* generic options: */ unsigned char queueChanges; /* for AT connections */ unsigned char disableAck; /* specific options for XBee 1 / causes use of FrameID 0x00 for others */ unsigned char broadcast; /* XBee 2 / ZNet options: */ unsigned char multicast; /* XBee ZigBee options: */ unsigned char disableRetries; unsigned char enableEncryption; unsigned char extendTimeout; /* XBee 5 options: */ unsigned char noRoute; /* other */ unsigned char broadcastRadius; };
One of newSettings and oldSettings can optionally be NULL, one must be non-NULL.
If they are non-NULL, then the struct pointed to by oldSettings will be filled with the effective settings before the call to xbee_conSettings(), and then newSettings will be used to update the connection's settings.
#include <xbee.h> struct xbee *xbee; struct xbee_con *con; struct xbee_conSettings settings; /* initialize xbee, using xbee_setup() */ /* initialize con, using xbee_conNew() */ if (xbee_conSettings(con, NULL, &settings) != XBEE_ENONE) return; settings.disableAck = 1; if (xbee_conSettings(con, &settings, NULL) != XBEE_ENONE) return;