.. _xbee-device-manager:

********************
XBee Device Manager
********************

The XBee Device Manager is a virtual device in Dia that is responsible for
configuring all the XBee devices declared in the YML configuration file.
If you are going to declare an XBee device in your Dia framework (for
example, an :ref:`XBee Sensor <xbee-sensor>`), you will need to
declare and configure the XBee Device Manager.

All XBee devices will need as one of their configuration parameters, the
name of the XBee Device Manager configured in the Dia framework.

Configuration
====================

A typical device manager configuration block looks like this::

    - name: xbee_device_manager
      driver: devices.xbee.xbee_device_manager.xbee_device_manager:XBeeDeviceManager

Settings
--------------------

skip_config_addr_list (optional)
    XBee addresses appearing in this list will skip directly from the
    INIT state to the RUNNING state, by-passing the application of any
    configuration blocks.

    .. Warning::
        Be careful when using this setting. By specifying nodes in this
        list, they will not be configured by the Dia framework,
        potentially leaving the node in an unusable state.

addr_dd_map (optional)
    A map of XBee addresses to DD device type values. By configuring
    this mapping dictionary, a node's DD value will not have to be 
    queried from the network before a node is configured.

    .. Warning::
        Be careful when using this setting. It asserts a node to be of a 
        particular module and product type. Using the wrong value could 
        cause a node to be configured incorrectly.
                                
worker_threads (optional, default: 1)
    Number of handles to manage background tasks in the Dia framework.

update_skiplist (optional, default: False)
    When True, the XBee Device Manager will update and save a new
    configuration file that marks devices as configured by adding them
    to the 'skip_config_addr_list'.  This shortens start-up on
    subsequent boots, assuming that device configuration is only
    modified by the Dia.

    Dia uses the configuration file specified on startup to determine
    where to write modifications.  Using this feature in conjunction
    with manual modifications using the :ref:`settings-device` may
    lead to unexpected behavior if you are not careful changing the
    ``filename`` or ``format`` channels.

    When used with :ref:`xbee-autoenum`, discovered devices will be
    added with a configuration block of their own, to reconfigure
    these devices, that block must be modified or removed from the
    resulting configuration file in addition to removing their address
    from the 'skip_config_addr_list' setting.

Channels
====================

This driver doesn't generate any channels.


