27 ) |
27 ) |
28 |
28 |
29 UA_NODE_ID_types = { |
29 UA_NODE_ID_types = { |
30 "int" : ("UA_NODEID_NUMERIC", "{}" ), |
30 "int" : ("UA_NODEID_NUMERIC", "{}" ), |
31 "str" : ("UA_NODEID_STRING" , '"{}"'), |
31 "str" : ("UA_NODEID_STRING" , '"{}"'), |
32 "UUIS" : ("UA_NODEID_UUID" , '"{}"'), |
32 "UUID" : ("UA_NODEID_UUID" , '"{}"'), |
33 } |
33 } |
34 |
34 |
35 lstcolnames = [ "Name", "NSIdx", "IdType", "Id", "Type", "IEC"] |
35 lstcolnames = [ "Name", "NSIdx", "IdType", "Id", "Type", "IEC"] |
36 lstcolwidths = [ 100, 50, 100, 100, 100, 50] |
36 lstcolwidths = [ 100, 50, 100, 100, 100, 50] |
37 lstcoltypess = [ str, int, str, str, str, int] |
37 lstcoltypess = [ str, int, str, str, str, int] |
483 |
483 |
484 #include <open62541/client_config_default.h> |
484 #include <open62541/client_config_default.h> |
485 #include <open62541/client_highlevel.h> |
485 #include <open62541/client_highlevel.h> |
486 #include <open62541/plugin/log_stdout.h> |
486 #include <open62541/plugin/log_stdout.h> |
487 |
487 |
488 UA_Client *client; |
488 static UA_Client *client; |
489 |
489 |
490 #define DECL_VAR(ua_type, C_type, c_loc_name) \\ |
490 #define DECL_VAR(ua_type, C_type, c_loc_name) \\ |
491 UA_Variant c_loc_name##_variant; \\ |
491 static UA_Variant c_loc_name##_variant; \\ |
492 C_type c_loc_name##_buf = 0; \\ |
492 static C_type c_loc_name##_buf = 0; \\ |
493 C_type *c_loc_name = &c_loc_name##_buf; |
493 C_type *c_loc_name = &c_loc_name##_buf; |
494 |
494 |
495 %(decl)s |
495 %(decl)s |
496 |
496 |
497 void __cleanup_%(locstr)s(void) |
497 void __cleanup_%(locstr)s(void) |
499 UA_Client_disconnect(client); |
499 UA_Client_disconnect(client); |
500 UA_Client_delete(client); |
500 UA_Client_delete(client); |
501 } |
501 } |
502 |
502 |
503 |
503 |
504 #define INIT_READ_VARIANT(ua_type, c_loc_name) \\ |
504 #define INIT_READ_VARIANT(ua_type, c_loc_name) \\ |
505 UA_Variant_init(&c_loc_name##_variant); |
505 UA_Variant_init(&c_loc_name##_variant); |
506 |
506 |
507 #define INIT_WRITE_VARIANT(ua_type, ua_type_enum, c_loc_name) \\ |
507 #define INIT_WRITE_VARIANT(ua_type, ua_type_enum, c_loc_name) \\ |
508 UA_Variant_setScalar(&c_loc_name##_variant, (ua_type*)c_loc_name, &UA_TYPES[ua_type_enum]); |
508 UA_Variant_setScalar(&c_loc_name##_variant, (ua_type*)c_loc_name, &UA_TYPES[ua_type_enum]); |
509 |
509 |