API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
tsmart_xbee_zb_config_device_t Struct Reference

Configuration for XBee ZigBee device. More...

#include <tsmart_xbee_zb.h>

Data Fields

uint32_t high_pan_id
 
uint32_t low_pan_id
 
uint8_t baud_rate
 
tsmart_xbee_zb_flow_control_t flow_control
 
uint8_t power_level
 
uint8_t unicast_nhops
 
uint8_t broadcast_nhops
 
int16_t n_scan_channels
 
uint8_t scan_channels_time
 
uint8_t profile
 
uint8_t time_to_join
 
tsmart_xbee_zb_flag_t ch_verification
 
uint16_t network_watchdog_timeout
 
tsmart_xbee_zb_flag_t aes_enable
 
uint8_t aes_key [PR_TSMART_XBEE_ZB_AES_KEY_SIZE]
 
uint8_t aes_key_size
 
uint8_t network_key [PR_TSMART_XBEE_ZB_NKEY_SIZE]
 
uint8_t network_key_size
 
uint8_t encryption_opt
 
tsmart_xbee_zb_sleep_mode_t sleep_mode
 
uint8_t n_sleep_periods
 
uint16_t sp
 
uint16_t st
 
uint8_t sleep_opt
 
uint8_t wake_host
 
uint8_t polling_rate
 
tsmart_xbee_zb_kind_dev_t kind_dev
 

Detailed Description

Configuration for XBee ZigBee device.

Examples:
zigbee_receiver.c, and zigbee_sender.c.

Field Documentation

Enables/Disables AES encryption:

  • TSMART_XBEE_ZB_ENABLE
  • TSMART_XBEE_ZB_DISABLE

The default value for this parameter is: TSMART_XBEE_ZB_DISABLE.

uint8_t aes_key[PR_TSMART_XBEE_ZB_AES_KEY_SIZE]

AES key. The default value for this parameter is: 0x00.

uint8_t aes_key_size

AES key size The default value for this parameter is: 0x00.

uint8_t baud_rate

Baud rate:

  • 0 - 1200bps
  • 1 - 2400bps
  • 2 - 4800bps
  • 3 - 9600bps
  • 4 - 19200bps
  • 5 - 38400bps
  • 6 - 57600bps

The default value for this parameter is: 3

uint8_t broadcast_nhops

The maximum number of hops for each broadcast data transmission. Setting this to 0 will use the maximum number of hops.

The default value for this parameter is: 0x00

tsmart_xbee_zb_flag_t ch_verification

Set the channel verification parameter. If it is 1, a router will verify the coordinator is on its operating channel when joining or coming up from a power cycle. If a coordinator is not detected, the router will leave its current channel and attempt to join a new PAN. If it is 0, the router will continue operating on its current channel even if a coordinator is not detected. The default value for this parameter is: TSMART_XBEE_ZB_DISABLE.

uint8_t encryption_opt

Configure options for encryption. Unused option bits should be set to 0. Options include:

  • 0x01 - Send the security key unsecured over-the-air during joins
  • 0x02 - Use trust center (coordinator only 0 - 0xFF)

The default value for this parameter is: 0x00.

Specifies whether the hardware flow control mode is enabled or disabled. This parameter shall be selected amongst the following values:

  • TSMART_XBEE_ZB_FLOW_CONTROL_DISABLE
  • TSMART_XBEE_ZB_FLOW_CONTROL_CTS
  • TSMART_XBEE_ZB_FLOW_CONTROL_RTS
  • TSMART_XBEE_ZB_FLOW_CONTROL_RTS_CTS

The default value for this parameter is: TSMART_XBEE_ZB_FLOW_CONTROL_DISABLE

uint32_t high_pan_id

High extended PAN ID, range: 0-0xFFFFFFFF The default value for this parameter is: 0x00000000

Examples:
zigbee_receiver.c, and zigbee_sender.c.

Define what kind of device it will be:

  • TSMART_XBEE_ZB_ROUTER
  • TSMART_XBEE_ZB_COORDINATOR
  • TSMART_XBEE_ZB_END_DEVICE

Default value depends on the kind of default configuration function executed

uint32_t low_pan_id

Low extended PAN ID, range: 0-0xFFFFFFFF The default value for this parameter is: 0x00003322

Examples:
zigbee_receiver.c, and zigbee_sender.c.
int16_t n_scan_channels

Set the list of channels to scan. Depend on the module be:

  • Coordinator - Bit field list of channels to choose from prior to starting network.
  • Router/End Device - Bit field list of channels that will be scanned to find a coordinator/router to join
  • bit 0 - Channel 1 0x0B
  • bit 1 - Channel 2 - 0x0C
  • bit 2 - Channel 3 - 0x0D
  • bit 3 - Channel 4 - 0x0E
  • bit 4 - Channel 5 - 0x0F
  • bit 5 - Channel 6 - 0x10
  • bit 6 - Channel 7 - 0x11
  • bit 7 - Channel 8 - 0x12
  • bit 8 - Channel 9 - 0x13
  • bit 9 - Channel 10 - 0x14
  • bit 10 - Channel 11 - 0x15
  • bit 11 - Channel 12 - 0x16
  • bit 12 - Channel 13 - 0x17
  • bit 13 - Channel 14 - 0x18
  • bit 14 - Channel 15 - 0x19
  • bit 15 - Channel 16 - 0x1A
Note
In XBee-PRO (S2) bits 14, 15 not allowed, and XBee-PRO (S2B) bit 15 is not allowed.

The default value for this parameter is: 0x1FFE;

uint8_t n_sleep_periods

Sets the number of sleep periods to not assert the On/Sleep pin on wakeup if no RF data is waiting for the end device. range: 1 - 0xFFFF

The default value for this parameter is: 0x01.

uint8_t network_key[PR_TSMART_XBEE_ZB_NKEY_SIZE]

Set the 128-bit AES link key. The default value for this parameter is: 0x00.

uint8_t network_key_size

AES link key size The default value for this parameter is: 0x00.

uint16_t network_watchdog_timeout

Network watchdog timeout. Set/read the network watchdog timeout value. If it is set > 0, the router will monitor communication from the coordinator (or data collector) and leave the network if it cannot communicate with the coordinator for 3 "network_watchdog_timeout" periods. The timer is reset each time data is received from or sent to a coordinator, or if a many to one broadcast is received. Range: 0 - 0x64FF[x 1 minute](up to over 17 days).

The default value for this parameter is: 0x00.

uint8_t polling_rate

Set the end device poll rate. Set to 0 (default value) enables polling at 100 ms (default rate). Adaptive polling may allow the end device to poll more rapidly for a short time when receiving RF data. Range: 0 - 0x3E8.

The default value for this parameter is: 0x00.

uint8_t power_level

Power signal:

  • XBee (S2)(boost mode disabled)
    • 0 = -8 dBm
    • 1 = -4 dBm
    • 2 = -2 dBm
    • 3 = 0 dBm
    • 4 = +2 dBm
  • XBee-PRO (S2)
    • 4 = 17 dBm
  • XBee-PRO (S2)(International Variant)
    • 4 = 10dBm
  • XBee-PRO (S2B)(Boost mode enabled)
    • 4 = 18dBM
    • 3 = 16dBm
    • 2 = 14dBm
    • 1 = 12dBm
    • 0 = 10dBm
  • XBee-PRO (S2B)(International Variant and Boost mode enabled)
    • 4 = 10dBm
    • 3 = 8dBm
    • 2 = 6dBm
    • 1 = 4dBm
    • 0 = 2dBm

The default value for this parameter is: 0x04

uint8_t profile

ZigBee stack profile. Set the ZigBee stack profile value. This must be set the same on all devices that should join the same network. Only "0" is supported, and it's default value.

The default value for this parameter is: 0x00.

uint8_t scan_channels_time

Set the scan duration exponent. This parameter shall be defined in different way if the device is:

  • Coordinator - Duration of the active and energy scans (on each channel) that are used to determine an acceptable channel and Pan ID for the Coordinator to startup on.
  • Router/End Device - Duration of Active Scan (on each channel) used to locate an available Coordinator / Router to join during Association.

Scan time is measured as:(number of channels to scan) * (2 ^ "scan_channels_time") * 15.36ms - the number of channels to scan is determined by the "n_scan_channels" parameter. The XBee can scan up to 16 channels. Sample scan duration times (13 channel scan):

  • scan_channels_time = 0, time = 0.200 sec
  • scan_channels_time = 2, time = 0.799 sec
  • scan_channels_time = 4, time = 3.190 sec
  • scan_channels_time = 6, time = 12.780 sec
Note
scan_channels_time influences the time the MAC listens for beacons or runs an energy scan on a given channel. The scan_channels_time is not a good estimate of the router/end device joining time requirements. ZigBee joining adds additional overhead including beacon processing on each channel, sending a join request, etc. that extend the actual joining time.

The default value for this parameter is: 0x03;

Sets the sleep mode on the RF module. An XBee loaded with router firmware can be configured as either a router (sleep mode set to 0) or an end device (sleep mode > 0):

  • TSMART_XBEE_ZB_OFF
  • TSMART_XBEE_ZB_PIN
  • TSMART_XBEE_ZB_CYCLIC
  • TSMART_XBEE_ZB_CYCLIC_PIN

The default value for this parameter is: end-dev: TSMART_XBEE_ZB_PIN and router: TSMART_XBEE_ZB_OFF

uint8_t sleep_opt

Configure options for sleep. Unused option bits should be set to 0. Sleep options include:

  • 0x02 - Always wake for st time
  • 0x04 - Sleep entire n_sleep_periods * sp time
  • 0x06 - Enabled extended sleep and wake for st time

Sleep options should not be used for most applications. See chapter 6 for more information. Range: 0 - 0xFF The default value for this parameter is: 0x00.

uint16_t sp

Sleep Period. This value determines how long the end device will sleep at a time, up to 28 seconds. On the parent, this value determines how long the parent will buffer a message for the sleeping end device. It should be set at least equal to the longest sp time of any child end device. Range: 0x20 - 0xAF0 x 10ms. The default value for this parameter is: 0x076c.

uint16_t st

Time Before Sleep Sets the time before sleep timer on an end device. The timer is reset each time serial or RF data is received. Once the timer expires, an end device may enter low power operation. Applicable for cyclic sleep end devices only. Range: 1 - 0xFFFE (x 1ms).

The default value for this parameter is: 0x1388.

uint8_t time_to_join

Set the time that a coordinator/router allows nodes to join. For an end device to enable rejoining, time_to_join should be set less than 0xFF on the device that will join. If time_to_join < 0xFF, the device assumes the network is not allowing joining and first tries to join a network using rejoining. If multiple rejoining attempts fail, or if time_to_join = 0xFF, the device will attempt to join using association. Range: 0 - 0xFF[x 1 sec].

The default value for this parameter is: 0xFF.

uint8_t unicast_nhops

Maximum Unicast Hops. Set the maximum hops limit. This limit sets the maximum broadcast hops value and determines the unicast timeout. The timeout is computed as (50 * unicast hops) + 100 ms. The default unicast timeout of 1.6 seconds (unicast hops =0x1E) is enough time for data and the acknowledgment to traverse about 8 hops. Range: 0-0xFF.

The default value for this parameter is: 0x1E

uint8_t wake_host

Set the wake host timer value. If the wake host timer is set to a non zero value, this timer specifies a time (in millisecond units) that the device should allow after waking from sleep before sending data out the UART. If serial characters are received, the "wake_host" timer is stopped immediately. Range: 0 - 0xFFFF (x 1ms)

The default value for this parameter is: 0x00.