|
int | _xbee_disc_parse_and_pass (xbee_dev_t *xbee, const void FAR *node_data, int length) |
|
int | xbee_disc_add_node_id_handler (xbee_dev_t *xbee, xbee_disc_node_id_fn fn) |
| Designate a function to receive parsed Node ID messages on a given XBee device. More...
|
|
int | xbee_disc_atnd_response_handler (xbee_dev_t *xbee, const void FAR *raw, uint16_t length, void FAR *context) |
| Process AT Command Response frames (type 0x88), looking for ATND responses to parse and pass to Node ID handlers. More...
|
|
const char * | xbee_disc_device_type_str (uint8_t device_type) |
| Return a string ("Coord", "Router", "EndDev", or "???") description for the "Device Type" field of a Node ID message. More...
|
|
int | xbee_disc_discover_nodes (xbee_dev_t *xbee, const char *identifier) |
| Send an ATND command to the XBee, initiating node discovery for all nodes or a specific node's "node identification" (ATNI) string. More...
|
|
int | xbee_disc_nd_parse (xbee_node_id_t FAR *parsed, const void FAR *source, int source_length) |
| Parse a Node Discovery response and store it in an xbee_node_id_t structure. More...
|
|
void | xbee_disc_node_id_dump (const xbee_node_id_t FAR *ni) |
| Debugging function used to dump an xbee_node_id_t structure to stdout. More...
|
|
int | xbee_disc_nodeid_cluster_handler (const wpan_envelope_t FAR *envelope, void FAR *context) |
| Process messages sent to the Node ID Message cluster (0x0095) of the Digi Data endpoint (0xE8) when ATAO != 0. More...
|
|
int | xbee_disc_nodeid_frame_handler (xbee_dev_t *xbee, const void FAR *raw, uint16_t length, void FAR *context) |
| Process Node Identification frames (type 0x95), sent when ATAO = 0. More...
|
|
int | xbee_disc_remove_node_id_handler (xbee_dev_t *xbee, xbee_disc_node_id_fn fn) |
| Remove a function registered to receive parsed Node ID messages on a given XBee device. More...
|
|
This layer manages ATND responses and 0x95 frames related to proprietary (XBee-only) node discovery methods used in ZigBee firmware (not supported in Smart Energy firmware builds).
Initial value:{
unsigned char uint8_t
A unsigned char variable 8 bits.
Definition: types.h:43
format of 0x95 frames received from XBee
XBEE_FRAME_NODE_ID (0x95)
Initial value:{
unsigned int uint16_t
An unsigned integer variable 16 bits.
Definition: types.h:46
ATMY value [0xFFFE on DigiMesh].
Initial value:{
unsigned int uint16_t
An unsigned integer variable 16 bits.
Definition: types.h:46
ATMP value [0xFFFE on DigiMesh].
parsed Node ID in host-byte-order and fixed length fields
int _xbee_disc_parse_and_pass |
( |
xbee_dev_t * |
xbee, |
|
|
const void FAR * |
node_data, |
|
|
int |
length |
|
) |
| |
Designate a function to receive parsed Node ID messages on a given XBee device.
- Parameters
-
[in] | xbee | XBee device to monitor |
[in] | fn | function to receive parsed Node ID messages |
- Return values
-
0 | function assigned |
-EINVAL | invalid parameter passed to function |
-ENOSPC | can't assign handler to device |
- See also
- xbee_disc_remove_node_id_handler
int xbee_disc_atnd_response_handler |
( |
xbee_dev_t * |
xbee, |
|
|
const void FAR * |
raw, |
|
|
uint16_t |
length, |
|
|
void FAR * |
context |
|
) |
| |
const char * xbee_disc_device_type_str |
( |
uint8_t |
device_type | ) |
|
Return a string ("Coord", "Router", "EndDev", or "???") description for the "Device Type" field of a Node ID message.
- Parameters
-
[in] | device_type | the device_type field from a Node ID message |
- Returns
- pointer to a string describing the type, or "???" if device_type is invalid
- See also
- xbee_node_id_t
int xbee_disc_discover_nodes |
( |
xbee_dev_t * |
xbee, |
|
|
const char * |
identifier |
|
) |
| |
Send an ATND command to the XBee, initiating node discovery for all nodes or a specific node's "node identification" (ATNI) string.
Responses from remote nodes are parsed and then passed on to Node ID handlers configured with xbee_disc_add_node_id_handler().
- Parameters
-
[in] | xbee | XBee device to use as the target |
[in] | identifier | the ATNI (node identification) string of a device on the network, or NULL to discover all devices |
- Return values
-
0 | command sent |
-EINVAL | an invalid parameter was passed to the function |
-EBUSY | transmit serial buffer is full, or XBee is not accepting serial data (deasserting /CTS signal). |
- See also
- xbee_disc_add_node_id_handler, xbee_disc_remove_node_id_handler
int xbee_disc_nd_parse |
( |
xbee_node_id_t FAR * |
parsed, |
|
|
const void FAR * |
source, |
|
|
int |
source_length |
|
) |
| |
Parse a Node Discovery response and store it in an xbee_node_id_t structure.
- Parameters
-
[out] | parsed | buffer to hold parsed Node ID message |
[in] | source | source of Node ID message, starting with the 16-bit network address |
[in] | source_length | number of bytes in source of Node ID message |
- Return values
-
0 | Node ID message parsed and stored in /a parsed |
-EINVAL | invalid parameter passed to function |
-EBADMSG | error parsing Node ID message |
Debugging function used to dump an xbee_node_id_t structure to stdout.
- Parameters
-
int xbee_disc_nodeid_cluster_handler |
( |
const wpan_envelope_t FAR * |
envelope, |
|
|
void FAR * |
context |
|
) |
| |
Process messages sent to the Node ID Message cluster (0x0095) of the Digi Data endpoint (0xE8) when ATAO != 0.
This function parses the frame and then passes an xbee_node_id_t structure on to Node ID handlers configured with xbee_disc_add_node_id_handler().
Do not call this function directly, it should be included in the Cluster table of the Digi Data endpoint by using the macro XBEE_DISC_DIGI_DATA_CLUSTER_ENTRY.
Hosts communicating to XBee modules running with ATAO set to zero do not need to use this handler.
See the function help for wpan_aps_handler_fn() for full documentation on this function's API.
- See also
- XBEE_DISC_DIGI_DATA_CLUSTER_ENTRY, xbee_disc_nodeid_frame_handler, xbee_disc_atnd_response_handler
int xbee_disc_nodeid_frame_handler |
( |
xbee_dev_t * |
xbee, |
|
|
const void FAR * |
raw, |
|
|
uint16_t |
length, |
|
|
void FAR * |
context |
|
) |
| |
Process Node Identification frames (type 0x95), sent when ATAO = 0.
These frames are sent to the host when ATAO is set to 0 and a remote node:
- Has ATD0 set to 1, and someone presses the commissioning button once.
- Has ATJN set to 1, and has joined the network.
This function parses a the frame and then passes an xbee_node_id_t structure on to Node ID handlers configured with xbee_disc_add_node_id_handler().
Do not call this function directly, it should be included in the XBee Frame Handlers table by using the macro XBEE_FRAME_HANDLE_AO0_NODEID. Hosts communicating to XBee modules running with ATAO set to a non-zero value do not need to use this handler.
See the function help for xbee_frame_handler_fn() for full documentation on this function's API.
- See also
- xbee_disc_nodeid_cluster_handler, xbee_disc_atnd_response_handler
Remove a function registered to receive parsed Node ID messages on a given XBee device.
- Parameters
-
[in] | xbee | XBee device to monitor |
[in] | fn | function to receive parsed Node ID messages |
- Return values
-
0 | function removed |
-EINVAL | invalid parameter passed to function |
-ENOENT | function isn't assigned to this XBee module |
- See also
- xbee_disc_remove_node_id_handler
ATDD of remote device [optional field enabled with ATNO on DigiMesh].
one of XBEE_ND_DEVICE_* macro values
one of XBEE_ND_DEVICE_TYPE_COORD, _ROUTER or _ENDDEV
char node_info[XBEE_DISC_MAX_NODEID_LEN+1] |
null-terminated ATNI value (variable length)
char node_info[XBEE_DISC_MAX_NODEID_LEN+1] |
ATNI value (variable length, null-terminated)
RSSI of packet [optional field enabled with ATNO on DigiMesh].
event that generated the ND frame