XBEE_CONNEW

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

NAME

xbee_conNew, xbee_conValidate, xbee_conGetXBee, xbee_conEnd  

SYNOPSIS

#include <xbee.h>

xbee_err xbee_conNew(struct xbee *xbee, struct xbee_con **retCon, const char *type, struct xbee_conAddress *address);

xbee_err xbee_conValidate(struct xbee_con *con);

xbee_err xbee_conGetXBee(struct xbee_con *con, struct xbee **xbee);

xbee_err xbee_conEnd(struct xbee_con *con);  

DESCRIPTION

xbee_conNew() will create new connection via the given libxbee instance xbee. The new connection will be returned via retCon, and the connection's type is provided by type. A list of avaliable connection types can be obtained by using xbee_conGetTypes(3). The address indicates which remote device you wish to communicate with - it is not always appropriate to use this (e.g: with a "Local AT" connection), in which case NULL may be safely provided.

xbee_conValidate() allows you to confirm that your handle points to a valid libxbee connection.

xbee_conGetXBee() allows you to retrieve the libxbee instance that was provided when the connection was created by calling xbee_conNew().

xbee_conEnd() will terminate a connection, and free any memory that is associated with it, including any un-fetched packets. If a callback is active when xbee_conEnd() is called, it will be permitted to complete, and then the connection will be terminated.  

Avaliable Types

xbee1 "Modem Status" - Rx Only. Status updates from the XBee module.

"Transmit Status" - Rx Only. Transmit status responses. These are handled for you, but you may wish to access them anyway.

"Local AT" - Set/Get AT configuration from the local module.

"Remote AT" - Set/Get AT configuration from a remote module.

"16-bit Data" - 2-way communication with a remote module, using 16-bit addressing.

"64-bit Data" - 2-way communication with a remote module, using 64-bit addressing.

"16-bit I/O" - Rx Only. I/O samples received from a remote module, using 16-bit addressing.

"64-bit I/O" - Rx Only. I/O samples received from a remote module, using 64-bit addressing.

xbee2 "Modem Status" - Rx Only. Status updates from the XBee module.

"Transmit Status" - Rx Only. Transmit status responses. These are handled for you, but you may wish to access them anyway.

"Local AT" - Set/Get AT configuration from the local module.

"Remote AT" - Set/Get AT configuration from a remote module.

"Data" - 2-way communication with a remote module. All data will be recieved using this connection type if AO=0.

"Data (explicit)" - 2-way communication with a remote module, with configurable endpoints. All data will be recieved using this connection type if AO=1.

"I/O" - Rx Only. I/O samples received from a remote module. Only if AO=0.

"Sensor" - Rx Only. Used for receiving sensor samples. Only if AO=0.

"Identify" - Rx on the Coordinator Only. Identifies new nodes as they join the network. Only if AO=0.

xbee3 "Modem Status" - Rx Only. Status updates from the XBee module.

"Transmit Status" - Rx Only. Transmit status responses. These are handled for you, but you may wish to access them anyway.

"Local AT" - Set/Get AT configuration from the local module.

"Remote AT" - Set/Get AT configuration from a remote module.

"Data" - 2-way communication with a remote module. All data will be recieved using this connection type if AO=0.

"Data (explicit)" - 2-way communication with a remote module, with configurable endpoints. All data will be recieved using this connection type if AO=1.

"Identify" - Rx on the Coordinator Only. Identifies new nodes as they join the network. Only if AO=0.

xbee5 "Modem Status" - Rx Only. Status updates from the XBee module.

"Transmit Status" - Rx Only. Transmit status responses. These are handled for you, but you may wish to access them anyway.

"Local AT" - Set/Get AT configuration from the local module.

"Remote AT" - Set/Get AT configuration from a remote module.

"Data" - 2-way communication with a remote module. All data will be recieved using this connection type if AO=0.

"Data (explicit)" - 2-way communication with a remote module, with configurable endpoints. All data will be recieved using this connection type if AO=1.

"Identify" - Rx on the Coordinator Only. Identifies new nodes as they join the network. Only if AO=0.

xbee6b "Modem Status" - Rx Only. Status updates from the XBee module.

"Transmit Status" - Rx Only. Transmit status responses. These are handled for you, but you may wish to access them anyway.

"Frame Error" - Rx Only. Framing errors are received by this connection type, though they are currently of limited use because they aren't referenced to a specific frame...

"Local AT" - Set/Get AT configuration from the local module.

"Remote AT" - Set/Get AT configuration from a remote module.

"Data" - 2-way communication with a remote module.

"I/O" - Rx Only. I/O samples received from a remote module.

xbeeZB "Modem Status" - Rx Only. Status updates from the XBee module.

"Transmit Status" - Rx Only. Transmit status responses. These are handled for you, but you may wish to access them anyway.

"Local AT" - Set/Get AT configuration from the local module.

"Remote AT" - Set/Get AT configuration from a remote module.

"Data" - 2-way communication with a remote module. All data will be recieved using this connection type if AO=0.

"Data (explicit)" - 2-way communication with a remote module, with configurable endpoint, cluster and profile IDs. All data will be recieved using this connection type if AO=1.

"I/O" - Rx Only. I/O samples received from a remote module. Only if AO=0.

"Identify" - Rx on the Coordinator Only. Identifies new nodes as they join the network. Only if AO=0.

"Sensor" - Rx Only. Used for receiving sensor samples. Only if AO=0.

"OTA Update Status" - Rx on the Coordinator Only. Identifies new nodes as they join the network. Only if AO=0.

net the connection types for net mode are determined by the mode running on the server. See xbee_conGetTypes(3).  

Return Value

On success these functions will return XBEE_ENONE, otherwise an error number from enum xbee_errors (as specified in <xbee.h>). Postponed termination due to an active callback is considered a success.  

EXAMPLE

#include <xbee.h>

struct xbee *xbee;
struct xbee_con *con;
struct xbee_conAddress address;

/* initialize xbee, using xbee_setup() */

memset(&address, 0, sizeof(address));
address.addr64_enabled = 1;
address.addr64[0] = 0x00;
address.addr64[1] = 0x13;
address.addr64[2] = 0xA2;
address.addr64[3] = 0x00;
address.addr64[4] = 0x40;
address.addr64[5] = 0x08;
address.addr64[6] = 0x18;
address.addr64[7] = 0x26;

if (xbee_conNew(xbee, &con, "64-bit Data", &address) != XBEE_ENONE) return;

/* make use of the connection... */

if (xbee_conEnd(con) != XBEE_ENONE) return;
 

AUTHOR

Attie Grande <attie@attie.co.uk>  

SEE ALSO

libxbee(3), xbee_setup(3), xbee_conGetTypes(3), xbee_conTx(3), xbee_conRx(3), xbee_conSleepGet(3), xbee_conDataGet(3), xbee_conInfoGet(3), xbee_conCallbackGet(3), xbee_conSettings(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
Avaliable Types
Return Value
EXAMPLE
AUTHOR
SEE ALSO

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