#include "kk_tsl_zigbee_map.h"
#include "kk_test.h"

kk_tsl_zigbee_map_t g_tsl_zigbee_map [] = {
	{
		ZIGBEE_COO_PRODUCT_CODE,
		4,
		{
			{KK_TSL_DATA_TYPE_TEXT,"NetChannelState",KK_DUMMY_EP,rpc_nwkPermitJoin,0,0},
			{KK_TSL_DATA_TYPE_TEXT,"test12",KK_PRIMARY_EP,kk_zcl_onoff_set,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID},
			{KK_TSL_DATA_TYPE_TEXT,"test123",KK_PRIMARY_EP,kk_zcl_onoff_set,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID},
			{KK_TSL_DATA_TYPE_TEXT,"test1234",KK_PRIMARY_EP,kk_zcl_onoff_set,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID},		
		}
	},	
	{
		TEST_PRODUCT_CODE,
		3,
		{
			{KK_TSL_DATA_TYPE_TEXT,"OperationMode",KK_PRIMARY_EP,kk_zcl_onoff_set,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID},//开
			{KK_TSL_DATA_TYPE_TEXT,"WorkMode",KK_PRIMARY_EP,kk_zcl_onoff_set,ZCL_WINDOW_COVERING_CLUSTER_ID,ZCL_MODE_ATTRIBUTE_ID},
			{KK_TSL_DATA_TYPE_TEXT,"Position",KK_PRIMARY_EP,kk_zcl_onoff_set,ZCL_WINDOW_COVERING_CLUSTER_ID,ZCL_CURRENT_LIFT_ATTRIBUTE_ID},
		}
	},
};

int kk_find_ctrl_obj(const char *productCode)
{
	int map_num = sizeof(g_tsl_zigbee_map) / sizeof(kk_tsl_zigbee_map_t);
	int index = 0;
	for(index = 0;index < map_num; index++)
	{
		if(!strcmp(productCode,g_tsl_zigbee_map[index].productCode))
		{
			return index;
		}
	}
	return -1;
}

int kk_get_Identity_Num(int index)
{
	return g_tsl_zigbee_map[index].num;
}



