5. 编译标志

5.1强制的编译标志

在所有设备中都必须使用以下编译标志。编译 标志(也叫做选项)能够生效 在f8wConfig.cfg文件使用 -D 符号,或者在编译器的预定义常量部分中(也成为命令行)。让某个编译选项失效,可以在f8wConfig.cfg文件中的-D选项前放//,或者在编译器预先定义的常量前面放一个小的“x” 在 IAR Embedded Workbench 的 Project->options -> C/C++ Compiler -> Preprocessor选项中。

下面这些编译标志在每一个样例程序的IAR 工程中都被定义:

  • SECURE=1
  • TC_LINKKEY_JOIN

    所有的应用程序包含下面这些族,他们在IAR 的 preprocessor选项中:

  • ZCL_READ

  • ZCL_WRITE
  • ZCL_REPORT
  • ZCL_EZMODE
  • ZCL_BASIC
  • ZCL_IDENTIFY

在f8wZCL.cfg文件中可以找到这些编译标志和命令的描述。

请注意,在 IAR Embedded Workbench for 8051,项目的preprocessor选择中的编译标志将覆盖文件f8wconfig.cfg中设置的定义。在IAR Embedded Workbench for ARM (CC2538) 却是
反方向,f8wConfig.cfg文件将覆盖项目的preprocessor选项中的编译标志。

5.2每种设备强制的编译标志

样例应用程序各有自己的强制标志。请注意,enabling一个族将使 enable Send和ProcessIn功能。由这个应用程序决定使用哪一方。(举个例子,SampleSwitch 使用 ZCL_ON_OFF cluster的 Send 方,而SampleLight使用ZCL_ON_OFF Cluster的 ProcessIn方)。

SampleLight:

  • ZCL_GROUPS
  • ZCL_SCENES
  • ZCL_ON_OFF

SampleSwitch:

  • ZCL_ON_OFF

SampleDoorLock:

  • ZCL_GROUPS
  • ZCL_SCENES

SampleDoorLockController:

  • ZCL_GROUPS
  • ZCL_SCENES
  • ZCL_DOORLOCK

SampleThermostat:

  • ZCL_ON_OFF
  • ZCL_HVAC_CLUSTER

SampleTemperatureSensor:

  • ZCL_TEMPERATURE_MEASUREMENT

SampleHeatingCoolingUnit:

  • ZCL_ON_OFF
  • ZCL_HVAC_CLUSTER

5.3可选的编译标志

下面的这些标志可以包含在一个 Home Automation 工程的 preprocessor 选项中,每添加一个来启用不同的特性。

在所有的样例项目中默认设置下列标志(出来其他特殊的):

  • HOLD_AUTO_START - 防止设备在电源启动后自动加入网络,相反它会让它等待外部事件。这在默认情况下是ZEDs(zigbee endpoint devices)和ZRs(zigbee router)是启用。默认情况下,ZCs(zigbee coordinators)是禁用的。
    在所有的SmartRF05EB工程默认设置以下标志:
  • MT_TASK - 启用MT(Z-Stack’s Monitor and Test Layer)的所用功能,通过串口连接
  • MT_APP_FUNC - 启用MT_APP功能同主处理机
  • MT_SYS_FUNC - 启用在系统级别进行交互,这是与Z-Tool通信所必需的
  • ZTOOL_P1 - 与串行接口工具通信所需的

    附加的标志:

  • MT_UTIL_FUNC - 启用MT_UTIL功能,比如 key press 事件仿真。
  • MT_ZDO_FUNC - 启用MT_ZDO功能,比如 发送 Mgmt_Permit_Joining_req 命令
  • POWER_SAVING - 当设备不活跃的时候,使终端设备休眠并且节能。应该在任何用电池供电的设备上定义。

    英文原文

5. Compilation Flags

5.1 Mandatory Compilation Flags

The following compilation flags are mandatory across all devices. Compilation flags (also called options) can be
enabled using a –D in the f8wConfig.cfg, or in the compiler’s predefined constants section (also called command-
line). To disable the option, either put a // in front of the –D, or put a small “x” in front of the compiler’s predefined
constant in the IAR Embedded Workbench preprocessor section of the project (e.g. xNV_RESTORE).
These compilation flags are defined in the preprocessor section on each sample application IAR project:
 SECURE=1
 TC_LINKKEY_JOIN
All applications include these clusters and are defined in the IAR Workbench preprocessor section:
 ZCL_READ
 ZCL_WRITE
 ZCL_REPORT
 ZCL_EZMODE
 ZCL_BASIC
 ZCL_IDENTIFY
A description of the flags and commands for the specific cluster can be found in f8wZCL.cfg file.
Note that in IAR Embedded Workbench for 8051, the definitions in the project’s preprocessor defined symbols list
will override definitions set in the file f8wConfig.cfg. In IAR Embedded Workbench for ARM (CC2538) works the
opposite way, the definitions in f8wConfig.cfg file will override the project’s preprocessor defined symbols.

5.2 Mandatory Compilation Flags Per Device

The sample applications each have their own mandatory flags. Note that enabling a cluster will enable both the Send
and ProcessIn functions. It is up to the application to decide which side to use (for example, the SampleSwitch uses
the Send side of the ZCL_ON_OFF cluster, whereas the SampleLight uses the ProcessIn side of the ZCL_ON_OFF
Cluster).
SampleLight:
 ZCL_GROUPS
 ZCL_SCENES
 ZCL_ON_OFF
SampleSwitch:
 ZCL_ON_OFF
SampleDoorLock:
 ZCL_GROUPS
 ZCL_SCENES
 ZCL_DOORLOCK
SampleDoorLockController:
 ZCL_GROUPS
 ZCL_SCENES
 ZCL_DOORLOCK
SampleThermostat:
 ZCL_ON_OFF
 ZCL_HVAC_CLUSTER
SampleTemperatureSensor:
 ZCL_TEMPERATURE_MEASUREMENT
SampleHeatingCoolingUnit:
 ZCL_ON_OFF
 ZCL_HVAC_CLUSTER

5.3 Optional Compilation Flags

The following flags may be included in a Home Automation project’s options preprocessor defined symbols list,
each one adding code to enable different feature.
The following flags are set by default on all the sample projects (unless otherwise specified):
 HOLD_AUTO_START – prevents the device from automatically trying to join a network after power-up
when Factory New, and causes it to wait for an external event instead. This is enabled for ZEDs and ZRs
by default. It is disabled for ZCs by default (that is, ZigBee Coordinators starts automatically).
The following flags are set by default on all the SmartRF05EB projects:
 MT_TASK – enables any MT functionality, via serial link.
 MT_APP_FUNC - enables MT_APP functionality for communication with a host processor.
 MT_SYS_FUNC – enables interaction at system level, required for communicating with Z-Tool.
 ZTOOL_P1 – required for communicating with serial interface tool.
Additional flags:
 MT_UTIL_FUNC - enables MT_UTIL functionality, e.g. key press events emulation.
 MT_ZDO_FUNC – enables MT_ZDO functionality, e.g. sending Mgmt_Permit_Joining_req command.
 POWER_SAVING – enables an end-device to sleep and conserve power, when inactive. Should be
defined on any battery-powered device.

Z-Stack Home Developer's Guide—5. Compilation Flags中文翻译【Z-Stack Home 1.2.0开发文档】相关推荐

  1. Z-Stack Home Developer's Guide—2. Overview中文翻译【Z-Stack Home 1.2.0开发文档】

    下面是Z-Stack Home 1.2.0开发资料中的Z-Stack Home Developer's Guide-2. Overview的中文翻译 2.1 简介 这章节将介绍 Z-Stack协议栈的 ...

  2. Z-Stack Home Developer's Guide—6. Clusters, Commands and Attributes中文翻译【Z-Stack Home 1.2.0的开发文档】

    这篇文章将翻译Z-Stack Home Developer's Guide开发文档中的6. Clusters, Commands and Attributes部分,在Z-Stack中Cluster.C ...

  3. Z-Stack Home Developer's Guide—7.EZ-Mode中文翻译【Z-Stack Home 1.2.0的开发文档】

    7. EZ-Mode EZ-Mode提供了两个设备正常交流的能力,无论这个2个设备是否在zigbee网络中.它包括网络控制.网络发现和网络绑定.EZ-Mode有如下特性: 网络控制 - 找到第一个开放 ...

  4. Z-Stack Home Developer's Guide—3. The Home Automation Profile and the Sample Applications中文翻译

    下面是Z-Stack Home 1.2.0开发资料中的Z-Stack Home Developer's Guide-3. The Home Automation Profile and the Sam ...

  5. Z-Stack Home Developer's Guide—8. Additional Information for HA Applications中文翻译

    下面是Z-Stack Home 1.2.0开发资料中的Z-Stack Home Developer's Guide-8. Additional Information for HA Applicati ...

  6. Z-Stack Home Developer's Guide—4.Using the sample applications as base for new applications 中文翻译

    本章节是官方提供的文档说明 如何将样例程序改为我们自己需要开发的程序,下面是中文翻译 4.使用样例程序为基础开发一个新的应用程序 HA样例程序旨在用作用户开的应用程序的基础,修改他们需要遵循如下步骤: ...

  7. 终于知道为什么NVIDIA的linux驱动这么烂了,一波官方文档告诉你:Linux GPU Driver Developer’s Guide

    还记得Linus在记者会上那句话吗? so,NVIDIA, F**k you! https://www.kernel.org/doc/html/latest/gpu/index.html Linux ...

  8. Developer's Guide to Microsoft Enterprise Library, C# Edition

    Developer's Guide to Microsoft Enterprise Library, C# Edition 转载于:https://www.cnblogs.com/gavinhughh ...

  9. Stack Overflow Developer Survey 2016 Results(2016stack overflow 开发者调查报告)

    Overview总览 This year, over fifty thousand developers shared where they work, what they build, and wh ...

最新文章

  1. pycharm导入本地py文件时,模块下方出现红色波浪线时如何解决
  2. php 数据中心,数据层 · Thinkphp 独立数据中心使用手册 · 看云
  3. iOS开发网络篇—数据缓存
  4. spring-security-oauth2实现OAuth2.0服务
  5. html设置页面编码gbk,GBK及UTF-8网页编码定义与应用
  6. ubuntu16.04安装teamviewer12
  7. 过滤ilist中的重复数据
  8. python基于pip和conda配置国内安装源,提升下载安装性能
  9. 服装业成本核算方法大全
  10. 关于匿名者组织(Anonymous),你都知道哪些?
  11. 按出生年月日对身份证号进行排序
  12. 2020成考C语言答案,2020年成人高考语文题库(含历年真题练习题模拟题)
  13. 《Microduino实战》——2.1 Microduino系列产品
  14. cocos creator 牌面翻转
  15. 初中物理公式总结大全(pdf可下载)
  16. 2023 zibll 子比主题 美化插件 全开源
  17. Linux中对lvm逻辑卷的管理
  18. nchar , char , nvarchar , varchar 的区别
  19. mysql怎么样修改schema_MySQL 5.6使用pt-online-schema-change在线修改大表字段长度
  20. Redis 知识点和面试题(持续更新ing)

热门文章

  1. M1芯片MacBook pro重装系统出现报错情况的解决方法
  2. mac使用的正确操作与注意事项(人体工程学)
  3. python常用函数使用方法实例
  4. 【ES6(2015)】解构赋值Desctructuring
  5. git 获取最新代码_程序员必知:这是一份全面 amp; 详细的 Git与Github 介绍指南
  6. 信息安全工程师笔记-网络安全漏洞防护技术原理与应用
  7. Java笔记-多线程协调及ReentrantLock的使用
  8. C++设计模式-单例模式(双重锁定)
  9. WEB安全基础-文件操作漏洞
  10. Java高级语法笔记-语法支持的异常