mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
check license when add node/tag
This commit is contained in:
@@ -73,8 +73,9 @@ static void pipe_rm_cb(nng_pipe p, nng_pipe_ev ev, void *arg)
|
||||
nng_mtx_unlock(plugin->mtx);
|
||||
}
|
||||
|
||||
static int ekuiper_plugin_init(neu_plugin_t *plugin)
|
||||
static int ekuiper_plugin_init(neu_plugin_t *plugin, bool load)
|
||||
{
|
||||
(void) load;
|
||||
int rv = 0;
|
||||
nng_aio *recv_aio = NULL;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
static neu_plugin_t *driver_open(void);
|
||||
|
||||
static int driver_close(neu_plugin_t *plugin);
|
||||
static int driver_init(neu_plugin_t *plugin);
|
||||
static int driver_init(neu_plugin_t *plugin, bool load);
|
||||
static int driver_uninit(neu_plugin_t *plugin);
|
||||
static int driver_start(neu_plugin_t *plugin);
|
||||
static int driver_stop(neu_plugin_t *plugin);
|
||||
@@ -58,6 +58,9 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
|
||||
.driver.write_tag = driver_write,
|
||||
.driver.tag_validator = driver_tag_validator,
|
||||
.driver.write_tags = NULL,
|
||||
.driver.add_tags = NULL,
|
||||
.driver.load_tags = NULL,
|
||||
.driver.del_tags = NULL,
|
||||
};
|
||||
|
||||
const neu_plugin_module_t neu_plugin_module = {
|
||||
@@ -94,8 +97,9 @@ static int driver_close(neu_plugin_t *plugin)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int driver_init(neu_plugin_t *plugin)
|
||||
static int driver_init(neu_plugin_t *plugin, bool load)
|
||||
{
|
||||
(void) load;
|
||||
plugin->protocol = MODBUS_PROTOCOL_RTU;
|
||||
plugin->events = neu_event_new();
|
||||
plugin->stack = modbus_stack_create((void *) plugin, MODBUS_PROTOCOL_RTU,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
static neu_plugin_t *driver_open(void);
|
||||
|
||||
static int driver_close(neu_plugin_t *plugin);
|
||||
static int driver_init(neu_plugin_t *plugin);
|
||||
static int driver_init(neu_plugin_t *plugin, bool load);
|
||||
static int driver_uninit(neu_plugin_t *plugin);
|
||||
static int driver_start(neu_plugin_t *plugin);
|
||||
static int driver_stop(neu_plugin_t *plugin);
|
||||
@@ -58,6 +58,9 @@ static const neu_plugin_intf_funs_t plugin_intf_funs = {
|
||||
.driver.write_tag = driver_write,
|
||||
.driver.tag_validator = driver_tag_validator,
|
||||
.driver.write_tags = NULL,
|
||||
.driver.add_tags = NULL,
|
||||
.driver.load_tags = NULL,
|
||||
.driver.del_tags = NULL,
|
||||
};
|
||||
|
||||
const neu_plugin_module_t neu_plugin_module = {
|
||||
@@ -94,8 +97,9 @@ static int driver_close(neu_plugin_t *plugin)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int driver_init(neu_plugin_t *plugin)
|
||||
static int driver_init(neu_plugin_t *plugin, bool load)
|
||||
{
|
||||
(void) load;
|
||||
plugin->protocol = MODBUS_PROTOCOL_TCP;
|
||||
plugin->events = neu_event_new();
|
||||
plugin->stack = modbus_stack_create((void *) plugin, MODBUS_PROTOCOL_TCP,
|
||||
|
||||
@@ -292,10 +292,11 @@ static int monitor_plugin_close(neu_plugin_t *plugin)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int monitor_plugin_init(neu_plugin_t *plugin)
|
||||
static int monitor_plugin_init(neu_plugin_t *plugin, bool load)
|
||||
{
|
||||
int rv = 0;
|
||||
(void) plugin;
|
||||
(void) load;
|
||||
|
||||
plog_notice(plugin, "Initialize plugin: %s", neu_plugin_module.module_name);
|
||||
return rv;
|
||||
|
||||
@@ -57,8 +57,9 @@ static int mqtt_plugin_close(neu_plugin_t *plugin)
|
||||
return NEU_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
static int mqtt_plugin_init(neu_plugin_t *plugin)
|
||||
static int mqtt_plugin_init(neu_plugin_t *plugin, bool load)
|
||||
{
|
||||
(void) load;
|
||||
plog_notice(plugin, "initialize plugin `%s` success",
|
||||
neu_plugin_module.module_name);
|
||||
neu_adapter_register_metric_cb_t register_metric =
|
||||
|
||||
@@ -130,8 +130,9 @@ static int dashb_plugin_close(neu_plugin_t *plugin)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int dashb_plugin_init(neu_plugin_t *plugin)
|
||||
static int dashb_plugin_init(neu_plugin_t *plugin, bool load)
|
||||
{
|
||||
(void) load;
|
||||
int rv = 0;
|
||||
|
||||
(void) plugin;
|
||||
|
||||
Reference in New Issue
Block a user