0# Example wpantund configuration file
#

# The desired name of the network interface (not supported on all platforms)
# Default value is `wpan0`.
#
Config:TUN:InterfaceName wpan0

# Path to serial port used to communicate with the NCP.
# Has special meaning when prefixed with `system:` or `serial:`.
# If the path is an IPv4 address/port, it will use a TCP socket.
#
Config:NCP:SocketPath "/dev/tty.usbmodem1234"
Config:NCP:SocketPath "127.0.0.1:4901"
Config:NCP:SocketPath "system:/usr/local/sbin/spi-server -p - -s /dev/spidev2.0"
Config:NCP:SocketPath "serial:/dev/ttyO1,raw,b115200,crtscts=1"

# The desired NCP driver to use.
# Default value is `spinel`.
#
Config:NCP:DriverName spinel

# Describes what type of serial reliability layer should be used, if any.
# Generally this is set appropriately automatically, so you usually
# don't need to bother setting this.
#
# Optional. Default value is automatic.
#
Config:NCP:ReliabilityLayer libsoot

# The default transmit power of the NCP, measured in dBm
# (0 dBm is one milliwatt, can be negative)
#
# Optional. Default value is NCP-specific.
#
NCP:TXPower 0

# The CCA threshold value, measured in dBm
#
# Optional. Default value is NCP-specific.
#
NCP:CCAThreshold -70

# Path to reset pin. This socket is opened and values sent to it
# based on the desired reset state. wpantund sends `0\n` to
# assert the reset pin and sends `1\n` to deassert the reset pin.
# Can be used with the same `system:` and `serial:` prefixes defined
# above to handle special cases. On linux, you would generally
# set this to the `value` file of the RESET GPIO.
#
# Optional. If not set, only software resets will be possible.
#
Config:NCP:HardResetPath "/sys/class/gpio/gpio49/value"

# Path to power pin. The semantics are similar to those for
# `NCPHardResetPath` above, except that wpantund sends `0\n` to
# indicate that the NCP power should be disabled and `1\n` to
# indicate that the NCP power should be enabled.
#
# Optional. If not set, only software induced sleep will be used
# for low-power states.
#
Config:NCP:PowerPath "/sys/class/gpio/gpio11/value"

# Syslog mask adjustment. This property is a set of
# boolean masks for manipulating the bitmask used by `syslog()`.
# The string can contain the following words that represent
# the associated bit. The presence of the word in the string
# indicates that that bit should be set. Prefixing the word with
# a `-` (dash/minus) indicates that that bit should be cleared.
# The following keywords are supported:
#
# * `all` (All log levels)
# * `emerg`
# * `alert`
# * `crit`
# * `err`
# * `warn`
# * `notice`
# * `info`
# * `debug`
#
# So, for example, to get all log messages except debugging
# messages, you would use `all -debug`.
#
# Optional. The default value for non-debug builds is
# `all -info -debug`.
#
Daemon:SyslogMask "all -info -debug"

# Drop root privileges to the given user (and that user's group)
# after setting up all network interfaces and socket connections.
# Doing this helps mitigate the implications of security exploits,
# but may interfere with how hard resets are performed for certain
# NCPs.
#
# Optional. Default value is empty, which means that privileges
# are not dropped.
#
Config:Daemon:PrivDropToUser "nobody"

# Call `chroot()` to change the root directory to the directory
# indicated, after setting up all network interfaces and socket
# connections, but before privileges are dropped for `PrivDropToUser`
# (if set). Doing this helps mitigate the implications of security
# exploits, but may interfere with how hard resets are performed
# for certain NCPs.
#
# Optional. Default value is empty, which means that `chroot` is
# not called.
#
Config:Daemon:Chroot "/var/empty"

# Automatic firmware update enable/disable. This flag determines
# if the automatic firmware update mechanism (which uses the
# properties `FirmwareCheckCommand` and `FirmwareUpgradeCommand`,
# described below) is enabled or disabled. This flag is used
# when the driver determines that it doesn't know how to talk to
# the version of the firmware that is running on the NCP.
#
# If set to true, the NCP association state will then be set to
# `upgrading` and the firmware update process will begin. If set to
# false, the NCP association state will change to `fault`.
#
# This property may be changed at runtime to more strictly
# control when a firmware update is allowed to take place.
#
# Optional. The default value is false---which will prevent
# automatic wpantund-driven firmware updates.
#
Daemon:AutoFirmwareUpdate true

# Firmware update check command. This command is executed with
# the retrieved version string of the NCP appended as the last
# argument. If the command returns `0`, a firmware update is
# necessary. This configuration option is fairly useless without
# the `FirmwareUpgradeCommand` option also being set, defined below.
#
# Optional. If left blank, wpantund-driven firmware updates will
# be disabled.
#
Config:NCP:FirmwareCheckCommand "test 'MyFunStack/1.0' !="
Config:NCP:FirmwareCheckCommand "/usr/local/sbin/zb-loader --is-update-required /usr/share/ncp-firmware/ip-modem-app.bin"

# Firmware upgrade command. This is the command that is actually
# executed that performs the firmware update. Before calling this
# command, `wpantund` disconnects entirely from the NCP. While
# this command is executing, the association state reported
# for this interface will be `upgrading`.
#
# Optional. If left blank, wpantund-driven firmware updates will
# be disabled.
#
Config:NCP:FirmwareUpgradeCommand "/usr/local/sbin/zb-loader /dev/ttyO1 --app-easyload /usr/share/ncp-firmware/ip-modem-app.bin"
