This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

what attributes should be added if i want to use window covering with z-stack

Other Parts Discussed in Thread: Z-STACK

I  want to control window covering based on samplelight and sampleswitch with z-stack, i use three commands :

#define COMMAND_CLOSURES_UP_OPEN                        
#define COMMAND_CLOSURES_DOWN_CLOSE                  

 #define COMMAND_CLOSURES_STOP

when enddevice(window covering ) receive one of them, it should implement the command and give a response to coordinator(window covering contorller)

I think the response is to report value of a attribute

so ,what attributes should be added,

 

my codes like this

enddevice:

 

uint8  zclSampleClosures_OpenCloseStop=CLOSURES_WINDOW_COVERING_TYPE_ROLLERSHADE;

CONST zclAttrRec_t zclSampleLight_Attrs[SAMPLELIGHT_MAX_ATTRIBUTES] =
{
  // *** General Basic Cluster Attributes ***
  {
    ZCL_CLUSTER_ID_GEN_BASIC,             // Cluster IDs - defined in the foundation (ie. zcl.h)
    {  // Attribute record
      ATTRID_BASIC_HW_VERSION,            // Attribute ID - Found in Cluster Library header (ie. zcl_general.h)
      ZCL_DATATYPE_UINT8,                 // Data Type - found in zcl.h
      ACCESS_CONTROL_READ,                // Variable access control - found in zcl.h
      (void *)&zclSampleLight_HWRevision  // Pointer to attribute variable
    }
  },

  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_ZCL_VERSION,
      ZCL_DATATYPE_UINT8,
      ACCESS_CONTROL_READ,
      (void *)&zclSampleLight_ZCLVersion
    }
  },

.......

......

  {
   ZCL_CLUSTER_ID_CLOSURES_WINDOW_COVERING,
   {
    ATTRID_CLOSURES_WINDOW_COVERING_TYPE,
    ZCL_DATATYPE_UINT8,
    ACCESS_CONTROL_READ,
    (void *)&zclSampleClosures_OpenCloseStop
   }
  },

 

 

void zclSampleLight_Init( byte task_id )
{
  zclSampleLight_TaskID = task_id;

.....

....

 zclClosures_RegisterCmdCallbacks( SAMPLELIGHT_ENDPOINT, &zclSampleShade_CmdCallbacks );

}

 

static zclClosures_AppCallbacks_t  zclSampleShade_CmdCallbacks=
{
  NULL,
  NULL,
 zclSampleShade_WindowCoveringSimple_t ,
 zclSampleShade_WindowCoveringSimple_t4 ,
 zclSampleShade_WindowCoveringSimple_t5 ,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
 
};

 

  print "open "to instead of open window covering,and which attribute should i report

static void zclSampleShade_WindowCoveringSimple_t (void)
{        HalUARTWrite(0,"open\n",5);    }