Python3 str type is unicode UTF-8 by default. The bytes or bytearray types are more appropriate to communicate with a peer expecting C strings. In the Connector Python binding, there is a lot of round-tripping between C strings and UTF-8 Python str. This has the possibility of corrupting data or throwing errors when the content is not meant to be UTF-8. On top of that, those operations are slow. There are lower-level and "native" functions within Connector, but I can't find much information about their semantics and best practices.
string
Hi, I have a problem on DDS.
I set string lenth in idl is 65536, but when I publish data, it said: string too long, truncated to 1024.
Here is my idl struct setting,
struct datamsg {
string<8> ID;
string<128> file_name;
string<65536> data;
long timestamp;
};
please tell me how to fix it, thanks.
Karen
Hello,
I am a bit new to DDS. I am curently working with the request/reply pattern. I successfully managed to send requests and replies containing primitive types of data such as char, long, int, etc. What I am not trying to do is sending some string array with the request reply pattern and using Dynamic Data as the string array I'm trying to send must be custom made. Until now I managed to do something like this:
//Register the type support for creating string arrays
DDS_TypeCode* type = factory->create_struct_tc("MyType", structMembers, out_exc);
Hi,
I'm struggling with an embedded sequence within a struct. When I try to send it, the application terminates with a SIGABRT.
Given the following IDL:
-------------------------snip-----------------------------
const long MAX_STRING_LENGTH = 256;
enum StudentStatus{
ENROLLED,
ALUMNI
};
struct Student{
string<MAX_STRING_LENGTH> name;
string<MAX_STRING_LENGTH> familyname;
StudentStatus status;
};
Given next field in a topic.
<member name="exerciseNickname" type="string" arrayDimensions="4" stringMaxLength="20"/>
With the usual dynamicdata you have set some array types to set as double, byte, float, etc but there's no set_string_array.
Notice in my case i don't use idl file i use a file .qos to describe every topic instead.
How can i set the array of string?