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

Configuration for XBee 802. More...

#include <tsmart_xbee_802.h>

Data Fields

tsmart_xbee_802_flag_t api
 
tsmart_xbee_802_kind_dev_t kind_dev
 
uint8_t channel
 
uint16_t pan_id
 
uint8_t baud_rate
 
tsmart_xbee_802_flow_control_t flow_control
 
uint8_t power_level
 
tsmart_xbee_802_flag_t aes_enable
 
uint8_t aes_key [PR_TSMART_XBEE_802_AES_KEY_SIZE]
 
uint8_t aes_key_size
 
uint32_t dest_addr_h
 
uint32_t dest_addr_l
 
uint16_t my
 
uint8_t tx_retries
 
tsmart_xbee_802_sleep_mode_t sleep
 
tsmart_xbee_802_flag_t sleep_option
 
uint16_t cyclic_period
 
uint16_t timer_before_sleep
 
int16_t n_scan_channels
 
uint8_t scan_channels_time
 
uint32_t eflexibility
 
uint32_t cflexibility
 

Detailed Description

Configuration for XBee 802.

Examples:
xbee802_15_4_receiver.c, and xbee802_15_4_sender.c.

Field Documentation

Enable or disable the AES Encryption option:

  • TSMART_XBEE_802_ENABLE
  • TSMART_XBEE_802_DISABLE

The default value for this parameter is: disable

uint8_t aes_key[PR_TSMART_XBEE_802_AES_KEY_SIZE]

Sets AES key(16 bytes as maximum value) The default value for this parameter is: 0

uint8_t aes_key_size

Sets AES key size The default value for this parameter is: 16

This parameter enable or disable the API mode:

  • TSMART_XBEE_802_ENABLE
  • TSMART_XBEE_802_DISABLE

The default value for this parameter is: enable

Examples:
xbee802_15_4_receiver.c, and xbee802_15_4_sender.c.
uint8_t baud_rate

Sets the baud rate:

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

The default value for this parameter is: 3

uint32_t cflexibility

Configure association in coordinator. This parameter shall be filled with the following values:

  • Byte '0' - Reassign PAN ID
    • 0 - Coordinator will not perform active scan to locate available PAN ID. It will operate on ID (PAN ID).
    • 1 - Coordinator will perform active Scan to determine an available ID (PAN ID). If a PAN ID conflict is found, the ID parameter will change.
  • Byte '1' - Reassign channel
    • 0 - Coordinator will not perform Energy Scan to determine free channel. It will operate on the channel determined by the channel parameter.
    • 1 - Coordinator will perform energy scan to find a free channel, then operate on that channel.
  • Byte '2' - Allow association
    • 0 - Coordinator will not allow any devices to associate to it.
    • 1 - Coordinator will allow devices to associate to it.
Note
It's advisable to use the specifics defines to select the adequate option: TSMART_XBEE_FLEXX

The default value for this parameter is: TSMART_XBEE_802_FLEX1

uint8_t channel

Channel. This value must be set in hexadecimal value:

  • Channel 1 - 0x0B
  • Channel 2 - 0x0C
  • Channel 3 - 0x0D
  • Channel 4 - 0x0E
  • Channel 5 - 0x0F
  • Channel 6 - 0x10
  • Channel 7 - 0x11
  • Channel 8 - 0x12
  • Channel 9 - 0x13
  • Channel 10 - 0x14
  • Channel 11 - 0x15
  • Channel 12 - 0x16
  • Channel 13 - 0x17
  • Channel 14 - 0x18
  • Channel 15 - 0x19
  • Channel 16 - 0x1A

The default value for this parameter is: 0x0c

Examples:
xbee802_15_4_receiver.c, and xbee802_15_4_sender.c.
uint16_t cyclic_period

Sleep period for cyclic sleeping remote nodes. Range: 1 - 0xFFFF [x 1 ms] The default value for this parameter is: 0x1388

uint32_t dest_addr_h

Destination address high, in hexadecimal format: e.g: 0x0013a200 The default value for this parameter is: 0x00000000

uint32_t dest_addr_l

Destination address low, in hexadecimal format: e.g: 0x406055FF The default value for this parameter is: 0x00000000

uint32_t eflexibility

Configure association in end device. This parameter shall be filled with the following values:

  • Bytes '0' - ReassignPanID
    • 0 - Will only associate with coordinator operating on PAN ID that matches module ID
    • 1 - May associate with coordinator operating on any PAN ID
  • Byte '1' - ReassignChannel
    • 0 - Will only associate with coordinator operating on matching the channel setting
    • 1 - May associate with coordinator operating on any channel
  • Byte '2' - AutoAssociate
    • 0 - Device will not attempt association
    • 1 - Device attempts association until success
Note
Next field is used only for Non-Beacon systems. End devices in beacon-enabled system must always associate to a coordinator.
  • Byte '3' - PollCoordOnPinWake
    • 0 - Pin Wake will not poll the Coordinator for indirect (pending) data
    • 1 - Pin Wake will send Poll Request to Coordinator to extract any pending data
It's advisable to use the specifics defines to select the adequate option: TSMART_XBEE_FLEXX.

The default value for this parameter is: (TSMART_XBEE_802_FLEX0 | TSMART_XBEE_802_FLEX1 | TSMART_XBEE_802_FLEX3).

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

  • TSMART_XBEE_802_FLOW_CONTROL_DISABLE
  • TSMART_XBEE_802_FLOW_CONTROL_CTS
  • TSMART_XBEE_802_FLOW_CONTROL_RTS
  • TSMART_XBEE_802_FLOW_CONTROL_RTS_CTS

The default value for this parameter is: TSMART_XBEE_802_FLOW_CONTROL_DISABLE

Define what kind of device it will be:

  • TSMART_XBEE_802_COORDINATOR
  • TSMART_XBEE_802_END_DEVICE

The default value for this parameter is: End-device

Examples:
xbee802_15_4_receiver.c, and xbee802_15_4_sender.c.
uint16_t my

Specifies the kind of XBee address: 16-bit or 64-bit:

  • If the 16-bit address is selected, the available range is: 0x0000 to 0xFFFD
  • If 64-bit is enabled, this parameter will be set to 0xFFFE or 0xFFFF
Note
When 64-bit is used, the reception of packets with 16-bit addresses is disabled and XBee source address is set by factory. The default value for this parameter is: 0x0000
Examples:
xbee802_15_4_receiver.c, and xbee802_15_4_sender.c.
int16_t n_scan_channels

This parameter specify what channels will be scanned for active and energy Scans and during end-device association and coordinator startup. This field shall be filled in this way.

  • 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
The XBee can scan up to 16 channels (0xFFFF) and the XBee PRO can scan up to 13 channels (SC = 0x3FFE).

The default value for this parameter is: 0x1FFE.

uint16_t pan_id

PAN ID. It's possible use one the next range: 0x0000 to 0xFFFF

Examples:
xbee802_15_4_receiver.c, and xbee802_15_4_sender.c.
uint8_t power_level

This parameter configures the value of the power signal:

  • 0 - 4 (XBee / XBee-PRO)
    • 0 = -10 / 10 dBm
    • 1 = -6 / 12 dBm
    • 2 = -4 / 14 dBm
    • 3 = -2 / 16 dBm
    • 4 = 0 / 18 dBm
  • XBee-PRO International variant:
    • 4 = 10 dBm
    • 3 = 8 dBm
    • 2 = 2 dBm
    • 1 = -3 dBm
    • 0 = -3 dBm

The default value for this parameter is: 4

uint8_t scan_channels_time

This parameter shall be defined in different way if the device is:

  • End Device - Duration of active scan during Association.
  • Coordinator - If reassign PAN ID option is set (see cflexibility field in this structure), on Coordinator it determines the length of time the coordinator will scan channels to locate existing PANs. If reassign channel option is set(see cflexibility field in this structure), it determines how long the coordinator will perform an Energy Scan to determine which channel it will operate on.
Note
Scan Time is measured as (number of channels to scan] * (2 ^ scan channels time) * 15.36 ms). E.g: The values below show results for a 13 channel scan:
  • scan_channels_time = 0, time = 0.18 sec
  • scan_channels_time = 2, time = 0.74 sec
  • scan_channels_time = 4, time = 2.95 sec
  • scan_channels_time = 6, time = 11.80 sec
  • scan_channels_time = 8, time = 47.19 sec
  • scan_channels_time = 10, time = 3.15 min
  • scan_channels_time = 12, time = 12.58 min
  • scan_channels_time = 14, time = 50.33 min

The default value for this parameter is: 4.

Sleep mode. This parameter shall be selected amongst the following values:

  • TSMART_XBEE_802_OFF
  • TSMART_XBEE_802_PIN_H
  • TSMART_XBEE_802_PIN_D
  • TSMART_XBEE_802_CYCLIC_PIN
  • TSMART_XBEE_802_COORD

The default value for this parameter is: TSMART_XBEE_802_OFF

tsmart_xbee_802_flag_t sleep_option

Sleep mode option about poll wake up:

  • TSMART_XBEE_802_ENABLE - Normal operations. A module configured for cyclic sleep will poll for data on waking.
  • TSMART_XBEE_802_DISABLE - Disable wake up poll. A module configured for cyclic sleep will not poll for data on waking.

The default value for this parameter is: TSMART_XBEE_802_DISABLE

uint16_t timer_before_sleep

Time period of inactivity (no serial or RF data is sent or received), before activating sleep mode. Timer_before_sleep parameter is only valid with cyclic sleep settings (sleep = TSMART_XBEE_802_CYCLIC or TSMART_XBEE_802_CYCLIC_PIN). Available range: 1 - 0xFFFF [x 1 ms] The default value for this parameter is: 0x0001

uint8_t tx_retries

Maximum number of retries that the module will execute in addition of the 3 set by the default, it shall be: 0-6 retries provided by the 802.15.4. The default value for this parameter is: 0