通过例子理解Zigbee Application Profile和cluster

The following is a way to use the simple api to develop an application. 按照以下步骤, 创建私有的Application Profile。
 ————————————————————
•  Identify all the devices in the application  标识应用中所有的设备(类型)
–  e.g. temperature sensor, occupancy sensor, thermostat, heating unit and remote control 例如,温度传感器、占用率传感器、恒温器、加热单元和遥控单元

–  assign a device_id ( unique 16bit identifier ) to each of them  为每一设备分配一个独有的标识,16位的device_id

typedef struct
{
  uint8          EndPoint;
  uint16         AppProfId;
  uint16         AppDeviceId;
  uint8          AppDevVer:4;
  uint8          Reserved:4;             // AF_V1_SUPPORT uses for AppFlags:4.
  uint8          AppNumInClusters;
  cId_t         *pAppInClusterList;
  uint8          AppNumOutClusters;
  cId_t         *pAppOutClusterList;
} SimpleDescriptionFormat_t;

 ————————————————————
•  Identify  the  “commands”  that  need  to  be  exchanged  between  these  devices  and  assign a  unique 标识出需要在设备之间传递的“命令”,
16bit command_id to each of them. For example, 并为每条命令分配一个16位的command_id。例如:
–  temperature reading ——读取温度
–  occupancy reading ——读取占用率
–  thermostat setting object ——设置恒温器对象

–  heating/cooling unit control object ——控制制冷/制热单元

————————————————————

•  For each “command”, identify the devices that “produce” ( output ) and “consume” ( input ) it  对于每条“命令”,确定该命令的发出设备(来源)和接收设备(去处)。
–  The temperature reading is “output” from the temp sensor and “input” to the thermostat 例如,“读取温度”命令是由温度传感器发出的,输入到恒温器
–  The  occupancy  reading  command  is “output” from  the  occupancy  sensor  device  and “读取占用率”命令是由传感器输出的,输入到恒温器。
“input” to the thermostat
–  etc.

————————————————————

•  Create the simple descriptor structures for each of the devices. This includes 为每种设备创建一个简单描述符数据结构。该数据结构包括:
–  Assigning a device identifier and device version to each of the devices 为每个设备分配一个设备ID和版本号
–  Specifying the list of “output” and “input” command’s for that device. 为该设备制定“输出的命令”和“接收的命令”的列表。
–  Specify a profile id. This is a 16-bit value that identifies uniquely the application profile. 指明一个Profile ID。该id是唯一标识一个Application Profile的标志。由Zigbee联盟颁发。
————————————————————

•  For each “command” 对于每一条命令
–  define the format of the message being exchanged and its interpretation 定义信息交换的格式及其解析方式
–  e.g. temperature value can be exchanged as  例如,温度值可以这样交换:
•  ( format ) “an 8bit value” (格式)一个8bit的值
•  ( interpretation ) “0 indicates 0oC and 255 indicates 64oC in steps of 0.25o C ” (解析方式)0表示0度,255表示64度,步长为0.25度。

————————————————————

•  Write the device application for each device 为每个设备编写运行其上的应用程序
–  Device with “output” commands should be able to generate the packet either periodically
or when an external event occurs.  具备“输出命令”的设备应当能够定期或应激地产生数据包。
–  Device  with “input”  commands  should  handle  the  reception  of  these  packets  and  parse
the payload. 具备“输入命令”的设备应当负责接收命令数据包,并解析包的载荷。

————————————————————

•  Identify a binding strategy so that the devices will be able to exchange packets correctly. See the
example sample application on how to do this.
确定一个绑定策略,使得设备能够正确地交换数据包。


  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值