You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library fails to encode long strings (512 bytes in my tests), resulting in a BadEncodingError.
As a workaround, I had to increase UA_VALUENCODING_MAXSTACK accordingly, which of course is not adequate for embedded systems with limited stack sizes.
Maybe there is any issue in the chunking strategy? Or are there any limits imposed on individual variables?
Background Information / Reproduction Steps
Server code reproducing the Issue:
intmain(void) {
signal(SIGINT, stopHandler);
signal(SIGTERM, stopHandler);
UA_ServerConfig*config=UA_ServerConfig_new_default();
UA_Server*server=UA_Server_new(config);
charsMyLongString [512+1];
memset(sMyLongString, 'a', sizeof(sMyLongString));
sMyLongString[sizeof(sMyLongString) -1] =0;
/* Define the attribute of the myString variable node */UA_VariableAttributesattr=UA_VariableAttributes_default;
UA_StringmyString=UA_STRING(sMyLongString);
UA_Variant_setScalar(&attr.value, &myString, &UA_TYPES[UA_TYPES_STRING]);
attr.description=UA_LOCALIZEDTEXT("en-US", "my long string");
attr.displayName=UA_LOCALIZEDTEXT("en-US", "my long string");
attr.dataType=UA_TYPES[UA_TYPES_STRING].typeId;
attr.accessLevel=UA_ACCESSLEVELMASK_READ | UA_ACCESSLEVELMASK_WRITE;
/* Add the variable node to the information model */UA_NodeIdmyStringNodeId=UA_NODEID_STRING(1, "mylongstring");
UA_QualifiedNamemyStringName=UA_QUALIFIEDNAME(1, "mylongstring");
UA_NodeIdparentNodeId=UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
UA_NodeIdparentReferenceNodeId=UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES);
UA_Server_addVariableNode(server, myStringNodeId, parentNodeId,
parentReferenceNodeId, myStringName,
UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE), attr, NULL, NULL);
UA_StatusCoderetval=UA_Server_run(server, &running);
UA_Server_delete(server);
UA_ServerConfig_delete(config);
return (int)retval;
}
Server output:
[2018-06-13 09:33:27.230 (UTC+0200)] warn/session Connection 444 | SecureChannel 1 | Session bcda5fc0-8d9d-7388-ae5a-15718ee8aeda | Subscription 2 | MonitoredItem 1 | Could not encode the value the MonitoredItem with status BadEncodingError
Client used: UaExpert
Checklist
Please provide the following information:
open62541 Version (release number or git tag): 0.3-rc1-242-ga4d59260
Other OPC UA SDKs used (client or server):
Operating system: Windows, embedded
Logs (with UA_LOGLEVEL set as low as necessary) attached
Wireshark network dump attached
Self-contained code example attached
Critical issue
The text was updated successfully, but these errors were encountered:
Description
The library fails to encode long strings (512 bytes in my tests), resulting in a BadEncodingError.
As a workaround, I had to increase
UA_VALUENCODING_MAXSTACK
accordingly, which of course is not adequate for embedded systems with limited stack sizes.Maybe there is any issue in the chunking strategy? Or are there any limits imposed on individual variables?
Background Information / Reproduction Steps
Server code reproducing the Issue:
Server output:
Client used: UaExpert
Checklist
Please provide the following information:
0.3-rc1-242-ga4d59260
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: