mirror of
https://github.com/stargieg/bacnet-stack
synced 2025-10-26 23:35:52 +08:00
clean up uci
This commit is contained in:
parent
5dde6e1ca4
commit
82c684b5e7
|
|
@ -145,7 +145,7 @@ void Binary_Input_Init(
|
|||
initialized = true;
|
||||
ctx = ucix_init("bacnet_bi");
|
||||
if(!ctx)
|
||||
fprintf(stderr, "Failed to load config file");
|
||||
fprintf(stderr, "Failed to load config file bacnet_bi\n");
|
||||
|
||||
ucidescription_default = ucix_get_option(ctx, "bacnet_bi", "default",
|
||||
"description");
|
||||
|
|
@ -269,6 +269,9 @@ void Binary_Input_Init(
|
|||
BI_Descr[i].Disable=true;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "max_binary_inputs %i\n", max_binary_inputs);
|
||||
if(ctx)
|
||||
ucix_cleanup(ctx);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ void Binary_Output_Init(
|
|||
initialized = true;
|
||||
ctx = ucix_init("bacnet_bo");
|
||||
if(!ctx)
|
||||
fprintf(stderr, "Failed to load config file");
|
||||
fprintf(stderr, "Failed to load config file bacnet_bo\n");
|
||||
|
||||
ucidescription_default = ucix_get_option(ctx, "bacnet_bo", "default",
|
||||
"description");
|
||||
|
|
@ -269,6 +269,9 @@ void Binary_Output_Init(
|
|||
BO_Descr[i].Disable=true;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "max_binary_outputs %i\n", max_binary_outputs);
|
||||
if(ctx)
|
||||
ucix_cleanup(ctx);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
//#define MAX_MULTI_STATE_INPUTS 65535
|
||||
#define MAX_MULTI_STATE_INPUTS 512
|
||||
#endif
|
||||
unsigned max_multi_state_inputs_int = 512;
|
||||
unsigned max_multi_state_inputs_int = 0;
|
||||
|
||||
/* When all the priorities are level null, the present value returns */
|
||||
/* the Relinquish Default value */
|
||||
|
|
@ -149,7 +149,7 @@ void Multistate_Input_Init(
|
|||
initialized = true;
|
||||
ctx = ucix_init("bacnet_mi");
|
||||
if(!ctx)
|
||||
fprintf(stderr, "Failed to load config file");
|
||||
fprintf(stderr, "Failed to load config file bacnet_mi\n");
|
||||
|
||||
ucidescription_default = ucix_get_option(ctx, "bacnet_mi", "default",
|
||||
"description");
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
//#define MAX_MULTI_STATE_OUTPUTS 65535
|
||||
#define MAX_MULTI_STATE_OUTPUTS 512
|
||||
#endif
|
||||
unsigned max_multi_state_outputs_int = 512;
|
||||
unsigned max_multi_state_outputs_int = 0;
|
||||
|
||||
/* When all the priorities are level null, the present value returns */
|
||||
/* the Relinquish Default value */
|
||||
|
|
@ -149,7 +149,7 @@ void Multistate_Output_Init(
|
|||
initialized = true;
|
||||
ctx = ucix_init("bacnet_mo");
|
||||
if(!ctx)
|
||||
fprintf(stderr, "Failed to load config file");
|
||||
fprintf(stderr, "Failed to load config file bacnet_mo\n");
|
||||
|
||||
ucidescription_default = ucix_get_option(ctx, "bacnet_mo", "default",
|
||||
"description");
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
//#define MAX_MULTI_STATE_VALUES 65535
|
||||
#define MAX_MULTI_STATE_VALUES 512
|
||||
#endif
|
||||
unsigned max_multi_state_values_int = 512;
|
||||
unsigned max_multi_state_values_int = 0;
|
||||
|
||||
/* When all the priorities are level null, the present value returns */
|
||||
/* the Relinquish Default value */
|
||||
|
|
@ -150,7 +150,7 @@ void Multistate_Value_Init(
|
|||
initialized = true;
|
||||
ctx = ucix_init("bacnet_mv");
|
||||
if(!ctx)
|
||||
fprintf(stderr, "Failed to load config file");
|
||||
fprintf(stderr, "Failed to load config file bacnet_mv\n");
|
||||
|
||||
ucidescription_default = ucix_get_option(ctx, "bacnet_mv", "default",
|
||||
"description");
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ void Trend_Log_Init(
|
|||
fprintf(stderr, "Trend_Log_Init\n");
|
||||
ctx = ucix_init("bacnet_tl");
|
||||
if(!ctx)
|
||||
fprintf(stderr, "Failed to load config file");
|
||||
fprintf(stderr, "Failed to load config file bacnet_tl\n");
|
||||
|
||||
ucidescription_default = ucix_get_option(ctx, "bacnet_tl", "default",
|
||||
"description");
|
||||
|
|
@ -204,22 +204,36 @@ void Trend_Log_Init(
|
|||
} */
|
||||
switch (uciobject_type) {
|
||||
case OBJECT_ANALOG_INPUT:
|
||||
uciobject_s = "bacnet_ai";
|
||||
if (strcmp(uciobject_s,"bacnet_ai") != 0) {
|
||||
uciobject_s = "bacnet_ai";
|
||||
ctxd = ucix_init(uciobject_s);
|
||||
}
|
||||
break;
|
||||
case OBJECT_ANALOG_OUTPUT:
|
||||
uciobject_s = "bacnet_ao";
|
||||
if (strcmp(uciobject_s,"bacnet_ao") != 0) {
|
||||
uciobject_s = "bacnet_ao";
|
||||
ctxd = ucix_init(uciobject_s);
|
||||
}
|
||||
break;
|
||||
case OBJECT_ANALOG_VALUE:
|
||||
uciobject_s = "bacnet_av";
|
||||
if (strcmp(uciobject_s,"bacnet_av") != 0) {
|
||||
uciobject_s = "bacnet_av";
|
||||
ctxd = ucix_init(uciobject_s);
|
||||
}
|
||||
break;
|
||||
case OBJECT_MULTI_STATE_VALUE:
|
||||
uciobject_s = "bacnet_mv";
|
||||
if (strcmp(uciobject_s,"bacnet_mv") != 0) {
|
||||
uciobject_s = "bacnet_mv";
|
||||
ctxd = ucix_init(uciobject_s);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
uciobject_s = "bacnet_tl";
|
||||
if (strcmp(uciobject_s,"bacnet_tl") != 0) {
|
||||
uciobject_s = "bacnet_tl";
|
||||
ctxd = ucix_init(uciobject_s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
ctxd = ucix_init(uciobject_s);
|
||||
uciname = ucix_get_option(ctxd, uciobject_s,
|
||||
i_instance_string, "name");
|
||||
ucidisable = ucix_get_option_int(ctxd, uciobject_s,
|
||||
|
|
@ -308,6 +322,9 @@ void Trend_Log_Init(
|
|||
TL_Descr[i].Disable=true;
|
||||
}
|
||||
}
|
||||
fprintf(stderr, "max_trend_logs %i\n", max_trend_logs_int);
|
||||
if(ctx)
|
||||
ucix_cleanup(ctx);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user