# XBEE_CONSLEEPGET

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

## NAME

xbee_conSleepGet, xbee_conSleepSet, xbee_conSleepStates

## SYNOPSIS

#include <xbee.h>

    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);

## DESCRIPTION

xbee_conSleepSet() allows you to put a connection to sleep. If a connection is sleeping, another connection may be created with the same address.

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.

### 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;

    /* initialize xbee, using xbee_setup() */

    /* initialize con, using xbee_conNew() */

    if (xbee_conSleepSet(con, &my_info, NULL) != XBEE_ENONE) return;

## AUTHOR

Attie Grande <attie@attie.co.uk>

## SEE ALSO

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

## Index

NAME
SYNOPSIS
DESCRIPTION
  Return Value
EXAMPLE
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 18:19:28 GMT, September 04, 2013