Commit 5f1910e5 authored by 尹佳钦's avatar 尹佳钦

添加 LightStatus控制

parent 5f8bedfa
......@@ -89,25 +89,33 @@ void emAfZigbeeKeyEstablishment(EmberEUI64 partner, EmberKeyStatus status)
// ReadAttributesResponse function declarations.
bool emberAfReadAttributesResponseCallback(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen);
bool emAfReadAttributesResponse(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen)
{
return emberAfReadAttributesResponseCallback(clusterId, buffer, bufLen);
}
// ReportAttributes function declarations.
bool emberAfReportAttributesCallback(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen);
bool rpc_ReportAttributesCallback(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen);
bool rpc_ReadAttributesResponseCallback(EmberAfClusterId clusterId,uint8_t *buffer,uint16_t bufLen);
bool emAfReportAttributes(EmberAfClusterId clusterId,uint8_t * buffer,uint16_t bufLen)
{
return emberAfReportAttributesCallback(clusterId, buffer, bufLen);
return rpc_ReportAttributesCallback(clusterId, buffer, bufLen);
//return emberAfReportAttributesCallback(clusterId, buffer, bufLen);
}
bool emAfReadAttributesResponse(EmberAfClusterId clusterId,uint8_t* buffer,uint16_t bufLen)
{
rpc_ReadAttributesResponseCallback(clusterId, buffer, bufLen);
return emberAfReadAttributesResponseCallback(clusterId, buffer, bufLen);
}
// PluginDeviceTableDeviceLeft function declarations.
void emAfPluginCommandRelayRemoveDeviceByEui64(EmberEUI64 newNodeEui64);
void emberAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64);
void emAfPluginDeviceTableDeviceLeftCallback(EmberEUI64 newNodeEui64)
{
emAfPluginCommandRelayRemoveDeviceByEui64(newNodeEui64);
//emAfPluginCommandRelayRemoveDeviceByEui64(newNodeEui64);
emberAfPluginDeviceTableDeviceLeftCallback(newNodeEui64);
}
......@@ -90,6 +90,7 @@ static int send_result_resp(cJSON * result,
cJSON *result_root = rpc_cJSON_CreateObject();
if (result)
rpc_cJSON_AddItemToObject(result_root, "code", result);
printf("id json:\n%s\n",id->valuestring);
rpc_cJSON_AddItemToObject(result_root, "msgId", id);
char * str_result = rpc_cJSON_Print(result_root);
......@@ -154,7 +155,7 @@ static int eval_request(struct jrpc_server *server, cJSON *root) {
params = rpc_cJSON_GetObjectItem(root, "params");
if (params == NULL|| params->type == cJSON_Array
|| params->type == cJSON_Object) {
id = rpc_cJSON_GetObjectItem(root, "id");
id = rpc_cJSON_GetObjectItem(root, "msgId");
if (id == NULL|| id->type == cJSON_String
|| id->type == cJSON_Number) {
//We have to copy ID because using it on the reply and deleting the response Object will also delete ID
......
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