微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI Zigbee设计交流 > ZLL 问题的求教

ZLL 问题的求教

时间:10-02 整理:3721RD 点击:

你好!

   在ZLL工程profile文件夹中,有一个文件zcl_lighting.h

   请问这个文件中类似于zclLighting_ColorControl_MoveToHue_t 这些typedefpg定义函数指针的具体实现是在哪里呀?

   谢谢!

   以下是zcl_lighting.h的部份代码:

...//省略
// This callback is called to process a Move To Hue command
typedef ZStatus_t (*zclLighting_ColorControl_MoveToHue_t)( zclCCMoveToHue_t *pCmd );

// This callback is called to process a Move Hue command
typedef ZStatus_t (*zclLighting_ColorControl_MoveHue_t)( zclCCMoveHue_t *pCmd );

// This callback is called to process a Step Hue command
typedef ZStatus_t (*zclLighting_ColorControl_StepHue_t)( zclCCStepHue_t *pCmd );

// This callback is called to process a Move To Saturation command
typedef ZStatus_t (*zclLighting_ColorControl_MoveToSaturation_t)( zclCCMoveToSaturation_t *pCmd );

// This callback is called to process a Move Saturation command
typedef ZStatus_t (*zclLighting_ColorControl_MoveSaturation_t)( zclCCMoveSaturation_t *pCmd );

// This callback is called to process a Step Saturation command
typedef ZStatus_t (*zclLighting_ColorControl_StepSaturation_t)( zclCCStepSaturation_t *pCmd );

....//省略

typedef struct
{
zclLighting_ColorControl_MoveToHue_t pfnColorControl_MoveToHue;
zclLighting_ColorControl_MoveHue_t pfnColorControl_MoveHue;
zclLighting_ColorControl_StepHue_t pfnColorControl_StepHue;
zclLighting_ColorControl_MoveToSaturation_t pfnColorControl_MoveToSaturation;
zclLighting_ColorControl_MoveSaturation_t pfnColorControl_MoveSaturation;
zclLighting_ColorControl_StepSaturation_t pfnColorControl_StepSaturation;
zclLighting_ColorControl_MoveToHueAndSaturation_t pfnColorControl_MoveToHueAndSaturation;
zclLighting_ColorControl_MoveToColor_t pfnColorControl_MoveToColor;
zclLighting_ColorControl_MoveColor_t pfnColorControl_MoveColor;
zclLighting_ColorControl_StepColor_t pfnColorControl_StepColor;
zclLighting_ColorControl_MoveToColorTemperature_t pfnColorControl_MoveToColorTemperature;
zclLighting_ColorControl_EnhancedMoveToHue_t pfnColorControl_EnhancedMoveToHue;
zclLighting_ColorControl_EnhancedMoveHue_t pfnColorControl_EnhancedMoveHue;
zclLighting_ColorControl_EnhancedStepHue_t pfnColorControl_EnhancedStepHue;
zclLighting_ColorControl_EnhancedMoveToHueAndSaturation_t pfnColorControl_EnhancedMoveToHueAndSaturation;
zclLighting_ColorControl_ColorLoopSet_t pfnColorControl_ColorLoopSet;
zclLighting_ColorControl_StopMoveStep_t pfnColorControl_StopMoveStep;
} zclLighting_AppCallbacks_t;

这里只是一个函数指针的定义而已,你可以把他理解为函数名

http://blog.csdn.net/qll125596718/article/details/6891881 

你好!

   感谢你的回复,谢谢!

   我也明白这个typedef的用法,知道这个的意思。我现在想知道这些 函数指针 的具体实现是在哪里? 还是自己来写实现?

只是一个类型的定义啊~ 实现么就是对应注册的函数 zclLighting_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT, &zllSampleLight_LightingCmdCBs );

你可以看下 zllSampleLight_LightingCmdCBs

static zclLighting_AppCallbacks_t zllSampleLight_LightingCmdCBs =
{
zclColor_MoveToHueCB, //Move To Hue Command
zclColor_MoveHueCB, //Move Hue Command
zclColor_StepHueCB, //Step Hue Command
zclColor_MoveToSaturationCB, //Move To Saturation Command
zclColor_MoveSaturationCB, //Move Saturation Command
zclColor_StepSaturationCB, //Step Saturation Command
zclColor_MoveToHueAndSaturationCB, //Move To Hue And Saturation Command
zclColor_MoveToColorCB, // Move To Color Command
zclColor_MoveColorCB, // Move Color Command
zclColor_StepColorCB, // STEP To Color Command
NULL, // Move To Color Temperature Command
zclColor_EnhMoveToHueCB,// Enhanced Move To Hue
zclColor_MoveEnhHueCB, // Enhanced Move Hue;
zclColor_StepEnhHueCB, // Enhanced Step Hue;
zclColor_MoveToEnhHueAndSaturationCB, // Enhanced Move To Hue And Saturation;
zclColor_SetColorLoopCB, // Color Loop Set Command
zclColor_StopCB, // Stop Move Step;
};

你好

  我看到了,确实是这样的。谢谢!

我想再请教一个问题。

  在Z-Stack Lighting 1.0.2(ZLL)代码中,我枳看到有调试HUE、SATURATION的函数和命令,但是没看到相关调试亮度或RGB的,请问ZLL哪里有这样标准函数或profile呀?

谢谢!

亮哥都就是调level的函数,都有实现

RGB就是HUE

你好:

请问zclColor_MoveToHueCB, //Move To Hue Command
zclColor_MoveHueCB, //Move Hue Command
zclColor_StepHueCB, //Step Hue Command

这三个命令分别代表什么功能呢?

static zclLighting_AppCallbacks_t zllSampleLight_LightingCmdCBs =
{
zclColor_MoveToHueCB, //Move To Hue Command
zclColor_MoveHueCB, //Move Hue Command
zclColor_StepHueCB, //Step Hue Command
zclColor_MoveToSaturationCB, //Move To Saturation Command
zclColor_MoveSaturationCB, //Move Saturation Command
zclColor_StepSaturationCB, //Step Saturation Command
zclColor_MoveToHueAndSaturationCB, //Move To Hue And Saturation Command
zclColor_MoveToColorCB, // Move To Color Command
zclColor_MoveColorCB, // Move Color Command
zclColor_StepColorCB, // STEP To Color Command
NULL, // Move To Color Temperature Command
zclColor_EnhMoveToHueCB,// Enhanced Move To Hue
zclColor_MoveEnhHueCB, // Enhanced Move Hue;
zclColor_StepEnhHueCB, // Enhanced Step Hue;
zclColor_MoveToEnhHueAndSaturationCB, // Enhanced Move To Hue And Saturation;
zclColor_SetColorLoopCB, // Color Loop Set Command
zclColor_StopCB, // Stop Move Step;
};

调节亮度的函数是在这里边貌似没有实现?麻烦帮忙解释下

有没有人帮忙回答下啊 ,,

/*********************************************************************
* ZCL General Profile Callback table
*/
static zclGeneral_AppCallbacks_t zllSampleLight_GenCmdCBs =
{
zllSampleLight_BasicResetCB, // Basic Cluster Reset command
zllSampleLight_IdentifyCB, // Identify command
#ifdef ZCL_EZMODE
NULL, // Identify EZ-Mode Invoke command
NULL, // Identify Update Commission State command
#endif
zllSampleLight_IdentifyEffectCB, // Identify Trigger Effect command
zllSampleLight_IdentifyQueryRspCB, // Identify Query Response command
zllSampleLight_OnOffCB, // On/Off cluster commands
zllSampleLight_OnOff_OffWithEffectCB, // On/Off cluster enhanced command Off with Effect
zllSampleLight_OnOff_OnWithRecallGlobalSceneCB, // On/Off cluster enhanced command On with Recall Global Scene
zllSampleLight_OnOff_OnWithTimedOffCB, // On/Off cluster enhanced command On with Timed Off
#ifdef ZCL_LEVEL_CTRL
zclLevel_MoveToLevelCB, // Level Control Move to Level command
zclLevel_MoveCB, // Level Control Move command
zclLevel_StepCB, // Level Control Step command
zclLevel_StopCB, // Level Control Stop command
#endif
#ifdef ZCL_GROUPS
NULL, // Group Response commands
#endif
#ifdef ZCL_SCENES
zllSampleLight_SceneStoreCB, // Scene Store Request command
zllSampleLight_SceneRecallCB, // Scene Recall Request command
NULL, // Scene Response command
#endif
#if ZCL_ALARMS
NULL, // Alarm (Response) commands
#endif
#ifdef SE_UK_EXT
NULL, // Get Event Log command
NULL, // Publish Event Log command
#endif
NULL, // RSSI Location command
NULL // RSSI Location Response command
};

move to level 的callback函数在这里

请问zclColor_MoveToHueCB, //Move To Hue Command
zclColor_MoveHueCB, //Move Hue Command
zclColor_StepHueCB, //Step Hue Command

你好,我是不太理解这几个命令具体什么含义?  Move To Hue Command  Move Hue Command Step Hue Command是什么意思呢?麻烦能回答下,谢谢

你可以去ZigBee 官网, www.zigbee.org 下载ZLL Profile Specification,里面有详细的描述。

这两个相当都对灯不同的操作方式,

zclColor_MoveToHueCB,是发关于Hue的控制命令给一个灯,直接将灯调到某个Hue值,给定一个目标值。

zclColor_MoveHueCB, 是发关于Hue的控制命令给一个灯,直接将灯Hue值向上或向下调整n个单位美妙,一秒种的时间,没有指定具体的目标值。

zclColor_StepHueCB,是发关于Hue的控制命令给一个灯,直接将灯Hue值向上或向下调整一个单位,没有指定具体的目标值。

你只要看这几个函数的参数的结构体,就知道了。

谢谢!

 在www.zigbee.org  一直找不到   ZLL Profile Specification 的下载链接啊!  能否发我一份,谢谢!  邮箱是: chansoncc@sohu.com

http://www.zigbee.org/Standards/ZigBeeLightLink/download.aspx

http://pan.baidu.com/s/1bpzBZjD

这个论坛能否提供点这样的信息啊,不能直接点吗?搞来搞去,下载资料都费劲。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top