diff --git a/plugins/mqtt/mqtt_handle.c b/plugins/mqtt/mqtt_handle.c index 7f62eacd..b249af4d 100644 --- a/plugins/mqtt/mqtt_handle.c +++ b/plugins/mqtt/mqtt_handle.c @@ -606,6 +606,14 @@ int handle_unsubscribe_group(neu_plugin_t * plugin, return 0; } +int handle_del_group(neu_plugin_t *plugin, neu_req_del_group_t *req) +{ + route_tbl_del(&plugin->route_tbl, req->driver, req->group); + plog_notice(plugin, "del route driver:%s group:%s", req->driver, + req->group); + return 0; +} + int handle_update_group(neu_plugin_t *plugin, neu_req_update_group_t *req) { route_tbl_update_group(&plugin->route_tbl, req->driver, req->group, diff --git a/plugins/mqtt/mqtt_handle.h b/plugins/mqtt/mqtt_handle.h index 905944ff..ba40696e 100644 --- a/plugins/mqtt/mqtt_handle.h +++ b/plugins/mqtt/mqtt_handle.h @@ -49,6 +49,7 @@ int handle_unsubscribe_group(neu_plugin_t * plugin, neu_req_unsubscribe_t *unsub_info); int handle_update_group(neu_plugin_t *plugin, neu_req_update_group_t *req); +int handle_del_group(neu_plugin_t *plugin, neu_req_del_group_t *cmd); int handle_update_driver(neu_plugin_t *plugin, neu_req_update_node_t *req); int handle_del_driver(neu_plugin_t *plugin, neu_reqresp_node_deleted_t *req); diff --git a/plugins/mqtt/mqtt_plugin.c b/plugins/mqtt/mqtt_plugin.c index 0c7d668f..96b58607 100644 --- a/plugins/mqtt/mqtt_plugin.c +++ b/plugins/mqtt/mqtt_plugin.c @@ -384,6 +384,9 @@ static int mqtt_plugin_request(neu_plugin_t *plugin, neu_reqresp_head_t *head, case NEU_REQ_UPDATE_GROUP: error = handle_update_group(plugin, data); break; + case NEU_REQ_DEL_GROUP: + error = handle_del_group(plugin, data); + break; case NEU_REQ_UPDATE_NODE: error = handle_update_driver(plugin, data); break;