Various unrelated code quality enhancements and fixes with no effect on execution.
--- a/mqtt/mqtt_client_gen.py Fri Dec 20 14:32:33 2024 +0100
+++ b/mqtt/mqtt_client_gen.py Fri Dec 20 14:37:10 2024 +0100
@@ -477,7 +477,8 @@
if item_datatype not in MQTT_JSON_SUPPORTED_types and\
item_datatype not in MQTT_UNSUPPORTED_types:
recurseJsonTypes(item_datatype)
- def typeCategory(iec_type):
+
+ def typeCategory(field_iec_type):
if field_iec_type in arrays:
return "ARRAY"
elif field_iec_type in structures:
--- a/mqtt/mqtt_template.c Fri Dec 20 14:32:33 2024 +0100
+++ b/mqtt/mqtt_template.c Fri Dec 20 14:37:10 2024 +0100
@@ -30,7 +30,7 @@
// MQTTCLIENT_TRACE_PROTOCOL, MQTTCLIENT_TRACE_MAXIMUM, MQTTCLIENT_TRACE_ERROR
#define MQTT_DEBUG_LEVEL MQTTCLIENT_TRACE_ERROR
-void trace_callback(enum MQTTCLIENT_TRACE_LEVELS level, char* message)
+static void trace_callback(enum MQTTCLIENT_TRACE_LEVELS level, char* message)
{{
if(level >= MQTT_DEBUG_LEVEL)
{{
@@ -148,7 +148,7 @@
}}
#define DECL_JSON_INPUT(C_type, c_loc_name) \
-int json_parse_##c_loc_name(char *json, const int len, void *void_ptr) {{ \
+static int json_parse_##c_loc_name(char *json, const int len, void *void_ptr) {{ \
C_type *struct_ptr = (C_type *)void_ptr; \
return json_scanf(json, len, "{{" TYPE_##C_type(scanf_fmt,) "}}", TYPE_##C_type(scanf_args, struct_ptr)); \
}}
@@ -159,7 +159,7 @@
static int json_out_len = 0;
#define DECL_JSON_OUTPUT(C_type, c_loc_name) \
-int json_gen_##c_loc_name(C_type *struct_ptr) {{ \
+static int json_gen_##c_loc_name(C_type *struct_ptr) {{ \
struct json_out out = JSON_OUT_BUF(json_out_buf, json_out_size); \
json_out_len = json_printf(&out, "{{" TYPE_##C_type(printf_fmt,) "}}", TYPE_##C_type(printf_args, struct_ptr)); \
if(json_out_len > json_out_size){{ \
@@ -247,7 +247,7 @@
MQTTClient_destroy(&client);
}}
-void connectionLost(void* context, char* reason)
+static void connectionLost(void* context, char* reason)
{{
int rc;
LogWarning("ConnectionLost, reconnecting\\n");
--- a/svghmi/svghmi_server.py Fri Dec 20 14:32:33 2024 +0100
+++ b/svghmi/svghmi_server.py Fri Dec 20 14:37:10 2024 +0100
@@ -253,7 +253,7 @@
size = ctypes.c_uint32()
ptr = ctypes.c_void_p()
res = 0
- while svghmi_continue_collect:
+ while svghmi_continue_collect.value:
svghmi_wait()
for svghmi_session in svghmi_session_manager.iter_sessions():
res = svghmi_send_collect(