enum xbee_conSleepStates { CON_AWAKE, CON_SNOOZE, CON_SLEEP };
xbee_err xbee_conSleepSet(struct xbee_con *con, enum xbee_conSleepStates state);
xbee_err xbee_conSleepGet(struct xbee_con *con, enum xbee_conSleepStates *state);
If a connection is set to CON_SNOOZE then inbound packets, and calling xbee_conTx(3) will wake it up ONLY if there are no other awake connections with the same address.
If a connection is set to CON_SLEEP then inbound packets will not wake it up, and it must be explicitly woken before xbee_conTx(3) will succeed.
Waking a connection will ONLY succeed if there are no other connections that are currently awake that share the same address.
#include <xbee.h> struct xbee *xbee; struct xbee_con *con; /* initialize xbee, using xbee_setup() */ /* initialize con, using xbee_conNew() */ if (xbee_conSleepSet(con, &my_info, NULL) != XBEE_ENONE) return;