Method: OPCUA::Server::Node#description=
- Defined in:
- ext/opcua/server/server.c
#description=(value) ⇒ Object
{{{
896 897 898 899 900 901 902 903 904 905 906 907 908 909 |
# File 'ext/opcua/server/server.c', line 896
static VALUE node_description_set(VALUE self, VALUE value) { //{{{
node_struct *ns;
Data_Get_Struct(self, node_struct, ns);
if (!ns->exists) rb_raise(rb_eRuntimeError, "Node does not exist anymore.");
VALUE str = rb_obj_as_string(value);
if (NIL_P(str) || TYPE(str) != T_STRING)
rb_raise(rb_eTypeError, "cannot convert obj to string");
char *nstr = (char *)StringValuePtr(str);
UA_LocalizedText lt = UA_LOCALIZEDTEXT("en-US",nstr);
UA_Server_writeDescription(ns->master->master, ns->id, lt);
return self;
}
|