Commit 0de6644f authored by 黄振令's avatar 黄振令
parents 1e3c7b60 bab0bf4f
...@@ -320,7 +320,7 @@ static void read_cb(struct ev_loop *loop, struct ev_io *watcher, int revents) ...@@ -320,7 +320,7 @@ static void read_cb(struct ev_loop *loop, struct ev_io *watcher, int revents)
} }
int res = 0; int res = 0;
kk_tcp_ctrl_t* tcp_ctrl = (kk_tcp_ctrl_t*)watcher->data; kk_tcp_ctrl_t* tcp_ctrl = (kk_tcp_ctrl_t*)watcher->data;
int32_t bytes = read(watcher->fd, buffer, sizeof(buffer)); int32_t bytes = recv(watcher->fd, buffer, sizeof(buffer),0);
if (-1 == bytes) { if (-1 == bytes) {
//tcp Error //tcp Error
if (EINTR != errno && EAGAIN != errno) { if (EINTR != errno && EAGAIN != errno) {
...@@ -659,6 +659,7 @@ static void loop_tcp_client_thread(void *arg){ ...@@ -659,6 +659,7 @@ static void loop_tcp_client_thread(void *arg){
{ {
//接受网络数据 //接受网络数据
_MutexLock(g_client_ctrl.mutex); _MutexLock(g_client_ctrl.mutex);
memset(buf,0x0,sizeof(buf));
ret = read(g_client_ctrl.sd, buf, sizeof(buf)); ret = read(g_client_ctrl.sd, buf, sizeof(buf));
_MutexUnlock(g_client_ctrl.mutex); _MutexUnlock(g_client_ctrl.mutex);
...@@ -670,7 +671,7 @@ static void loop_tcp_client_thread(void *arg){ ...@@ -670,7 +671,7 @@ static void loop_tcp_client_thread(void *arg){
break; break;
} }
}else if(ret > 0){ }else if(ret > 0){
printf("buf = %s\n",buf); //printf("11buf = %s\n",buf);
if (g_client_ctrl.cb != NULL){ if (g_client_ctrl.cb != NULL){
g_client_ctrl.cb(buf,ret,""); g_client_ctrl.cb(buf,ret,"");
} }
...@@ -701,6 +702,7 @@ int kk_reset_retry_num(){ ...@@ -701,6 +702,7 @@ int kk_reset_retry_num(){
int kk_tcp_client_send(char* data, int len){ int kk_tcp_client_send(char* data, int len){
int ret = 0; int ret = 0;
int cnt = 0; int cnt = 0;
if ( data != NULL){ if ( data != NULL){
while(g_client_ctrl.sd == -1 && cnt < 5){ while(g_client_ctrl.sd == -1 && cnt < 5){
printf("[%s] tcp don't connect, sleep 1s !!!! \n",__FUNCTION__); printf("[%s] tcp don't connect, sleep 1s !!!! \n",__FUNCTION__);
......
...@@ -2885,7 +2885,7 @@ static int MQTTAsync_cleanSession(Clients* client) ...@@ -2885,7 +2885,7 @@ static int MQTTAsync_cleanSession(Clients* client)
static int MQTTAsync_deliverMessage(MQTTAsyncs* m, char* topicName, size_t topicLen, MQTTAsync_message* mm) static int MQTTAsync_deliverMessage(MQTTAsyncs* m, char* topicName, size_t topicLen, MQTTAsync_message* mm)
{ {
int rc; int rc;
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
Log(TRACE_MIN, -1, "Calling messageArrived for client %s, queue depth %d", Log(TRACE_MIN, -1, "Calling messageArrived for client %s, queue depth %d",
m->c->clientID, m->c->messageQueue->count); m->c->clientID, m->c->messageQueue->count);
rc = (*(m->ma))(m->maContext, topicName, (int)topicLen, mm); rc = (*(m->ma))(m->maContext, topicName, (int)topicLen, mm);
...@@ -2902,7 +2902,6 @@ void Protocol_processPublication(Publish* publish, Clients* client, int allocate ...@@ -2902,7 +2902,6 @@ void Protocol_processPublication(Publish* publish, Clients* client, int allocate
MQTTAsync_message* mm = NULL; MQTTAsync_message* mm = NULL;
MQTTAsync_message initialized = MQTTAsync_message_initializer; MQTTAsync_message initialized = MQTTAsync_message_initializer;
int rc = 0; int rc = 0;
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
FUNC_ENTRY; FUNC_ENTRY;
if ((mm = malloc(sizeof(MQTTAsync_message))) == NULL) if ((mm = malloc(sizeof(MQTTAsync_message))) == NULL)
......
...@@ -304,7 +304,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock) ...@@ -304,7 +304,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock)
Clients* client = NULL; Clients* client = NULL;
char* clientid = NULL; char* clientid = NULL;
int rc = TCPSOCKET_COMPLETE; int rc = TCPSOCKET_COMPLETE;
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
FUNC_ENTRY; FUNC_ENTRY;
client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content); client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
...@@ -313,7 +312,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock) ...@@ -313,7 +312,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock)
publish->header.bits.retain, publish->payloadlen, min(20, publish->payloadlen), publish->payload); publish->header.bits.retain, publish->payloadlen, min(20, publish->payloadlen), publish->payload);
if (publish->header.bits.qos == 0){ if (publish->header.bits.qos == 0){
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
Protocol_processPublication(publish, client, 1); Protocol_processPublication(publish, client, 1);
} }
else if (!Socket_noPendingWrites(sock)) else if (!Socket_noPendingWrites(sock))
...@@ -324,7 +322,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock) ...@@ -324,7 +322,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock)
rc = MQTTPacket_send_puback(publish->MQTTVersion, publish->msgId, &client->net, client->clientID); rc = MQTTPacket_send_puback(publish->MQTTVersion, publish->msgId, &client->net, client->clientID);
/* if we get a socket error from sending the puback, should we ignore the publication? */ /* if we get a socket error from sending the puback, should we ignore the publication? */
Protocol_processPublication(publish, client, 1); Protocol_processPublication(publish, client, 1);
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
} }
else if (publish->header.bits.qos == 2) else if (publish->header.bits.qos == 2)
{ {
...@@ -374,7 +371,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock) ...@@ -374,7 +371,6 @@ int MQTTProtocol_handlePublishes(void* pack, int sock)
publish1.payloadlen = m->publish->payloadlen; publish1.payloadlen = m->publish->payloadlen;
publish1.MQTTVersion = m->MQTTVersion; publish1.MQTTVersion = m->MQTTVersion;
publish1.properties = m->properties; publish1.properties = m->properties;
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
Protocol_processPublication(&publish1, client, 1); Protocol_processPublication(&publish1, client, 1);
ListRemove(&(state.publications), m->publish); ListRemove(&(state.publications), m->publish);
......
...@@ -148,9 +148,10 @@ static int _dm_init_tsl_params(kk_tsl_t * dev_shadow) ...@@ -148,9 +148,10 @@ static int _dm_init_tsl_params(kk_tsl_t * dev_shadow)
} }
return res; return res;
} }
/*目前支持到三级结构体的属性解析保存到数据库*/
int dm_mgr_properities_db_create(kk_tsl_t* dev_shadow,char *deviceCode,int devType ) int dm_mgr_properities_db_create(kk_tsl_t* dev_shadow,char *deviceCode,int devType )
{ {
int num = 0,idx = 0,index = 0; int num = 0,idx = 0,index = 0,index1 = 0;
kk_tsl_data_t *pProperty = NULL; kk_tsl_data_t *pProperty = NULL;
kk_tsl_data_t *current_data = NULL; kk_tsl_data_t *current_data = NULL;
char tmp_identifiers[256] = {0}; char tmp_identifiers[256] = {0};
...@@ -170,11 +171,29 @@ int dm_mgr_properities_db_create(kk_tsl_t* dev_shadow,char *deviceCode,int devTy ...@@ -170,11 +171,29 @@ int dm_mgr_properities_db_create(kk_tsl_t* dev_shadow,char *deviceCode,int devTy
complex_struct = pProperty->data_value.value; complex_struct = pProperty->data_value.value;
for (index = 0; index < complex_struct->size; index++) { for (index = 0; index < complex_struct->size; index++) {
current_data = (kk_tsl_data_t *)complex_struct->value + index; current_data = (kk_tsl_data_t *)complex_struct->value + index;
if(current_data->data_value.type != KK_TSL_DATA_TYPE_STRUCT ){
memset(tmp_identifiers,0x0,sizeof(tmp_identifiers)); memset(tmp_identifiers,0x0,sizeof(tmp_identifiers));
sprintf(tmp_identifiers,"%s.%s",pProperty->identifier,current_data->identifier); sprintf(tmp_identifiers,"%s.%s",pProperty->identifier,current_data->identifier);
INFO_PRINT("dm_mgr_properities_db_create tmp_identifiers:%s!!\n",tmp_identifiers); INFO_PRINT("dm_mgr_properities_db_create tmp_identifiers:%s!!\n",tmp_identifiers);
kk_property_db_insert(deviceCode,tmp_identifiers,current_data->data_value.type,devType); kk_property_db_insert(deviceCode,tmp_identifiers,current_data->data_value.type,devType);
} }
else{
kk_tsl_data_value_complex_t *complex_struct_1 = NULL;
complex_struct_1 = current_data->data_value.value;
for(index1 = 0; index1 < complex_struct_1->size; index1++){
kk_tsl_data_t *current_data_1 = NULL;
current_data_1 = (kk_tsl_data_t *)complex_struct_1->value + index1;
if(current_data_1->data_value.type != KK_TSL_DATA_TYPE_STRUCT ){
memset(tmp_identifiers,0x0,sizeof(tmp_identifiers));
sprintf(tmp_identifiers,"%s.%s.%s",pProperty->identifier,current_data->identifier,current_data_1->identifier);
INFO_PRINT("dm_mgr_properities_db_create tmp_identifiers:%s!!\n",tmp_identifiers);
kk_property_db_insert(deviceCode,tmp_identifiers,current_data_1->data_value.type,devType);
}
}
}
}
}else }else
{ {
kk_property_db_insert(deviceCode,pProperty->identifier,pProperty->data_value.type,devType); kk_property_db_insert(deviceCode,pProperty->identifier,pProperty->data_value.type,devType);
...@@ -452,9 +471,8 @@ int dm_mgr_init(void) ...@@ -452,9 +471,8 @@ int dm_mgr_init(void)
/* Init Device List */ /* Init Device List */
INIT_LIST_HEAD(&ctx->dev_list); INIT_LIST_HEAD(&ctx->dev_list);
//HAL_GetProduct_Type(product_key);
//HAL_GetProduct_Code(device_name);
HAL_Get_mac(mac); HAL_Get_mac(mac);
res = dm_mgr_device_create(KK_DM_DEVICE_CCU,KK_DM_CCU_DEVICE_PRODUCT_CODE,"CCU_66666",mac,"",&devId); res = dm_mgr_device_create(KK_DM_DEVICE_CCU,KK_DM_CCU_DEVICE_PRODUCT_CODE,"CCU_66666",mac,"",&devId);
if (res != SUCCESS_RETURN) { if (res != SUCCESS_RETURN) {
goto ERROR; goto ERROR;
......
...@@ -908,6 +908,44 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params) ...@@ -908,6 +908,44 @@ int dm_msg_thing_property_post_by_identify(char *deviceCode,cJSON *params)
current_data->data_value.type == KK_TSL_DATA_TYPE_DATE){ current_data->data_value.type == KK_TSL_DATA_TYPE_DATE){
kk_property_db_update_value(deviceCode,tmp_identifiers,current_data->data_value.value); kk_property_db_update_value(deviceCode,tmp_identifiers,current_data->data_value.value);
} }
else if(current_data->data_value.type == KK_TSL_DATA_TYPE_STRUCT){
kk_tsl_data_value_complex_t *complex_struct_1 = NULL;
complex_struct_1 = current_data->data_value.value;
int index1 = 0;
kk_tsl_data_t *current_data_1 = NULL;
cJSON *propertyItem_2 = NULL;
for(index1 = 0; index1 < complex_struct_1->size; index1++){
current_data_1 = (kk_tsl_data_t *)complex_struct_1->value + index1;
propertyItem_2 = cJSON_GetObjectItem(propertyItem_1, current_data_1->identifier);
if(propertyItem_2 != NULL){
memset(tmp_identifiers,0x0,sizeof(tmp_identifiers));
sprintf(tmp_identifiers,"%s.%s.%s",property->identifier,current_data->identifier,current_data_1->identifier);
if(current_data_1->data_value.type == KK_TSL_DATA_TYPE_INT ||
current_data_1->data_value.type == KK_TSL_DATA_TYPE_ENUM||
current_data_1->data_value.type == KK_TSL_DATA_TYPE_BOOL){
sprintf(tmpValue,"%d",current_data_1->data_value.value_int);
kk_property_db_update_value(deviceCode,tmp_identifiers,tmpValue);
}
else if(current_data_1->data_value.type == KK_TSL_DATA_TYPE_FLOAT){
sprintf(tmpValue,"%d",current_data_1->data_value.value_float);
kk_property_db_update_value(deviceCode,tmp_identifiers,tmpValue);
}
else if(current_data_1->data_value.type == KK_TSL_DATA_TYPE_DOUBLE){
sprintf(tmpValue,"%d",current_data_1->data_value.value_double);
kk_property_db_update_value(deviceCode,tmp_identifiers,tmpValue);
}
else if(current_data_1->data_value.type == KK_TSL_DATA_TYPE_TEXT||
current_data_1->data_value.type == KK_TSL_DATA_TYPE_DATE){
kk_property_db_update_value(deviceCode,tmp_identifiers,current_data_1->data_value.value);
}
else{
ERROR_PRINT("Unsupport Type ~~\n");
}
}
}
}
else{ else{
ERROR_PRINT("Unsupport Type\n"); ERROR_PRINT("Unsupport Type\n");
} }
......
...@@ -403,5 +403,28 @@ int kk_property_delete_by_dcode(char deviceCode[DEVICE_CODE_MAXLEN]) ...@@ -403,5 +403,28 @@ int kk_property_delete_by_dcode(char deviceCode[DEVICE_CODE_MAXLEN])
return SUCCESS_RETURN; return SUCCESS_RETURN;
} }
int kk_property_delete_by_identify(char *identify)
{
const char *deleteCmd = "delete from PropertiesInfo where identifier = '%s';";
char *sqlCmd = NULL;
int rc = 0;
char *zErrMsg = 0;
kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx();
_kk_property_db_lock();
sqlCmd = sqlite3_mprintf(deleteCmd,identify);
INFO_PRINT("Table delete data sqlCmd:%s\n",sqlCmd);
rc = sqlite3_exec(ctx->pDb, sqlCmd, NULL, NULL, &zErrMsg);
if( rc != SQLITE_OK ){
ERROR_PRINT("SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}else{
INFO_PRINT("Table delete data successfully\n");
}
sqlite3_free(sqlCmd);
_kk_property_db_unlock();
return SUCCESS_RETURN;
}
......
...@@ -78,6 +78,7 @@ char* kk_load_json(const char *productCode,int type) ...@@ -78,6 +78,7 @@ char* kk_load_json(const char *productCode,int type)
fread(buf, 1, filesize, fp); fread(buf, 1, filesize, fp);
//printf("%s!!!\n",buf); //printf("%s!!!\n",buf);
free(tslPath); free(tslPath);
fclose(fp);
return buf; return buf;
} }
...@@ -10,21 +10,41 @@ const char *kk_tsl_rpt_status_string[] = { ...@@ -10,21 +10,41 @@ const char *kk_tsl_rpt_status_string[] = {
}; };
static cJSON* kk_check_identify(const char * identify,cJSON* root,int index,int status) static cJSON* kk_check_identify(const char * identify,cJSON* root,int index,int status)
{ {
int rev = 0,startIdx = 0; int rev = 0,startIdx2 = 0,startIdx1 = 0;
char *Identify_str; char *Identify_str;
char tmp_Identity[64] = {0}; char tmp_Identity[64] = {0};
rev = kk_tsl_utils_memtok(identify,".",1,&startIdx); rev = kk_tsl_utils_memtok(identify,'.',2,&startIdx2);
if(!rev){ if(!rev){
cJSON* str = NULL; cJSON* str = NULL;
cJSON* str_r = NULL;
kk_tsl_utils_memtok(identify,'.',1,&startIdx1);
str = rpc_cJSON_CreateObject(); str = rpc_cJSON_CreateObject();
Identify_str = identify + 1 + startIdx; Identify_str = identify + 1 + startIdx2;
memset(tmp_Identity,0x0,sizeof(tmp_Identity)); memset(tmp_Identity,0x0,sizeof(tmp_Identity));
memcpy(tmp_Identity,identify,startIdx); memcpy(tmp_Identity,identify+startIdx1+1,startIdx2-startIdx1);
rpc_cJSON_AddNumberToObject(str, Identify_str,status);
str_r = rpc_cJSON_CreateObject();
rpc_cJSON_AddItemToObject(str_r,tmp_Identity,str);
memset(tmp_Identity,0x0,sizeof(tmp_Identity));
memcpy(tmp_Identity,identify,startIdx1);
rpc_cJSON_AddItemToObject(root,tmp_Identity,str_r);
return root;
}
else{
rev = kk_tsl_utils_memtok(identify,'.',1,&startIdx1);
if(!rev){
cJSON* str = NULL;
str = rpc_cJSON_CreateObject();
Identify_str = identify + 1 + startIdx1;
memset(tmp_Identity,0x0,sizeof(tmp_Identity));
memcpy(tmp_Identity,identify,startIdx1);
rpc_cJSON_AddNumberToObject(str, Identify_str,status); rpc_cJSON_AddNumberToObject(str, Identify_str,status);
rpc_cJSON_AddItemToObject(root,tmp_Identity,str); rpc_cJSON_AddItemToObject(root,tmp_Identity,str);
return root; return root;
} }
}
return NULL; return NULL;
...@@ -54,7 +74,6 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId ...@@ -54,7 +74,6 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
root_tmp = kk_check_identify(g_tsl_zigbee_map_glb[index].map.Identity,root,index,status); root_tmp = kk_check_identify(g_tsl_zigbee_map_glb[index].map.Identity,root,index,status);
if(root_tmp != NULL){ if(root_tmp != NULL){
kk_rpc_report_status(root_tmp,mac); kk_rpc_report_status(root_tmp,mac);
//rpc_cJSON_Delete(root_tmp);
return tsl_rpt_success; return tsl_rpt_success;
} }
else{ else{
...@@ -65,7 +84,6 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId ...@@ -65,7 +84,6 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
root_tmp = kk_check_identify(g_tsl_zigbee_map[index].Identity,root,index,status); root_tmp = kk_check_identify(g_tsl_zigbee_map[index].Identity,root,index,status);
if(root_tmp != NULL){ if(root_tmp != NULL){
kk_rpc_report_status(root_tmp,mac); kk_rpc_report_status(root_tmp,mac);
//rpc_cJSON_Delete(root_tmp);
return tsl_rpt_success; return tsl_rpt_success;
} }
else{ else{
...@@ -74,7 +92,6 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId ...@@ -74,7 +92,6 @@ static int kk_tsl_report(EmberEUI64 mac,uint8_t EP,int status,uint16_t clusterId
} }
rpc_cJSON_AddNumberToObject(root, Identify,status); rpc_cJSON_AddNumberToObject(root, Identify,status);
kk_rpc_report_status(root,mac); kk_rpc_report_status(root,mac);
//rpc_cJSON_Delete(root);
return tsl_rpt_success; return tsl_rpt_success;
} }
...@@ -105,7 +122,7 @@ void kk_tsl_report_attribute(EmberEUI64 eui64, ...@@ -105,7 +122,7 @@ void kk_tsl_report_attribute(EmberEUI64 eui64,
g_tsl_zigbee_map[i].attributeId == attributeId && g_tsl_zigbee_map[i].attributeId == attributeId &&
g_tsl_zigbee_map[i].zigbee_report!=NULL){ g_tsl_zigbee_map[i].zigbee_report!=NULL){
status = g_tsl_zigbee_map[i].zigbee_report(eui64,EP,clusterId,attributeId,dataType,len,data); status = g_tsl_zigbee_map[i].zigbee_report(eui64,EP,clusterId,attributeId,dataType,len,data);
emberAfDebugPrintln("report status:%s",kk_tsl_rpt_status_string[status]); emberAfDebugPrintln("report status:%d",status);
return ; return ;
} }
} }
...@@ -129,6 +146,38 @@ void kk_tsl_report_attribute(EmberEUI64 eui64, ...@@ -129,6 +146,38 @@ void kk_tsl_report_attribute(EmberEUI64 eui64,
} }
} }
int kk_tsl_report_global_Brightness(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data)
{
uint8_t value = data[0];
emberAfAppPrintln("[tsl report:kk_tsl_report_global_Brightness] value:%d\n",value);
printf("[%s][%d]dataType:%d\n",__FUNCTION__,__LINE__,dataType);
if(dataType == ZCL_INT8U_ATTRIBUTE_TYPE){
printf("[%s][%d]len:%d\n",__FUNCTION__,__LINE__,len);
if(len==1){
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
kk_tsl_report(eui64,EP,value,clusterId,attributeId);
return tsl_rpt_success;
}
return tsl_rpt_invaild_len;
}
return tsl_rpt_invaild_type;
}
int kk_tsl_report_global_RGB(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data)
{
uint8_t value = data[0];
emberAfAppPrintln("[tsl report:kk_tsl_report_global_RGB] value:%d\n",value);
printf("[%s][%d]dataType:%d\n",__FUNCTION__,__LINE__,dataType);
if(dataType == ZCL_INT8U_ATTRIBUTE_TYPE){
printf("[%s][%d]len:%d\n",__FUNCTION__,__LINE__,len);
if(len==1){
printf("[%s][%d]\n",__FUNCTION__,__LINE__);
kk_tsl_report(eui64,EP,value,clusterId,attributeId);
return tsl_rpt_success;
}
return tsl_rpt_invaild_len;
}
return tsl_rpt_invaild_type;
}
int kk_tsl_report_global_onoff(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data) int kk_tsl_report_global_onoff(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data)
{ {
......
...@@ -23,7 +23,8 @@ void kk_tsl_report_attribute(EmberEUI64 eui64, ...@@ -23,7 +23,8 @@ void kk_tsl_report_attribute(EmberEUI64 eui64,
int kk_tsl_report_global_onoff(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data); int kk_tsl_report_global_onoff(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
int kk_tsl_report_windowCovering_mode(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data); int kk_tsl_report_windowCovering_mode(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
int kk_tsl_report_windowCovering_position(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data); int kk_tsl_report_windowCovering_position(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
int kk_tsl_report_global_Brightness(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
int kk_tsl_report_global_RGB(EmberEUI64 eui64,uint8_t EP,EmberAfClusterId clusterId,EmberAfAttributeId attributeId,uint8_t dataType,uint8_t len,uint8_t *data);
......
...@@ -13,9 +13,14 @@ int kk_tsl_set_windowCovering_OperationMode(jrpc_context * ctx,EmberNodeId node, ...@@ -13,9 +13,14 @@ int kk_tsl_set_windowCovering_OperationMode(jrpc_context * ctx,EmberNodeId node,
int kk_tsl_set_windowCovering_mode(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data); int kk_tsl_set_windowCovering_mode(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_windowCovering_position(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data); int kk_tsl_set_windowCovering_position(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_OnOff(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_ModeType(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_Mode(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_Brightness(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_WhiteBrightness(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_RGB_red(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_RGB_green(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
int kk_tsl_set_colorlight_RGB_blue(jrpc_context * ctx,EmberNodeId node,unsigned char ep,void* data);
......
...@@ -199,11 +199,183 @@ EmberStatus zclColorControlStepcolortemp(uint16_t node, ...@@ -199,11 +199,183 @@ EmberStatus zclColorControlStepcolortemp(uint16_t node,
EmberStatus zclGroupsAddGroup(uint16_t node,
uint8_t ep,
uint16_t id,
char *name);
EmberStatus zclGroupsViewGroup(uint16_t node,
uint8_t ep,
uint16_t id);
EmberStatus zclGroupsGetGroupMembership(uint16_t node,
uint8_t ep,
uint16_t count,
uint16_t *list);
EmberStatus zclGroupsRemoveGroup(uint16_t node,
uint8_t ep,
uint16_t id);
EmberStatus zclGroupsRemoveAllGroups(uint16_t node,
uint8_t ep);
EmberStatus zclGroupsAddGroupIfIdentifying(uint16_t node,
uint8_t ep,
uint16_t id,
char *name);
EmberStatus zclScenesAddScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id,
uint16_t trs_time,
char *name,
uint8_t extLen,
uint8_t* extData);
EmberStatus zclScenesViewScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id);
EmberStatus zclScenesRemoveScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id);
EmberStatus zclScenesRemoveAllScene(uint16_t node,
uint8_t ep,
uint16_t g_id);
EmberStatus zclScenesStoreScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id);
EmberStatus zclScenesRecallScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id,
uint16_t trsTime);
EmberStatus zclScenesGetSceneMembership(uint16_t node,
uint8_t ep,
uint16_t g_id);
EmberStatus zclScenesEnhancedAddScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id,
uint16_t trs_time,
char *name,
uint8_t extLen,
uint8_t* extData);
EmberStatus zclScenesEnhancedViewScene(uint16_t node,
uint8_t ep,
uint16_t g_id,
uint16_t s_id);
EmberStatus zclScenesCopyScene(uint16_t node,
uint8_t ep,
uint8_t mode,
uint16_t gidFrom,
uint16_t sidFrom,
uint16_t gidTo,
uint16_t sidTo);
EmberStatus zclLevel_MoveToLevel(uint16_t node,
uint8_t ep,
uint8_t level,
uint16_t trsTime,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_Move(uint16_t node,
uint8_t ep,
uint8_t mode,
uint8_t rate,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_Step(uint16_t node,
uint8_t ep,
uint8_t mode,
uint8_t size,
uint16_t trsTime,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_Stop(uint16_t node,
uint8_t ep,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_MoveToLevelWithOnOff(uint16_t node,
uint8_t ep,
uint8_t level,
uint16_t trsTime,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_MoveWithOnOff(uint16_t node,
uint8_t ep,
uint8_t mode,
uint8_t rate,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_StepWithOnOff(uint16_t node,
uint8_t ep,
uint8_t mode,
uint8_t size,
uint16_t trsTime,
uint8_t *mask,
uint8_t *override);
EmberStatus zclLevel_StopWithOnOff(uint16_t node,
uint8_t ep,
uint8_t *mask,
uint8_t *override);
EmberStatus zclWD_StartWarning(uint16_t node,
uint8_t ep,
uint8_t mode,
uint16_t duration,
uint8_t cycle,
uint8_t level);
EmberStatus zclWD_Squawk(uint16_t node,
uint8_t ep,
uint8_t mode);
EmberStatus zclThermostat_Setpoint_Raise_Lower(uint16_t node,
uint8_t ep,
uint8_t mode,
uint8_t amount);
EmberStatus zclThermostat_GetWeeklySchedule(uint16_t node,
uint8_t ep,
uint8_t days,
uint8_t mode);
EmberStatus zclThermostat_ClearWeeklySchedule(uint16_t node,
uint8_t ep);
EmberStatus zclThermostat_GetRelayStatusLog(uint16_t node,
uint8_t ep);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment